This commit is contained in:
aps 2023-02-15 12:40:06 -05:00
parent 4c8b5236e7
commit 5bc30984c2
2 changed files with 9 additions and 4 deletions

View File

@ -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() {

View File

@ -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