Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custumize sexp (s-expression) output #98

Closed
dnns92 opened this issue Jan 28, 2021 · 0 comments
Closed

custumize sexp (s-expression) output #98

dnns92 opened this issue Jan 28, 2021 · 0 comments

Comments

@dnns92
Copy link

dnns92 commented Jan 28, 2021

Hey forum,

how do I set the style of a s expression? E.g. I want to catch all the if statements, I use a query like this:(if_statement(condition_clause(_)) @condition_clause.inner) to get them. So lets say I matched on this line of code in c++

if (x==2) {doSomething}
--> (condition clause value (binary_expression left: (identifier) right: (number_literal)))
However, i'd rather like this style:

if (x==2) {doSomething}
--> (condition clause value (binary_expression "=="( (identifier) (number_literal)))
where we drop left/right and get more detail on the actual binary_expression, i.e. what kind of expression, etc. Can this be done without parsing the result again?

@amaanq amaanq closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants