pfff is mainly an OCaml API to write static analysis, dynamic analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code.
My end goal is to allow Semgrep to infer the type from this:
const x = new Y();
In other languages, this works fine: there's some code that looks for a
few common cases on the RHS of a variable definition and pulls out the
type. However, because of some parsing oddities, in JS this ends up
being parsed as a Call with some weird arguments.
Changing the pfff parser to separate New is the first step towards
addressing this.
Test plan: Automated tests
Security
[x] Change has no security implications (otherwise, ping the security team)
My end goal is to allow Semgrep to infer the type from this:
In other languages, this works fine: there's some code that looks for a few common cases on the RHS of a variable definition and pulls out the type. However, because of some parsing oddities, in JS this ends up being parsed as a
Call
with some weird arguments.Changing the pfff parser to separate
New
is the first step towards addressing this.Test plan: Automated tests
Security