Skip to content

Commit 4436516

Browse files
committed
glayzzle#194 - release snapshots (injecting trailingComments property)
1 parent 4677048 commit 4436516

File tree

3 files changed

+100
-93
lines changed

3 files changed

+100
-93
lines changed

test/snapshot/__snapshots__/acid.test.js.snap

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,27 @@ Program {
171171
},
172172
},
173173
"raw": "Hello",
174+
"trailingComments": Array [
175+
CommentLine {
176+
"kind": "commentline",
177+
"loc": Location {
178+
"end": Position {
179+
"column": 0,
180+
"line": 11,
181+
"offset": 199,
182+
},
183+
"source": "# single line comment
184+
",
185+
"start": Position {
186+
"column": 2,
187+
"line": 10,
188+
"offset": 177,
189+
},
190+
},
191+
"value": "# single line comment
192+
",
193+
},
194+
],
174195
"value": "Hello",
175196
},
176197
UseGroup {
@@ -257,27 +278,6 @@ Program {
257278
},
258279
],
259280
"kind": "usegroup",
260-
"leadingComments": Array [
261-
CommentLine {
262-
"kind": "commentline",
263-
"loc": Location {
264-
"end": Position {
265-
"column": 0,
266-
"line": 11,
267-
"offset": 199,
268-
},
269-
"source": "# single line comment
270-
",
271-
"start": Position {
272-
"column": 2,
273-
"line": 10,
274-
"offset": 177,
275-
},
276-
},
277-
"value": "# single line comment
278-
",
279-
},
280-
],
281281
"loc": Location {
282282
"end": Position {
283283
"column": 3,
@@ -2430,6 +2430,27 @@ Program {
24302430
},
24312431
},
24322432
"name": "Line",
2433+
"trailingComments": Array [
2434+
CommentLine {
2435+
"kind": "commentline",
2436+
"loc": Location {
2437+
"end": Position {
2438+
"column": 0,
2439+
"line": 79,
2440+
"offset": 1591,
2441+
},
2442+
"source": "// this is SPARTA !
2443+
",
2444+
"start": Position {
2445+
"column": 2,
2446+
"line": 78,
2447+
"offset": 1571,
2448+
},
2449+
},
2450+
"value": "// this is SPARTA !
2451+
",
2452+
},
2453+
],
24332454
},
24342455
_Function {
24352456
"arguments": Array [],
@@ -3282,27 +3303,6 @@ next:
32823303
},
32833304
"byref": false,
32843305
"kind": "function",
3285-
"leadingComments": Array [
3286-
CommentLine {
3287-
"kind": "commentline",
3288-
"loc": Location {
3289-
"end": Position {
3290-
"column": 0,
3291-
"line": 79,
3292-
"offset": 1591,
3293-
},
3294-
"source": "// this is SPARTA !
3295-
",
3296-
"start": Position {
3297-
"column": 2,
3298-
"line": 78,
3299-
"offset": 1571,
3300-
},
3301-
},
3302-
"value": "// this is SPARTA !
3303-
",
3304-
},
3305-
],
33063306
"loc": Location {
33073307
"end": Position {
33083308
"column": 3,
@@ -3889,6 +3889,27 @@ next:
38893889
"offset": 2679,
38903890
},
38913891
},
3892+
"trailingComments": Array [
3893+
CommentLine {
3894+
"kind": "commentline",
3895+
"loc": Location {
3896+
"end": Position {
3897+
"column": 0,
3898+
"line": 128,
3899+
"offset": 2803,
3900+
},
3901+
"source": "// @todo $this->a_$foo
3902+
",
3903+
"start": Position {
3904+
"column": 6,
3905+
"line": 127,
3906+
"offset": 2780,
3907+
},
3908+
},
3909+
"value": "// @todo $this->a_$foo
3910+
",
3911+
},
3912+
],
38923913
},
38933914
"increment": Array [
38943915
Post {
@@ -4202,27 +4223,6 @@ next:
42024223
"type": "??",
42034224
},
42044225
"kind": "return",
4205-
"leadingComments": Array [
4206-
CommentLine {
4207-
"kind": "commentline",
4208-
"loc": Location {
4209-
"end": Position {
4210-
"column": 0,
4211-
"line": 128,
4212-
"offset": 2803,
4213-
},
4214-
"source": "// @todo $this->a_$foo
4215-
",
4216-
"start": Position {
4217-
"column": 6,
4218-
"line": 127,
4219-
"offset": 2780,
4220-
},
4221-
},
4222-
"value": "// @todo $this->a_$foo
4223-
",
4224-
},
4225-
],
42264226
"loc": Location {
42274227
"end": Position {
42284228
"column": 28,
@@ -6178,10 +6178,7 @@ next:
61786178
},
61796179
"name": "foo",
61806180
},
6181-
},
6182-
Assign {
6183-
"kind": "assign",
6184-
"leadingComments": Array [
6181+
"trailingComments": Array [
61856182
CommentLine {
61866183
"kind": "commentline",
61876184
"loc": Location {
@@ -6202,6 +6199,9 @@ next:
62026199
",
62036200
},
62046201
],
6202+
},
6203+
Assign {
6204+
"kind": "assign",
62056205
"left": List {
62066206
"arguments": Array [
62076207
null,

test/snapshot/__snapshots__/class.test.js.snap

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,7 @@ Program {
2727
},
2828
],
2929
"kind": "traituse",
30-
"traits": Array [
31-
Identifier {
32-
"kind": "identifier",
33-
"name": "B",
34-
"resolution": "uqn",
35-
},
36-
],
37-
},
38-
Property {
39-
"isAbstract": false,
40-
"isFinal": false,
41-
"isStatic": false,
42-
"kind": "property",
43-
"leadingComments": Array [
30+
"trailingComments": Array [
4431
CommentLine {
4532
"kind": "commentline",
4633
"value": "// comment
@@ -58,6 +45,19 @@ Program {
5845
*/",
5946
},
6047
],
48+
"traits": Array [
49+
Identifier {
50+
"kind": "identifier",
51+
"name": "B",
52+
"resolution": "uqn",
53+
},
54+
],
55+
},
56+
Property {
57+
"isAbstract": false,
58+
"isFinal": false,
59+
"isStatic": false,
60+
"kind": "property",
6161
"name": "var",
6262
"value": Boolean {
6363
"kind": "boolean",

test/snapshot/__snapshots__/lexer.test.js.snap

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,43 +122,50 @@ Program {
122122
"kind": "inline",
123123
"raw": "
124124
",
125-
"value": "
126-
",
127-
},
128-
Inline {
129-
"kind": "inline",
130-
"leadingComments": Array [
125+
"trailingComments": Array [
131126
CommentLine {
132127
"kind": "commentline",
133128
"value": "// simple comment ",
134129
},
135130
],
136-
"raw": "
131+
"value": "
137132
",
138-
"value": " ",
139133
},
140134
Inline {
141135
"kind": "inline",
142-
"leadingComments": Array [
136+
"raw": "
137+
",
138+
"trailingComments": Array [
143139
CommentLine {
144140
"kind": "commentline",
145141
"value": "// another line ",
146142
},
147143
],
148-
"raw": "
149-
",
150144
"value": " ",
151145
},
152146
Inline {
153147
"kind": "inline",
154-
"leadingComments": Array [
148+
"raw": "
149+
",
150+
"trailingComments": Array [
155151
CommentBlock {
156152
"kind": "commentblock",
157153
"value": "/**/",
158154
},
159155
],
156+
"value": " ",
157+
},
158+
Inline {
159+
"kind": "inline",
160160
"raw": "
161161
",
162+
"trailingComments": Array [
163+
CommentLine {
164+
"kind": "commentline",
165+
"value": "// last comment
166+
",
167+
},
168+
],
162169
"value": " ",
163170
},
164171
],

0 commit comments

Comments
 (0)