harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit cdae8e4489fb1a60243afff3ee6597500668180a
parent d0dec8368368702e7ebe8528e7ad0f34711e9297
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Wed, 20 Jan 2021 13:23:41 -0500

Allow scope expressions to be compound expressions

Diffstat:
Msrc/parse.c | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/parse.c b/src/parse.c @@ -1798,6 +1798,8 @@ parse_deferred_expression(struct lexer *lexer) return exp; } +static struct ast_expression *parse_expression_list(struct lexer *lexer); + static struct ast_expression * parse_scope_expression(struct lexer *lexer) { @@ -1845,6 +1847,13 @@ parse_scope_expression(struct lexer *lexer) assert(0); // TODO: Wrap value in unary dereference } return value; + case T_LBRACE: + unlex(lexer, &tok); + value = parse_expression_list(lexer); + if (indirect) { + assert(0); // TODO: Wrap value in unary dereference + } + return value; case T_DEFER: unlex(lexer, &tok); return parse_deferred_expression(lexer);