aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2018-01-24 22:54:19 +0100
committertomsmeding <tom.smeding@gmail.com>2018-01-24 22:54:19 +0100
commitbd7ef7a572f3faa58a550baca46a1b4f95e9b95d (patch)
tree6d57157a319e3d5fdc2de832d892a06993ecb890
parentc4fe34aecd563b0a27c62bdebd9ec1fcb2941806 (diff)
Allow empty code blocks
-rw-r--r--c.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/c.y b/c.y
index 96866ef..fcf4e1f 100644
--- a/c.y
+++ b/c.y
@@ -115,7 +115,10 @@ parameter: type ID {
$$->name = $2;
} ;
-block: '{' statement_list '}' {
+block: '{' '}' {
+ $$ = node_make_1(N_BLOCK, node_make_0(N_LIST_END));
+ }
+ | '{' statement_list '}' {
$$ = node_make_1(N_BLOCK, $2);
} ;