diff options
-rw-r--r-- | src/parser.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c index 6e6838a..3554f03 100644 --- a/src/parser.c +++ b/src/parser.c @@ -52,11 +52,14 @@ parseblk(struct ast *ast, struct lexemes toks) if (toks.kinds[toksidx++] != LEXLBRACE) err("parser: Expected left brace"); + if (toks.kinds[toksidx] != LEXRBRACE) { + idx_t_ stmt = parsestmt(ast, toks); + ast->kids[i].lhs = ast->kids[i].rhs = stmt; + } + while (toks.kinds[toksidx] != LEXRBRACE) { idx_t_ stmt = parsestmt(ast, toks); ast->kids[i].rhs = stmt; - if (ast->kids[i].lhs == AST_EMPTY) - ast->kids[i].lhs = ast->kids[i].rhs; } toksidx++; /* Eat rbrace */ |