/** * The punctuation half of the scan: the delimiters that open and close a * nesting, the separators that stand between two things, the operators, and * the two characters left over. Each family answers for the characters it * claims in the order the switch it came from read them, and hands the rest to * the next one, so a character reaches exactly the arm it always did. * * D115 §三 / D114 R1f: `lexer.ts` keeps the loop, the budgets and the cascade * of shape scanners; this is the character switch that was the rest of `lex`. */ import { type Diagnostic, type DiagnosticFix } from "../diagnostic.ts"; import { type TokenKind } from "../token.ts"; /** Everything this half of the lexer asks of the scanner that hosts it, and nothing more. */ export interface PunctuationScannerHost { advance(): string; closeBracket(): void; readonly diagnostics: { push(...reports: readonly Diagnostic[]): void; }; invalidCharacter(character: string, start: number): void; isDigit(character: string): boolean; openBracket(start: number): void; operator(single: TokenKind, compound: TokenKind, start: number): void; peek(distance?: number): string; readHashComment(start: number): boolean; readHexColor(start: number): boolean; readJavaScriptPrivateIdentifier(start: number): boolean; readLeadingDotNumber(): void; simple(kind: TokenKind, start: number, length: number): void; trailingSemicolonFix(start: number): DiagnosticFix | undefined; wordOperatorFix(start: number, end: number, word: string, title: string): DiagnosticFix; } export declare class PunctuationScanner { private readonly host; constructor(host: PunctuationScannerHost); /** One punctuation character read as the token it spells, or refused as invalid. */ readPunctuation(character: string, start: number): void; /** The three bracket pairs, each also moving the nesting the rest of the scan reads. */ private readDelimiter; /** What stands between two things: ':', ';', ',', '@', '.' and '?'. */ private readSeparator; /** The arithmetic, comparison, bitwise and logical operators, with the guidance the refused spellings carry. */ private readOperator; /** '#', which four scanners compete for, and every character none of them claims. */ private readRemaining; } //# sourceMappingURL=punctuation.d.ts.map