Skip to content
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

PS: Copy existing AST classes from internal repo #83

Merged
merged 6 commits into from
Aug 26, 2024

Conversation

MathiasVP
Copy link
Collaborator

This PR copies over all the existing AST classes from the internal repo. This is all done in the first commit. The remaining commits incrementally modernizes the AST classes and tests:

  • efba031 changes the AST inheritance hierarchy to be more idiomatic by using extends instead of instanceof. Using instanceof will give a very bad UX when working with AST classes since the predicates defined in the base class won't be accessible when you have an instance of a subclass.
  • 023c88a renames the long AST names to more standard CodeQL names. On the GitHub side experience has shown us that it's really really annoying to have to write:
    predicate foo(Expression e, Statement s) { ... }
    and we instead prefer being able to write:
    predicate foo(Expr e, Stmt s) { ... }
  • 71349af adds more AST wrapper classes around the existing DB extensionals. I'm sure I'm still missing some, but these were some of the ones I spotted on a first pass 😂
  • c30feab copies the existing AST-like tests from the internal repo.

@MathiasVP MathiasVP merged commit 22a30ab into main Aug 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants