UNPKG

1.06 kBTypeScriptView Raw
1import type { ContextualKeyword } from "../tokenizer/keywords";
2import { TokenType } from "../tokenizer/types";
3export declare function isContextual(contextualKeyword: ContextualKeyword): boolean;
4export declare function isLookaheadContextual(contextualKeyword: ContextualKeyword): boolean;
5export declare function eatContextual(contextualKeyword: ContextualKeyword): boolean;
6export declare function expectContextual(contextualKeyword: ContextualKeyword): void;
7export declare function canInsertSemicolon(): boolean;
8export declare function hasPrecedingLineBreak(): boolean;
9export declare function hasFollowingLineBreak(): boolean;
10export declare function isLineTerminator(): boolean;
11export declare function semicolon(): void;
12export declare function expect(type: TokenType): void;
13/**
14 * Transition the parser to an error state. All code needs to be written to naturally unwind in this
15 * state, which allows us to backtrack without exceptions and without error plumbing everywhere.
16 */
17export declare function unexpected(message?: string, pos?: number): void;