tree-sitter-javascript
tree-sitter-javascript copied to clipboard
Add optional_chain named field
Optional chaining property/array access and optional function
calls now produce an optional_chain
named field.
When traversing a parsed program, once can retrieve the operator by looking at the source code, indeed, but it seems hacky (in a bad sense).
Checklist:
- [x] All tests pass in CI.
- [x] The script/parse-examples passes without issues.
- [x] There are sufficient tests for the new fix/feature.
- [x] Grammar rules have not been renamed unless absolutely necessary.
- [x] The conflicts section hasn't grown too much.
- [x] The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).
Hello, is this the right place for these kinds of PRs?
Hi @stackmystack. Yes, this is the right place for such PRs. Sorry for the delays! For this particular issue, I'm not sure how field()
is used in general as it's not a feature we use in semgrep. That's why I'd like to refer to @maxbrunsfeld.
Also you get CI failures: "Error in query file "highlights.scm"
Hello @aryx, I fixed the test-suite, it was working in the initial submission and got broken with a rebase which I didn't check. All green now.
The windows failure in the CI seems to be a node issue.