There are several grammars that use a field(...)-function to produce labelled syntax tree nodes, including Java and JS. The Grammar DSL docs do not mention it, however.
Am I missing something?
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.
Yeah, I have a lot of documentation to write, after the last several months of changes. I guess I was waiting to write the docs until I've been using the feature internally for a while to get all of the problems worked out.
But it's pretty much done. So in the meantime, here's some info:
field function which you pointed out.@maxbrunsfeld Thanks for the quick response and the links!
As far as I can tell wasm only has field name? https://github.com/tree-sitter/tree-sitter/blame/master/lib/binding_web/tree-sitter-web.d.ts#L100
Will we get the id (no idea what's that for) and the child by field name function too?
Will we get the id (no idea what's that for) and the child by field name function too?
Yeah, I added the remaining bindings in https://github.com/tree-sitter/tree-sitter/commit/82fab90c0b91cc57a949b9d96768d7f3b7a621e4.
Docs are up: here: http://tree-sitter.github.io/tree-sitter/using-parsers#node-field-names and here: http://tree-sitter.github.io/tree-sitter/creating-parsers#using-fields.
Most helpful comment
Yeah, I have a lot of documentation to write, after the last several months of changes. I guess I was waiting to write the docs until I've been using the feature internally for a while to get all of the problems worked out.
But it's pretty much done. So in the meantime, here's some info:
fieldfunction which you pointed out.