2022-05-24 14:05:26 +00:00
|
|
|
export interface TokenLocation {
|
|
|
|
name: string,
|
2022-06-02 10:31:31 +00:00
|
|
|
startLine: number,
|
|
|
|
startCol: number,
|
|
|
|
endLine: number,
|
|
|
|
endCol: number
|
2022-05-24 14:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TokenLink {
|
|
|
|
current: TokenLocation,
|
|
|
|
definition: TokenLocation
|
|
|
|
}
|
|
|
|
|
2022-07-26 13:58:28 +00:00
|
|
|
export interface TokenImport {
|
|
|
|
current: TokenLocation,
|
|
|
|
path: string
|
|
|
|
}
|
|
|
|
|
2022-05-17 12:05:25 +00:00
|
|
|
export interface ErrorInfo {
|
2023-09-28 10:00:53 +00:00
|
|
|
infoType: "error",
|
2022-05-17 12:05:25 +00:00
|
|
|
start: number,
|
|
|
|
end: number,
|
|
|
|
message: string,
|
|
|
|
location: string | null
|
|
|
|
}
|
|
|
|
|
2023-09-25 13:00:43 +00:00
|
|
|
export interface WarningInfo {
|
2023-09-28 10:00:53 +00:00
|
|
|
infoType: "warning",
|
2023-09-25 13:00:43 +00:00
|
|
|
start: number,
|
|
|
|
end: number,
|
|
|
|
message: string,
|
|
|
|
location: string | null
|
|
|
|
}
|
|
|
|
|
2022-05-24 14:05:26 +00:00
|
|
|
export interface CompilationResult {
|
|
|
|
errors: ErrorInfo[],
|
2023-09-25 13:00:43 +00:00
|
|
|
warnings: WarningInfo[],
|
2022-07-26 13:58:28 +00:00
|
|
|
locations: TokenLink[],
|
|
|
|
importLocations: TokenImport[]
|
2022-05-24 14:05:26 +00:00
|
|
|
}
|
|
|
|
|
2022-05-17 12:05:25 +00:00
|
|
|
export class Compiler {
|
2022-05-24 14:05:26 +00:00
|
|
|
compile(path: string, imports: string[]): Promise<CompilationResult>;
|
2022-05-17 12:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export var AquaLSP: Compiler;
|