-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XTypeRecovery: Clean Up With Visitor-Pattern & Support New Imports (#…
…2272) - Re-implemented `XTypeRecovery` using visitor pattern. This reduces the `PythonTypeRecovery` file by 50% and increases the language agnostic `XTypeRecovery` file by 100%. - `XTypeRecovery` can now support the new `Import` node while leaving room to override the `Call` version as still used in Python. - This change improves the soundness of the type recovery and, as such, resulted in some modifications required for some test cases. - This change also promotes re-use of code and easy diagnostics using a logger with debugging locators. Debug level used is `WARN`. Breaking changes: - Built-in types are now prefixed with `__builtin` which is what the front-end appears to use. - `__builtin.None` is now supported, which means potentially more types may be suggested if variables were initialized with `var = None`.
- Loading branch information
1 parent
f7dbe52
commit bcf2799
Showing
7 changed files
with
600 additions
and
441 deletions.
There are no files selected for viewing
404 changes: 84 additions & 320 deletions
404
joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonTypeRecovery.scala
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.