Closed Tralomine closed 5 years ago
Reproduced with the C++ tree-sitter grammar but not the C one.
Tree sitter parses this as:
template_function template_argument_list
Because there is a starting and ending angle bracket in the statement?
Which is scoped as punctuation.definition.template.bracket.angle
because it isn't an operator when it's a template definition here:
https://github.com/atom/language-c/blob/a355a4d4a019d5684c40072b81f24c89e58dc56f/grammars/tree-sitter-cpp.cson#L198-L201
The rule for >
and <
is only added to relational_expression
to not conflict with templates:
https://github.com/atom/language-c/blob/a355a4d4a019d5684c40072b81f24c89e58dc56f/grammars/tree-sitter-cpp.cson#L224-L225
Thanks for the report! The fix will ship in Atom 1.38 (and 1.38-beta0).
Description
a < comparison followed by a >= comparison is tokenized wrongly
Steps to Reproduce
Expected behavior: the comparisons operators should be all the same color and in only one token
Actual behavior: they are split and considered as
note: trying with multiples comparisons in this style always end with only the last one experiencing this behaviour
note: the first variable in the comparison is considered as
(and therefore is blue)