mirror of
https://github.com/pocketpy/pocketpy
synced 2025-11-09 13:10:17 +00:00
F
This commit is contained in:
parent
4c8b5236e7
commit
5bc30984c2
@ -503,6 +503,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void exprGrouping() {
|
void exprGrouping() {
|
||||||
|
// co()->_rvalue = true;
|
||||||
match_newlines(mode()==REPL_MODE);
|
match_newlines(mode()==REPL_MODE);
|
||||||
do {
|
do {
|
||||||
if (peek() == TK(")")) break;
|
if (peek() == TK(")")) break;
|
||||||
@ -518,16 +519,18 @@ private:
|
|||||||
// and push it on the stack as well,
|
// and push it on the stack as well,
|
||||||
// so it is available as a value
|
// so it is available as a value
|
||||||
// in the expression
|
// in the expression
|
||||||
emit(OP_LOAD_NAME_REF, index);
|
|
||||||
consume(TK(":="));
|
consume(TK(":="));
|
||||||
|
emit(OP_LOAD_NAME_REF, index);
|
||||||
EXPR();
|
EXPR();
|
||||||
|
// emit(OP_LOAD_NAME, index);
|
||||||
emit(OP_STORE_REF);
|
emit(OP_STORE_REF);
|
||||||
emit(OP_LOAD_NAME, index);
|
//emit(OP_LOAD_NAME_REF, index);;
|
||||||
}
|
}
|
||||||
else EXPR_TUPLE();
|
else EXPR();
|
||||||
} while (match(TK(",")));
|
} while (match(TK(",")));
|
||||||
match_newlines(mode()==REPL_MODE);
|
match_newlines(mode()==REPL_MODE);
|
||||||
consume(TK(")"));
|
consume(TK(")"));
|
||||||
|
// co()->_rvalue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void exprList() {
|
void exprList() {
|
||||||
|
|||||||
@ -119,7 +119,9 @@ assert round(-23.2) == -23
|
|||||||
assert round(-23.8) == -24
|
assert round(-23.8) == -24
|
||||||
|
|
||||||
assert (x := 1) == 1
|
assert (x := 1) == 1
|
||||||
assert (a := 1, b := 2)
|
assert (x := 1, y := 2 ) == (1, 2)
|
||||||
|
z = (a := 1, b := 2)
|
||||||
|
print(z)
|
||||||
assert a == 1
|
assert a == 1
|
||||||
assert b == 2
|
assert b == 2
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user