Skip to content

Commit

Permalink
Use reflection to implement TreeDiffer.DiffVisitor.
Browse files Browse the repository at this point in the history
This is much more robust than overriding individual visitor methods.
It means we won't forget to check some property of an AST node,
and it also means we automatically handle new kinds of nodes.

Using reflection does make this potentially more expensive than having individual visitor methods. The overhead is likely to be small compared to the cost of compiling source code to produce the ASTs in the first place.

Fixes #303.

PiperOrigin-RevId: 494778353
  • Loading branch information
eamonnmcmanus authored and Compile-Testing Team committed Dec 12, 2022
1 parent cd5e8a9 commit 9a592f7
Show file tree
Hide file tree
Showing 2 changed files with 233 additions and 770 deletions.
Loading

0 comments on commit 9a592f7

Please sign in to comment.