Open mingodad opened 3 years ago
Also why not convert to EBNF from the src/grammar.json
, it seems a bit simpler than from the grammar.js
?
Thanks for the feedback! I'm a bit wary of downloading a zip file, but it seems like you've made some progress on fixing the errors? I was motivated to convert the tree-sitter-scala grammar so I was mostly concerned with getting that translated correctly. I'm not surprised that there are edge cases that I missed.
With regards to src/grammar.json vs grammar.js. I thought about the grammar.json but it seemed like tree-sitter generate
always uses grammar.js and I was trying to get something that I could actually use to write a tree-sitter grammar as quickly as possible. I agree that translating to grammar.json would be a better solution so long as it could be seamlessly integrated with the process for building parsers.
When trying to convert all the grammars listed in https://github.com/mingodad/plgh with this patch applied I'm getting several errors see attached output. output-cvt-all.zip
Thank you for your great work !
Why not instead of converting the EBNF to
grammar.js
convert it directly tosrc/grammar.json
?