summaryrefslogtreecommitdiff
path: root/pycparser
diff options
context:
space:
mode:
authoreli.bendersky <devnull@localhost>2010-10-30 15:50:47 +0200
committereli.bendersky <devnull@localhost>2010-10-30 15:50:47 +0200
commit9f4815676a33437827c33680683cc4d664d5ff00 (patch)
tree5f3e5649196e2b89c3bd690f8699f463f94ac226 /pycparser
parentf890a86b31bc8095a501044e4b2071ffc993844d (diff)
downloadpycparser-9f4815676a33437827c33680683cc4d664d5ff00.tar.gz
compound literals now work - a couple of tests added
Diffstat (limited to 'pycparser')
-rw-r--r--pycparser/_c_ast.yaml2
-rw-r--r--pycparser/c_parser.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/pycparser/_c_ast.yaml b/pycparser/_c_ast.yaml
index 6f0f8a3..d225102 100644
--- a/pycparser/_c_ast.yaml
+++ b/pycparser/_c_ast.yaml
@@ -37,7 +37,7 @@ Compound: [block_items**]
# Compound literal (anonymous aggregate) for C99.
# (type-name) {initializer_list}
-# type: the type decl
+# type: the typename
# init: ExprList for the initializer list
#
CompoundLiteral: [type*, init*]
diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py
index 0480447..e9d0403 100644
--- a/pycparser/c_parser.py
+++ b/pycparser/c_parser.py
@@ -1239,7 +1239,8 @@ class CParser(PLYParser):
p[0] = c_ast.UnaryOp('p' + p[2], p[1], p[1].coord)
def p_postfix_expression_6(self, p):
- """ postfix_expression : LPAREN type_name RPAREN LBRACE initializer_list LBRACE
+ """ postfix_expression : LPAREN type_name RPAREN LBRACE initializer_list RBRACE
+ | LPAREN type_name RPAREN LBRACE initializer_list COMMA RBRACE
"""
p[0] = c_ast.CompoundLiteral(p[2], p[5])