From 88ca087320248cf665a1dfa0af73c62e9d11024d Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 3 Apr 2018 20:06:26 +0200 Subject: Fix : constructor in list patterns --- interpreter/parse.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/interpreter/parse.c b/interpreter/parse.c index 9de6a15..2548262 100644 --- a/interpreter/parse.c +++ b/interpreter/parse.c @@ -148,6 +148,16 @@ bool parse_simple_expression(struct expression *expr, struct parsing_list *list) list->i++; return true; } + } else if (list->tokens->elems[list->i].kind == TOKEN_COLON) { + list->i++; + if (!parse_simple_expression(expr->var2, list) || + list->tokens->elems[list->i].kind != TOKEN_CLOSE_SQ) { + free_expression(expr); + return false; + } else { + list->i++; + return true; + } } default: -- cgit v1.2.3