From 525c2b1f6abb5db4958de654fe95003b8050f6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind?= Date: Mon, 14 Feb 2022 15:29:50 +0100 Subject: [PATCH] Added grouping --- exercises/02/vslc/src/parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02/vslc/src/parser.y b/exercises/02/vslc/src/parser.y index 059a3ce..0dde3de 100644 --- a/exercises/02/vslc/src/parser.y +++ b/exercises/02/vslc/src/parser.y @@ -247,7 +247,7 @@ expression: node_init($$ = malloc(sizeof(node_t)), EXPRESSION, strdup("~"), 1, $2); } | '(' expression ')' { - $$ = $2; + node_init($$ = malloc(sizeof(node_t)), EXPRESSION, /*NULL*/ strdup("group"), 1, $2); } | number { node_init($$ = malloc(sizeof(node_t)), EXPRESSION, /*NULL*/ strdup("number"), 1, $1);