/** * Numeric literals: the decimal and radix forms, the `_` separators a reader * groups digits with, the suffix a target may own, and the `#rrggbb` colour * literal that is spelled like one. * * D115 §三 / D114 R1f: the number half of `lexer.ts`. */ import { type Diagnostic } from "../diagnostic.ts"; import { type Token } from "../token.ts"; /** Everything this half of the lexer asks of the scanner that hosts it, and nothing more. */ export interface NumberScannerHost { advance(): string; readonly diagnostics: { push(...reports: readonly Diagnostic[]): void; }; index: number; isDigit(character: string): boolean; isIdentifierPart(character: string): boolean; isIdentifierStart(character: string): boolean; readonly numericSuffixes: ReadonlySet; peek(offset?: number): string; readonly text: string; readonly tokens: Token[]; } export declare class NumberScanner { private readonly host; constructor(host: NumberScannerHost); readNumber(): void; readRadixNumber(): void; /** * A number token, carrying the author's own spelling whenever the value it * holds is spelled differently — `1_000` loses its separators and `0X20` * loses its uppercase prefix on the way to the token. D90 R6 quotes the * literal back when it is not exactly representable, and it must quote what * was written: reporting `'10000000000000000001'` for a source line that * reads `1_000_000_000_000_000_000_1` sends the author looking for text that * is not there. */ private pushNumber; private isRadixDigit; /** * LOK-I5: `%` right after a number is the percentage unit only where a * remainder operator could not stand — the operator always takes a right * operand, so a `%` followed by a line end, a closing bracket, or a * separator is a unit spelling and nothing else. */ private isPercentUnitPosition; readLeadingDotNumber(): void; private readDigitsWithSeparators; readHexColor(start: number): boolean; } //# sourceMappingURL=numbers.d.ts.map