File tree 2 files changed +26
-60
lines changed
npm-packages/cadence-parser
2 files changed +26
-60
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ class Go {
190
190
191
191
const timeOrigin = Date . now ( ) - performance . now ( ) ;
192
192
this . importObject = {
193
- go : {
193
+ gojs : {
194
194
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
195
195
// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
196
196
// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
Original file line number Diff line number Diff line change @@ -4,117 +4,83 @@ import * as fs from "fs"
4
4
test ( "parse simple" , async ( ) => {
5
5
const binary = fs . readFileSync ( require . resolve ( '../dist/cadence-parser.wasm' ) )
6
6
const parser = await CadenceParser . create ( binary )
7
- const res = parser . parse ( "pub fun main() {}" )
7
+ const res = parser . parse ( "access(all) fun main() {}" )
8
8
expect ( res ) . toEqual ( {
9
9
"program" : {
10
10
"Type" : "Program" ,
11
11
"Declarations" : [
12
12
{
13
- "Access" : "AccessPublic " ,
13
+ "Access" : "AccessAll " ,
14
14
"DocString" : "" ,
15
15
"EndPos" : {
16
- "Column" : 16 ,
16
+ "Column" : 24 ,
17
17
"Line" : 1 ,
18
- "Offset" : 16 ,
18
+ "Offset" : 24 ,
19
19
} ,
20
20
"FunctionBlock" : {
21
21
"Block" : {
22
22
"EndPos" : {
23
- "Column" : 16 ,
23
+ "Column" : 24 ,
24
24
"Line" : 1 ,
25
- "Offset" : 16 ,
25
+ "Offset" : 24 ,
26
26
} ,
27
27
"StartPos" : {
28
- "Column" : 15 ,
28
+ "Column" : 23 ,
29
29
"Line" : 1 ,
30
- "Offset" : 15 ,
30
+ "Offset" : 23 ,
31
31
} ,
32
32
"Statements" : null ,
33
33
"Type" : "Block" ,
34
34
} ,
35
35
"EndPos" : {
36
- "Column" : 16 ,
36
+ "Column" : 24 ,
37
37
"Line" : 1 ,
38
- "Offset" : 16 ,
38
+ "Offset" : 24 ,
39
39
} ,
40
40
"StartPos" : {
41
- "Column" : 15 ,
41
+ "Column" : 23 ,
42
42
"Line" : 1 ,
43
- "Offset" : 15 ,
43
+ "Offset" : 23 ,
44
44
} ,
45
45
"Type" : "FunctionBlock" ,
46
46
} ,
47
47
"Identifier" : {
48
48
"EndPos" : {
49
- "Column" : 11 ,
49
+ "Column" : 19 ,
50
50
"Line" : 1 ,
51
- "Offset" : 11 ,
51
+ "Offset" : 19 ,
52
52
} ,
53
53
"Identifier" : "main" ,
54
54
"StartPos" : {
55
- "Column" : 8 ,
55
+ "Column" : 16 ,
56
56
"Line" : 1 ,
57
- "Offset" : 8 ,
57
+ "Offset" : 16 ,
58
58
} ,
59
59
} ,
60
+ "IsNative" : false ,
61
+ "IsStatic" : false ,
60
62
"ParameterList" : {
61
63
"EndPos" : {
62
- "Column" : 13 ,
64
+ "Column" : 21 ,
63
65
"Line" : 1 ,
64
- "Offset" : 13 ,
66
+ "Offset" : 21 ,
65
67
} ,
66
68
"Parameters" : null ,
67
69
"StartPos" : {
68
- "Column" : 12 ,
69
- "Line" : 1 ,
70
- "Offset" : 12 ,
71
- } ,
72
- } ,
73
- "ReturnTypeAnnotation" : {
74
- "AnnotatedType" : {
75
- "EndPos" : {
76
- "Column" : 12 ,
77
- "Line" : 1 ,
78
- "Offset" : 12 ,
79
- } ,
80
- "Identifier" : {
81
- "EndPos" : {
82
- "Column" : 12 ,
83
- "Line" : 1 ,
84
- "Offset" : 12 ,
85
- } ,
86
- "Identifier" : "" ,
87
- "StartPos" : {
88
- "Column" : 13 ,
89
- "Line" : 1 ,
90
- "Offset" : 13 ,
91
- } ,
92
- } ,
93
- "StartPos" : {
94
- "Column" : 13 ,
95
- "Line" : 1 ,
96
- "Offset" : 13 ,
97
- } ,
98
- "Type" : "NominalType" ,
99
- } ,
100
- "EndPos" : {
101
- "Column" : 12 ,
102
- "Line" : 1 ,
103
- "Offset" : 12 ,
104
- } ,
105
- "IsResource" : false ,
106
- "StartPos" : {
107
- "Column" : 13 ,
70
+ "Column" : 20 ,
108
71
"Line" : 1 ,
109
- "Offset" : 13 ,
72
+ "Offset" : 20 ,
110
73
} ,
111
74
} ,
75
+ "Purity" : "Unspecified" ,
76
+ "ReturnTypeAnnotation" : null ,
112
77
"StartPos" : {
113
78
"Column" : 0 ,
114
79
"Line" : 1 ,
115
80
"Offset" : 0 ,
116
81
} ,
117
82
"Type" : "FunctionDeclaration" ,
83
+ "TypeParameterList" : null ,
118
84
} ,
119
85
] ,
120
86
} ,
You can’t perform that action at this time.
0 commit comments