@@ -11,8 +11,10 @@ declare namespace acorn {
11
11
[ Symbol . iterator ] ( ) : Iterator < Token >
12
12
}
13
13
14
+ type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
15
+
14
16
interface Options {
15
- ecmaVersion : 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
17
+ ecmaVersion : ecmaVersion
16
18
sourceType ?: 'script' | 'module'
17
19
onInsertedSemicolon ?: ( lastTokEnd : number , lastTokEndLoc ?: Position ) => void
18
20
onTrailingComma ?: ( lastTokEnd : number , lastTokEndLoc ?: Position ) => void
@@ -36,8 +38,41 @@ declare namespace acorn {
36
38
}
37
39
38
40
class Parser {
41
+ // state.js
42
+ lineStart : number ;
43
+ options : Options ;
44
+ curLine : number ;
45
+ start : number ;
46
+ end : number ;
47
+ input : string ;
48
+ type : TokenType ;
49
+
50
+ // state.js
39
51
constructor ( options : Options , input : string , startPos ?: number )
40
52
parse ( this : Parser ) : Node
53
+
54
+ // tokenize.js
55
+ next ( ) : void ;
56
+ nextToken ( ) : void ;
57
+
58
+ // statement.js
59
+ parseTopLevel ( node : Node ) : Node ;
60
+
61
+ // node.js
62
+ finishNode ( node : Node , type : string ) : Node ;
63
+ finishNodeAt ( node : Node , type : string , pos : number , loc : Position ) : Node ;
64
+
65
+ // location.js
66
+ raise ( pos : number , message : string ) : void ;
67
+ raiseRecoverable ?( pos : number , message : string ) : void ;
68
+
69
+ // parseutils.js
70
+ unexpected ( pos : number ) : void ;
71
+
72
+ // index.js
73
+ static acorn : typeof acorn ;
74
+
75
+ // state.js
41
76
static parse ( this : typeof Parser , input : string , options : Options ) : Node
42
77
static parseExpressionAt ( this : typeof Parser , input : string , pos : number , options : Options ) : Node
43
78
static tokenizer ( this : typeof Parser , input : string , options : Options ) : {
0 commit comments