- when printing a shared node for the second time, don't print its children (This keeps output proportional to the size of the structure)
- when printing a shared node for the second time, print its type only, not rule (for consistency with above: don't dump details of nodes twice)
- don't abbreviate shared nodes, to ensure we can prune the tree there
Details
- Reviewers
hokein - Commits
- rGbc5e7ced1c7e: [pseudo] Fix bugs/inconsistencies in forest dump.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/pseudo/unittests/ForestTest.cpp | ||
---|---|---|
138 | I was confused by the forest here -- the fact that it doesn't reflect the grammar (I was trying to figure out why there is an ambiguous node for A by reading the grammar above) I think there should be a comment clarifying the gap between the grammar and forest -- this is an artificial forest which is only for testing the dump purpose -- we only need the symbol bits from the grammar (I actual think GLRTest::buildGrammar is a better fit for the tests in this file). |
clang-tools-extra/pseudo/unittests/ForestTest.cpp | ||
---|---|---|
138 | This forest does matches the grammar, unless I'm missing something. Added a comment. |
I was confused by the forest here -- the fact that it doesn't reflect the grammar (I was trying to figure out why there is an ambiguous node for A by reading the grammar above)
I think there should be a comment clarifying the gap between the grammar and forest -- this is an artificial forest which is only for testing the dump purpose -- we only need the symbol bits from the grammar (I actual think GLRTest::buildGrammar is a better fit for the tests in this file).