From 9cf3e034de954f9b221fd72f6cd02334d47bda89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 25 Jul 2018 18:45:53 +0200
Subject: [PATCH] Macroprocessor: allow empty arrays

This is now easy to implement, thanks to the refactoring allowing any type of
objects in arrays.

Closes DynareTeam/dynare#707
---
 src/macro/MacroBison.yy | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/macro/MacroBison.yy b/src/macro/MacroBison.yy
index ea6bae15..84a4a36e 100644
--- a/src/macro/MacroBison.yy
+++ b/src/macro/MacroBison.yy
@@ -207,7 +207,8 @@ expr : INTEGER
        { TYPERR_CATCH($$ = $3->in($1), @$); }
      ;
 
-comma_expr : expr
+comma_expr : { $$ = vector<MacroValuePtr>{}; } // Empty array
+           | expr
              { $$ = vector<MacroValuePtr>{$1}; }
            | comma_expr COMMA expr
              { $1.push_back($3); $$ = $1; }
-- 
GitLab