@casual-simulation/aux-runtime
Version:
Runtime for AUX projects
23 lines • 850 B
TypeScript
export interface CodeLocation {
/**
* The zero based line number that the location represents.
*/
lineNumber: number;
/**
* The zero based column number that the location represents.
*/
column: number;
}
/**
* Calculates the character index that the given location occurrs at in the given string.
* @param code The string.
* @param location The location to get the index of. LIne and column numbers are zero-based.
*/
export declare function calculateIndexFromLocation(code: string, location: CodeLocation): number;
/**
* Calculates the line and column number that the given index occurrs at in the given string.
* @param code The code.
* @param index The index.
*/
export declare function calculateLocationFromIndex(code: string, index: number): CodeLocation;
//# sourceMappingURL=TranspilerUtils.d.ts.map