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 {
|
|
|
|
start: number,
|
|
|
|
end: number,
|
|
|
|
message: string,
|
|
|
|
location: string | null
|
|
|
|
}
|
|
|
|
|
2022-05-24 14:05:26 +00:00
|
|
|
export interface CompilationResult {
|
|
|
|
errors: ErrorInfo[],
|
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;
|