parser: tag data members
It's cleaner to differentiate between the different types of member AST by
using the first element as a tag.
diff --git a/utest/test_parser.py b/utest/test_parser.py
index da262a4..a4a0e63 100755
--- a/utest/test_parser.py
+++ b/utest/test_parser.py
@@ -46,7 +46,7 @@
"""
ast = parser.parse(src)
self.assertEquals(ast,
- [['struct', 'foo', [['uint32_t', 'bar']]]])
+ [['struct', 'foo', [['data', 'uint32_t', 'bar']]]])
def test_multiple_fields(self):
src = """\
@@ -59,9 +59,9 @@
ast = parser.parse(src)
self.assertEquals(ast,
[['struct', 'foo',
- [['uint32_t', 'bar'],
- ['uint8_t', 'baz'],
- ['uint64_t', 'abc']]]])
+ [['data', 'uint32_t', 'bar'],
+ ['data', 'uint8_t', 'baz'],
+ ['data', 'uint64_t', 'abc']]]])
def test_array_type(self):
src = """\
@@ -71,7 +71,7 @@
"""
ast = parser.parse(src)
self.assertEquals(ast,
- [['struct', 'foo', [['uint32_t[4]', 'bar']]]])
+ [['struct', 'foo', [['data', 'uint32_t[4]', 'bar']]]])
def test_list_type(self):
src = """\
@@ -81,7 +81,7 @@
"""
ast = parser.parse(src)
self.assertEquals(ast,
- [['struct', 'foo', [['list(of_action_t)', 'bar']]]])
+ [['struct', 'foo', [['data', 'list(of_action_t)', 'bar']]]])
def test_pad_type(self):
src = """\
@@ -163,7 +163,7 @@
"""
ast = parser.parse(src)
self.assertEquals(ast,
- [['struct', 'foo', [['uint32_t', 'a']]]])
+ [['struct', 'foo', [['data', 'uint32_t', 'a']]]])
def test_mixed(self):
src = """\