1 | import { ContextualKeyword } from "./keywords";
|
2 | import { TokenType } from "./types";
|
3 | export declare enum IdentifierRole {
|
4 | Access = 0,
|
5 | ExportAccess = 1,
|
6 | TopLevelDeclaration = 2,
|
7 | FunctionScopedDeclaration = 3,
|
8 | BlockScopedDeclaration = 4,
|
9 | ObjectShorthandTopLevelDeclaration = 5,
|
10 | ObjectShorthandFunctionScopedDeclaration = 6,
|
11 | ObjectShorthandBlockScopedDeclaration = 7,
|
12 | ObjectShorthand = 8,
|
13 | ObjectKey = 9
|
14 | }
|
15 | export declare function isDeclaration(token: Token): boolean;
|
16 | export declare function isNonTopLevelDeclaration(token: Token): boolean;
|
17 | export declare function isBlockScopedDeclaration(token: Token): boolean;
|
18 | export declare function isFunctionScopedDeclaration(token: Token): boolean;
|
19 | export declare function isObjectShorthandDeclaration(token: Token): boolean;
|
20 | export declare class Token {
|
21 | constructor();
|
22 | type: TokenType;
|
23 | contextualKeyword: ContextualKeyword;
|
24 | start: number;
|
25 | end: number;
|
26 | isType: boolean;
|
27 | identifierRole: IdentifierRole | null;
|
28 | shadowsGlobal: boolean;
|
29 | contextId: number | null;
|
30 | rhsEndIndex: number | null;
|
31 | isExpression: boolean;
|
32 | }
|
33 | export declare function next(): void;
|
34 | export declare function nextTemplateToken(): void;
|
35 | export declare function retokenizeSlashAsRegex(): void;
|
36 | export declare function pushTypeContext(existingTokensInType: number): boolean;
|
37 | export declare function popTypeContext(oldIsType: boolean): void;
|
38 | export declare function eat(type: TokenType): boolean;
|
39 | export declare function match(type: TokenType): boolean;
|
40 | export declare function lookaheadType(): TokenType;
|
41 | export declare class TypeAndKeyword {
|
42 | type: TokenType;
|
43 | contextualKeyword: ContextualKeyword;
|
44 | constructor(type: TokenType, contextualKeyword: ContextualKeyword);
|
45 | }
|
46 | export declare function lookaheadTypeAndKeyword(): TypeAndKeyword;
|
47 | export declare function nextToken(): void;
|
48 | export declare function skipLineComment(startSkip: number): void;
|
49 | export declare function skipSpace(): void;
|
50 | export declare function finishToken(type: TokenType, contextualKeyword?: ContextualKeyword): void;
|
51 | export declare function getTokenFromCode(code: number): void;
|
52 | export declare function skipWord(): void;
|