@dbml/parse
Version:
> TODO: description
43 lines (42 loc) • 1.32 kB
TypeScript
import { CompileError } from '../errors';
import { default as Report } from '../report';
import { SyntaxToken, SyntaxTokenKind } from './tokens';
export default class Lexer {
private start;
private current;
private text;
private tokens;
private errors;
constructor(text: string);
private isAtEnd;
private advance;
private peek;
check(sequence: string): boolean;
match(sequence: string): boolean;
private addToken;
private createToken;
lex(): Report<SyntaxToken[], CompileError>;
scanTokens(): void;
gatherTrivia(): void;
gatherInvalid(): void;
consumeUntil(tokenKind: SyntaxTokenKind, stopSequence: string, { allowNewline, // Whether newline is allowed
allowEof, // Whether EOF is allowed
raw, // Whether to interpret '\' as a backlash
consumeStopSequence, }: {
allowNewline: boolean;
allowEof: boolean;
raw: boolean;
consumeStopSequence?: boolean;
}): void;
singleLineStringLiteral(): void;
multilineStringLiteral(): void;
functionExpression(): void;
quotedVariable(): void;
singleLineComment(): void;
multilineComment(): void;
identifier(): void;
operator(): void;
numericLiteralOrIdentifier(): void;
colorLiteral(): void;
escapedString(): string;
}