Comments (3)
There are some ambiguities in the python grammar if you use $X : int anywhere in an expression, it's because K: V is also a key/value in a dictionary. Right now I've extended the python gramamr to allow X:T to appear only in arguments (the examples you had above). I can extend that to anywhere, but then you will have to use parenthesis around, as in foo(($X:int)). What do you prefer?
from semgrep.
@aryx I was unable to get this to work using the patterns in https://github.com/returntocorp/sgrep-rules/blob/develop/python/exceptions/exceptions.yaml#L7-L10; ie:
raise $X: int
fails to parse, but raise ($X: int)
did not trigger the appropriate line. Any ideas?
from semgrep.
I think the approach you took is good! Thanks for the clarification
from semgrep.
Related Issues (20)
- Issue with Github Members and Join Organization HOT 1
- Go: Semgrep mistakes import's PackageName with a local variable
- limit memory error on a docker file | Parsing bug HOT 7
- Bug with constant propagation HOT 1
- pattern(go): ellipsis does not match cases with one-or-more case clauses
- [Feature] Sort rules by metadata, e.g. confidence, impact, likelihood, technology HOT 1
- Support for CUDA language HOT 2
- Semgrep doesn't match else statements in Java HOT 5
- False Negative: Patterns are unable to match imports when alias is redeclared
- Error parsing CPP header files
- Feature: Dedicated semgrep-precommit repo HOT 5
- Missing taint findings, possibly due to `focus-metavariable` HOT 1
- Reusable patterns
- False Positives in Taint Mode when multiple related sanitizer rules defined with focus-metavariable HOT 4
- Ability to Specify Code Assumptions HOT 1
- Elixir mix lockfiles fail to parse certain git definitions HOT 2
- Failed to find semgrep-core in PATH or in the semgrep package. HOT 2
- `metavariable-pattern` with `pattern-regex` doesn't match `_`
- Cheatsheet broken for several GA languages
- "new" keyword in C# throws error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semgrep.