mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
fix a compiler bug of []
This commit is contained in:
parent
e097313c8f
commit
c0866022fb
@ -392,6 +392,7 @@ namespace pkpy{
|
|||||||
// a[<0> <state:1> : state<3> : state<5>]
|
// a[<0> <state:1> : state<3> : state<5>]
|
||||||
int state = 0;
|
int state = 0;
|
||||||
do{
|
do{
|
||||||
|
match_newlines_repl();
|
||||||
switch(state){
|
switch(state){
|
||||||
case 0:
|
case 0:
|
||||||
if(match(TK(":"))){
|
if(match(TK(":"))){
|
||||||
@ -439,6 +440,7 @@ namespace pkpy{
|
|||||||
break;
|
break;
|
||||||
case 5: consume(TK("]")); goto __SUBSCR_END;
|
case 5: consume(TK("]")); goto __SUBSCR_END;
|
||||||
}
|
}
|
||||||
|
match_newlines_repl();
|
||||||
}while(true);
|
}while(true);
|
||||||
__SUBSCR_END:
|
__SUBSCR_END:
|
||||||
if(is_slice){
|
if(is_slice){
|
||||||
|
@ -84,3 +84,14 @@ assert b == [1, 2, 3, 4, 5]
|
|||||||
a = []
|
a = []
|
||||||
b = [*a, 1, 2, 3, *a, *a]
|
b = [*a, 1, 2, 3, *a, *a]
|
||||||
assert b == [1, 2, 3]
|
assert b == [1, 2, 3]
|
||||||
|
|
||||||
|
assert b[
|
||||||
|
1
|
||||||
|
] == 2
|
||||||
|
|
||||||
|
assert b[0
|
||||||
|
] == 1
|
||||||
|
|
||||||
|
assert b[0] == 1
|
||||||
|
assert b[
|
||||||
|
0] == 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user