Re:Tree-sitter: an incremental parsing system for programmin...
by codesnik on Monday February 22, 2021 @11:54AM
(#26226729)
bison should be compared to https://github.com/tree-sitter/tree-sitter-ruby/blob/master/... probably?
[ Parent
| on HN ]
Re:Tree-sitter: an incremental parsing system for programmin...
by chrisseaton on Monday February 22, 2021 @11:56AM
(#26226763)
No the JSON file there is generated (I believe?) from the JavaScript I linked, while the Bison file is hand-written.
With tree-sitter you're hand-writing a 1k file. With Bison you're hand-writing a 13k file.
Re:Tree-sitter: an incremental parsing system for programmin...
by tclem on Monday February 22, 2021 @11:32PM
(#26233848)
@chrisseaton you are correct, the JSON file is generated. The handwritten parts are:
- https://github.com/tree-sitter/tree-sitter-ruby/blob/32cd5a0... - https://github.com/tree-sitter/tree-sitter-ruby/blob/32cd5a0...
So about 2k loc.
The trickiest (and most verbose) parts of the external scanner have to do with heredocs and the various ways to declare literals (strings, symbols, regexes, etc).