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 | ImportDeclaration = 9,
|
14 | ObjectKey = 10,
|
15 | ImportAccess = 11
|
16 | }
|
17 | export declare function isDeclaration(token: Token): boolean;
|
18 | export declare function isNonTopLevelDeclaration(token: Token): boolean;
|
19 | export declare function isTopLevelDeclaration(token: Token): boolean;
|
20 | export declare function isBlockScopedDeclaration(token: Token): boolean;
|
21 | export declare function isFunctionScopedDeclaration(token: Token): boolean;
|
22 | export declare function isObjectShorthandDeclaration(token: Token): boolean;
|
23 | export declare class Token {
|
24 | constructor();
|
25 | type: TokenType;
|
26 | contextualKeyword: ContextualKeyword;
|
27 | start: number;
|
28 | end: number;
|
29 | scopeDepth: number;
|
30 | isType: boolean;
|
31 | identifierRole: IdentifierRole | null;
|
32 | shadowsGlobal: boolean;
|
33 | isAsyncOperation: boolean;
|
34 | contextId: number | null;
|
35 | rhsEndIndex: number | null;
|
36 | isExpression: boolean;
|
37 | numNullishCoalesceStarts: number;
|
38 | numNullishCoalesceEnds: number;
|
39 | isOptionalChainStart: boolean;
|
40 | isOptionalChainEnd: boolean;
|
41 | subscriptStartIndex: number | null;
|
42 | nullishStartIndex: number | null;
|
43 | }
|
44 | export declare function next(): void;
|
45 | export declare function nextTemplateToken(): void;
|
46 | export declare function retokenizeSlashAsRegex(): void;
|
47 | export declare function pushTypeContext(existingTokensInType: number): boolean;
|
48 | export declare function popTypeContext(oldIsType: boolean): void;
|
49 | export declare function eat(type: TokenType): boolean;
|
50 | export declare function match(type: TokenType): boolean;
|
51 | export declare function lookaheadType(): TokenType;
|
52 | export declare class TypeAndKeyword {
|
53 | type: TokenType;
|
54 | contextualKeyword: ContextualKeyword;
|
55 | constructor(type: TokenType, contextualKeyword: ContextualKeyword);
|
56 | }
|
57 | export declare function lookaheadTypeAndKeyword(): TypeAndKeyword;
|
58 | export declare function nextToken(): void;
|
59 | export declare function skipLineComment(startSkip: number): void;
|
60 | export declare function skipSpace(): void;
|
61 | export declare function finishToken(type: TokenType, contextualKeyword?: ContextualKeyword): void;
|
62 | export declare function getTokenFromCode(code: number): void;
|
63 | export declare function skipWord(): void;
|