* Added EmptyStatement node to represent an empty statement (sole ';'), with tests and c-to-c support
* Added sys.path update in _build_tables.py to enable it to run correctly from the pycparser folder
diff --git a/examples/c-to-c.py b/examples/c-to-c.py
index 93de0aa..e0f6af0 100644
--- a/examples/c-to-c.py
+++ b/examples/c-to-c.py
@@ -173,6 +173,9 @@
s += self._make_indent() + '}\n'
return s
+ def visit_EmptyStatement(self, n):
+ return ';'
+
def visit_ParamList(self, n):
return ', '.join(self.visit(param) for param in n.params)
@@ -402,11 +405,8 @@
int main(void)
{
- int a;
- int b = a++;
- int c = ++a;
- int d = a--;
- int e = --a;
+ ;
+ return 0;
}
'''
parser = c_parser.CParser()
diff --git a/examples/tests/test_c-to-c.py b/examples/tests/test_c-to-c.py
index cba62f5..8015891 100644
--- a/examples/tests/test_c-to-c.py
+++ b/examples/tests/test_c-to-c.py
@@ -81,6 +81,7 @@
int main() {
int a;
a = 5;
+ ;
return a;
}''')