diff options
-rw-r--r-- | mparser.py | 12 | ||||
-rw-r--r-- | test cases/common/20 array/meson.build | 4 |
2 files changed, 13 insertions, 3 deletions
@@ -137,8 +137,16 @@ def p_statement_comparison(t): t[0] = nodes.Comparison(t[1], t[2], t[3], t[1].lineno()) def p_statement_array(t): - '''statement : LBRACKET args RBRACKET''' - t[0] = nodes.ArrayStatement(t[2], t.lineno(1)) + '''statement : LBRACKET args RBRACKET + | LBRACKET EOL args RBRACKET''' + if len(t) == 4: + t[0] = nodes.ArrayStatement(t[2], t.lineno(1)) + else: + t[0] = nodes.ArrayStatement(t[3], t.lineno(1)) + +def p_statement_array2(t): + '''statement : LBRACKET args EOL RBRACKET + | LBRACKET EOL args EOL RBRACKET''' def p_statement_func_call(t): 'statement : expression LPAREN args RPAREN' diff --git a/test cases/common/20 array/meson.build b/test cases/common/20 array/meson.build index a3eac90..611e94e 100644 --- a/test cases/common/20 array/meson.build +++ b/test cases/common/20 array/meson.build @@ -1,6 +1,8 @@ project('array test', 'c') -arr = ['func.c', 'prog.c'] +arr = [ + 'func.c', + 'prog.c'] exe = executable('prog', sources : arr) add_test('arr test', exe) |