diff options
author | Camil Staps | 2018-04-03 20:06:26 +0200 |
---|---|---|
committer | Camil Staps | 2018-04-03 20:06:26 +0200 |
commit | 88ca087320248cf665a1dfa0af73c62e9d11024d (patch) | |
tree | 107bc33178782aeec962f85e67433d0f3cb2a089 /interpreter | |
parent | Extend examples (diff) |
Fix : constructor in list patterns
Diffstat (limited to 'interpreter')
-rw-r--r-- | interpreter/parse.c | 10 |
1 files changed, 10 insertions, 0 deletions
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: |