antlr4
antlr4 copied to clipboard
[Cpp] XPath.findAll does not produce the same result than python3 runtime
Hello
Using 4.13.1 Cpp runtime with xpath feature I found a mismatch with result produce by python3 runtime.
Attached testcase reproduce the python3 testcase testing XPath feature : https://github.com/antlr/antlr4/blob/b3bb7439546d2035203790d5513c505720cf0bdd/runtime/Python3/tests/xpathtest.py#L14 case_issue4.tar.gz
Execution of provide testcase agains Cpp runtime 4.13.1 produce:
[func, func, ]
[func, func, ]
[func, func, ]
[prog, ]
[prog, ]
[prog, ]
[prog, ]
[f, x, y, x, y, g, x, x, ]
[y, x, ]
[x, y, x, ]
[return, ]
[return, ]
[3, 4, y, 1, 2, x, ]
[stat, stat, stat, stat, ]
[def, def, ]
[;, ;, ;, ;, ]
[3, 4, 1, 2, ]
[expr, expr, expr, expr, expr, expr, ]
[]
[]
[y, x, x, x, ]
Which is conform to expected except for last pattern. The last pattern seems to have been added to covers antlr/antlr4#370 according comment in python testcase. The expected result is:
[y, x, ]