mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
support empty tuple ()
This commit is contained in:
parent
a9a4ef6dda
commit
4df11f3c6f
@ -1722,6 +1722,11 @@ static Error* exprUnaryOp(Compiler* self) {
|
|||||||
static Error* exprGroup(Compiler* self) {
|
static Error* exprGroup(Compiler* self) {
|
||||||
Error* err;
|
Error* err;
|
||||||
int line = prev()->line;
|
int line = prev()->line;
|
||||||
|
if(match(TK_RPAREN)) {
|
||||||
|
// empty tuple
|
||||||
|
Ctx__s_push(ctx(), (Expr*)TupleExpr__new(line, 0));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
match_newlines();
|
match_newlines();
|
||||||
check(EXPR_TUPLE(self)); // () is just for change precedence
|
check(EXPR_TUPLE(self)); // () is just for change precedence
|
||||||
match_newlines();
|
match_newlines();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user