diff options
Diffstat (limited to 'c_parser/test')
-rw-r--r-- | c_parser/test/output.xml | 18 | ||||
-rw-r--r-- | c_parser/test/test_parser.c | 10 |
2 files changed, 27 insertions, 1 deletions
diff --git a/c_parser/test/output.xml b/c_parser/test/output.xml index 8ea3e1c..d4594a2 100644 --- a/c_parser/test/output.xml +++ b/c_parser/test/output.xml @@ -10,10 +10,28 @@ <Variable id="d" /> <Variable id="hello" /> <Variable id="asd" /> +<Variable id="a" /> <Function id="f"> <Parameter id="i" /> <Parameter id="b" /> <Parameter id="c" /> <Parameter id="d" /> +<Scope> +<Variable id="a" /> +</Scope> +</Function> +<Variable id="a" /> +<Variable id="b" /> +<Variable id="c" /> +<Variable id="c" /> +<Variable id="d" /> +<Function id="func"> +<Parameter id="asd" /> +<Parameter id="b" /> +<Scope> +<Variable id="a" /> +<Variable id="b" /> +<Variable id="c" /> +</Scope> </Function> </Program> diff --git a/c_parser/test/test_parser.c b/c_parser/test/test_parser.c index d894c23..55a15b7 100644 --- a/c_parser/test/test_parser.c +++ b/c_parser/test/test_parser.c @@ -5,4 +5,12 @@ int yann, is, the, best; int d = 0; int hello = 122, asd = 123; -int f(int i, int b, int c, int d); +int f(int i, int b, int c, int d) { + int a; +} + +int func(int asd, int b) { + int a, b, c; + int c = 0; + int d; +} |