How to match chained expressions #801
-
I'm trying to add type annotations to SQLAlchemy queries. In this simplified example, although in the tree-sitter output I can see a |
Beta Was this translation helpful? Give feedback.
Answered by
HerringtonDarkholme
Dec 18, 2023
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
emosenkis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are multiple ways to achieve it.
Using has operator and conditional stopBy
https://ast-grep.github.io/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6InB5dGhvbiIsInF1ZXJ5IjoiQCRQQVJFTlQuZmllbGQoJEZJRUxEKVxuZGVmICRGVU5DKCQkJEFSR1MpIC0+ICRSRVRVUk46XG4gICQkJEJPRFkiLCJyZXdyaXRlIjoiIiwiY29uZmlnIjoicnVsZTpcbiAga2luZDogY2FsbFxuICBwYXR0ZXJuOiAkQ0hBSU5cbiAgaGFzOlxuICAgIHBhdHRlcm46IGRiLnNlc3Npb24ucXVlcnkoJEIpXG4gICAgc3RvcEJ5OlxuICAgICAgbm90OlxuICAgICAgICBhbnk6XG4gICAgICAgICAgLSBraW5kOiBjYWxsIFxuICAgICAgICAgIC0ga2luZDogYXR0cmlidXRlIiwic291cmNlIjoiaW1wb3J0IGRiXG5pbXBvcnQgbW9kZWxzXG5cbmZvbyA9IGRiLnNlc3Npb24ucXVlcnkobW9kZWxzLkZvbykuZmlsdGVyKFRydWUpLmFsbCgpIn0=
use inside operator and not insi…