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