diff options
author | Eli Bendersky <eliben@gmail.com> | 2012-12-25 14:52:48 -0800 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2012-12-25 14:52:48 -0800 |
commit | 293ea91f99a57a3f1fde187d99554ae59c492285 (patch) | |
tree | ecb5559d002166aab8378c54a1adc4dd991852aa /pycparser/c_ast.py | |
parent | 4476d099d78c0288c8aaf907f236ab94e418bd44 (diff) | |
download | pycparser-293ea91f99a57a3f1fde187d99554ae59c492285.tar.gz |
Issue #83: Distinguish initializer lists from expression lists
Diffstat (limited to 'pycparser/c_ast.py')
-rw-r--r-- | pycparser/c_ast.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pycparser/c_ast.py b/pycparser/c_ast.py index a1c92fb..2b9b00a 100644 --- a/pycparser/c_ast.py +++ b/pycparser/c_ast.py @@ -525,6 +525,19 @@ class If(Node): attr_names = () +class InitList(Node): + def __init__(self, exprs, coord=None): + self.exprs = exprs + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.exprs or []): + nodelist.append(("exprs[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + class Label(Node): def __init__(self, name, stmt, coord=None): self.name = name |