You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Parser engine throws up when parsing patterns with explicit private attributes, e.g.
rules:
- id: parser-doesnt-like-private-attributespattern: | #$ATTR(...) { ... }message: Semgrep found a match $ATTRlanguages: [ts,js]severity: WARNING
The engine parsing targets can handle private attributes just fine - this shows up if you have e.g. a rule that finds function definitions, then you use the metavariable values to construct a new Semgrep rule.
Describe the bug
Parser engine throws up when parsing patterns with explicit private attributes, e.g.
The engine parsing targets can handle private attributes just fine - this shows up if you have e.g. a rule that finds function definitions, then you use the metavariable values to construct a new Semgrep rule.
To Reproduce
https://semgrep.dev/playground/s/kx2Zz
as long as you don't use a private attribute explicitly in a pattern, the engine is happy:
https://semgrep.dev/playground/s/NbYA1
further complicating the issue, calling a private attribute with
this
seems to parse just fine:https://semgrep.dev/playground/s/eqlwE
Expected behavior
this should parse.
Screenshots
If applicable, add screenshots to help explain your problem.
What is the priority of the bug to you?
Environment
semgrep.dev, semgrep 1.72.0
Use case
recursively templated scans using results from Semgrep itself
The text was updated successfully, but these errors were encountered: