/** * Spans, the diagnostics written about them, and the two rewrites that move a * structured payload from where the lexer scanned it to where the parser found * its token. * * D115 P4 R3e: every `parser/` collaborator writes diagnostics and builds spans, * so the three constructors live here with the shifting they serve rather than * being spelled again in each file. */ import type { Diagnostic, Span } from "@velarscript/compiler"; import type { Expression } from "@velarscript/compiler/extension"; import { type WebJsxElementExpression as JSXElementExpression } from "../ast.ts"; import type { WebExpressionSource, WebJsxElementSyntax, WebKeyframesBlockSyntax, WebLookBlockSyntax } from "../lexer.ts"; export declare const span: (start: number, end: number) => Span; export declare const diagnostic: (code: string, message: string, sourceSpan: Span) => Diagnostic; export declare const recoveredDiagnostic: (code: string, message: string, sourceSpan: Span) => Diagnostic; export declare function shiftSourceSpan(sourceSpan: Span, offset: number): Span; export declare function shiftExpressionSource(source: WebExpressionSource, offset: number): WebExpressionSource; export declare function shiftJsxSyntax(syntax: WebJsxElementSyntax, offset: number): WebJsxElementSyntax; export declare function shiftLookSyntax(syntax: WebLookBlockSyntax, offset: number): WebLookBlockSyntax; export declare function shiftKeyframesSyntax(syntax: WebKeyframesBlockSyntax, offset: number): WebKeyframesBlockSyntax; export declare function jsxExpression(syntax: WebJsxElementSyntax, parseExpression: (source: WebExpressionSource) => Expression, report: (item: Diagnostic) => void): JSXElementExpression; export declare function replaceLookHooks(expression: Expression, hooks: ReadonlyMap): Expression; //# sourceMappingURL=spans.d.ts.map