-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should always test the parse trees generated #2991
Comments
PHP grammar, Java target fails when printing out trees. #3017. This is exactly why we need to compute trees always. |
We should at least compare the trees from each target for every test, and ensure that all targets produce the same tree. We could do that without needing any specific effort in any of the grammars. Ideally, every test would have an expected parse tree, and we would include that in the comparison as well, ensuring that all targets produce the expected tree. Unfortunately, there are very few expected tree files in the We could arbitrarily assert that the current parse tree of every test that succeeds is by definition correct, and check that tree into the repo as the expected result. We might even be correct for well over 90% of the tests. |
I think the plan is to generate a tree for every parse and compare with the previous. This will be across targets which will likely result in new bugs being discovered. To generate the .tree files, use either the trgen-generated code to remaster the .tree files or create by hand. We'll need to consider what to do with people who are completely phobic about installing dotnet and trgen (works everywhere), and running the driver code for any one of the targets they want in order to remaster the .tree and .errors files. |
I'm starting to address this issue. The easy solution is to just check in all the .tree files. But, people will likely have a hard time remastering the files, and some will likely forget to do it. So, the idea to generate the files first with a "gold standard"--aka Java--then compare the trees across targets is probably the way to go. We'd might consider not checking in the .tree files at all, except that the tree might be valuable when comparing different versions of Antlr, which the desc.xml could specify. |
Perhaps this is better in the Discussions section, but I just don't understand why we aren't performing tree diffs on every parse, across all targets. It's not going to slow down the tests that much and it really will catch errors in Antlr, e.g., css3, mdn-at-counter-style.css, explained here.
The text was updated successfully, but these errors were encountered: