File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1180,6 +1180,10 @@ func TestExpr(t *testing.T) {
1180
1180
`bitushr(-100, 5)` ,
1181
1181
576460752303423484 ,
1182
1182
},
1183
+ {
1184
+ `"hello"[1:3]` ,
1185
+ "el" ,
1186
+ },
1183
1187
}
1184
1188
1185
1189
for _ , tt := range tests {
Original file line number Diff line number Diff line change @@ -369,9 +369,8 @@ func (p *parser) parseSecondary() Node {
369
369
return node
370
370
case String :
371
371
p .next ()
372
- node : = & StringNode {Value : token .Value }
372
+ node = & StringNode {Value : token .Value }
373
373
node .SetLocation (token .Location )
374
- return node
375
374
376
375
default :
377
376
if token .Is (Bracket , "[" ) {
Original file line number Diff line number Diff line change @@ -523,6 +523,14 @@ world`},
523
523
Property : & IntegerNode {Value : 0 },
524
524
},
525
525
},
526
+ {
527
+ `"hello"[1:3]` ,
528
+ & SliceNode {
529
+ Node : & StringNode {Value : "hello" },
530
+ From : & IntegerNode {Value : 1 },
531
+ To : & IntegerNode {Value : 3 },
532
+ },
533
+ },
526
534
}
527
535
for _ , test := range tests {
528
536
t .Run (test .input , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments