import type { Span } from "@velarscript/compiler"; import type { CompilerFormattingOpaqueSourceScan, CompilerLexicalScanContext, CompilerLexicalScanResult, OpaqueEmbeddedSourceScan } from "@velarscript/compiler/extension"; /** * The words the Web extension owns at a statement or expression head. D30 * item 16 made every one of them contextual: the lexer leaves them ordinary * identifiers and the Web parser claims one only where its declaration shape * appears, so `const state = ...` and `component state(...)` can share a * module. The component's compiler-owned names are not here: `@` selects their * separate closed contextual namespace, so they cannot collide at all. */ export declare const WEB_CONTEXTUAL_KEYWORDS: ReadonlySet; export declare const WEB_JSX_TOKEN = "@velarscript/web:jsx"; export declare const WEB_LOOK_TOKEN = "@velarscript/web:look"; export declare const WEB_KEYFRAMES_TOKEN = "@velarscript/web:keyframes"; export declare const WEB_UNSAFE_CSS_TOKEN = "@velarscript/web:unsafe-css"; /** Raw CSS carried only by the Web lexical extension; Core never names CSS. */ export interface WebUnsafeCssBlockSyntax { readonly kind: "WebUnsafeCssBlockSyntax"; readonly css: string; readonly contentSpan: Span; readonly span: Span; } export interface WebExpressionSource { readonly source: string; readonly span: Span; readonly openingIndent: string; } export interface WebJsxAttributeSyntax { readonly name: string; readonly value: string | WebExpressionSource | null; readonly span: Span; } export type WebJsxChildSyntax = WebJsxElementSyntax | WebJsxTextSyntax | WebJsxExpressionSyntax; export interface WebJsxElementSyntax { readonly kind: "WebJsxElementSyntax"; readonly tag: string; readonly tagSpan: Span; readonly attributes: readonly WebJsxAttributeSyntax[]; readonly children: readonly WebJsxChildSyntax[]; readonly span: Span; } export interface WebJsxTextSyntax { readonly kind: "WebJsxTextSyntax"; readonly value: string; readonly span: Span; } export interface WebJsxExpressionSyntax { readonly kind: "WebJsxExpressionSyntax"; readonly expression: WebExpressionSource; readonly span: Span; } export interface WebLookLineSyntax { readonly indent: number; readonly text: string; readonly start: number; readonly end: number; readonly openingIndent: string; } export interface WebLookBlockSyntax { readonly kind: "WebLookBlockSyntax"; readonly lines: readonly WebLookLineSyntax[]; readonly span: Span; } export interface WebKeyframesBlockSyntax { readonly kind: "WebKeyframesBlockSyntax"; readonly lines: readonly WebLookLineSyntax[]; readonly span: Span; } export declare function scanWebToken(context: CompilerLexicalScanContext): CompilerLexicalScanResult | null; /** * Recognizes the Web-owned raw block without teaching Core's formatter or * lexer the `css` word. Both Web consumers share this wrapper so its header * and closing-tail rules cannot drift. */ export declare function scanWebUnsafeCssLiteral(source: string, start: number): (OpaqueEmbeddedSourceScan & CompilerFormattingOpaqueSourceScan) | null; /** * The token kinds a value may follow — every kind here opens a position where a * value begins and a continuation of the expression before it cannot. Both Web * constructs whose spelling is otherwise ordinary Core source decide from it: * `<`, which is otherwise the less-than operator continuing a comparison, and * the `look:` / `keyframes:` block opener, whose word is otherwise an ordinary * identifier continuing a member access — `case Mode.look:` follows a `dot`, * which is no value start. The test is that a value may begin, not that an * operand may not: after `nullish`, `and` and `or` the value that begins is the * operator's own right operand. Those three joined the list so * `{name ?? }` parses and `{ready and }` reaches its type * rejection instead of an untargeted parse cascade. The list is published in * charter §14. * * The three line-boundary kinds — Core's own `newline`, `indent`, `dedent` set — * belong here as one family, because a statement begins a value and the kind * before its first token is whichever of the three the indentation produced. * `dedent` was the missing one, so a construct opening a line at a lower * indentation than the line above it was read as no value start at all, and a * visual block or an element written there unravelled into exactly the parse * cascade this list exists to prevent, in place of its own directed message. */ export declare const WEB_VALUE_START_PREVIOUS_TOKEN_KINDS: readonly string[]; //# sourceMappingURL=lexer.d.ts.map