r-lib / tree-sitter-r

MIT License
114 stars 35 forks source link

String literals with some Unicode escapes are parsed incorrectly #61

Closed klmr closed 8 months ago

klmr commented 1 year ago

Actual behaviour

When using the syntax highlighting hints from R treesitter, some (but not all!) Unicode escape sequences inside string literals are parsed incorrectly and cause all subsequent lexemes to be classified incorrectly.

I’m unsure which combination exactly causes this behaviour; in the example below, removing either \u02 or \uf101 rectifies the behaviour. The combination of both is required to trigger the bug.

Screenshot 2023-10-27 at 11 41 09

(Screenshot taken in NeoVim v0.9.1. Without r-tree-sitter, the literal is highlighted correctly.)

Expected behaviour

Screenshot 2023-10-27 at 11 42 05

kevinushey commented 1 year ago

This may also be resolved in the next branch.

DavisVaughan commented 8 months ago

This looks to be resolved by the next branch.