tlaplus-community / tree-sitter-tlaplus

A tree-sitter grammar for TLA⁺ and PlusCal
MIT License
57 stars 10 forks source link

Set proper lexical precedence for string contents #89

Closed susliko closed 11 months ago

susliko commented 11 months ago

Fixes #83

Problem

The grammar fails to parse strings with comment start lexemes inside them: "\*" and "(*"

Solution

Specify a higher lexical precedence for string contents than for comments

susliko commented 11 months ago

Actually I'm unsure if generated stuff like parser.c should be included in order for CI to pass

p.s.: okay, it should be, generated by tree-sitter 0.20.7

ahelwer commented 11 months ago

Thanks so much for the changes! Just have the two comments and looks good otherwise.

ahelwer commented 11 months ago

Also FYI thanks for using tree-sitter 0.20.7, there's an issue in 0.20.8 that blocks us from upgrading: https://github.com/tree-sitter/tree-sitter/issues/2755

ahelwer commented 11 months ago

Oh also! Please bump the patch version in the cargo & npm files so I can cut a new release that includes this fix.

susliko commented 11 months ago

@ahelwer Thanks for the review! Addressed the comments