Issue #83: Distinguish initializer lists from expression lists
diff --git a/tests/test_c_generator.py b/tests/test_c_generator.py
index 5392603..4251535 100644
--- a/tests/test_c_generator.py
+++ b/tests/test_c_generator.py
@@ -130,6 +130,13 @@
return 0;
}''')
+ def test_issue83(self):
+ self._assert_ctoc_correct(r'''
+ void x(void) {
+ int i = (9, k);
+ }
+ ''')
+
def test_issue84(self):
self._assert_ctoc_correct(r'''
void x(void) {
diff --git a/tests/test_c_parser.py b/tests/test_c_parser.py
index 946cee5..c0bfe1e 100644
--- a/tests/test_c_parser.py
+++ b/tests/test_c_parser.py
@@ -68,7 +68,7 @@
if typ == NamedInitializer:
des = [expand_init(dp) for dp in init.name]
return (des, expand_init(init.expr))
- elif typ == ExprList:
+ elif typ in (InitList, ExprList):
return [expand_init(expr) for expr in init.exprs]
elif typ == Constant:
return ['Constant', init.type, init.value]