Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: incorrect multiline comment highlight #10

Open
2 tasks done
AlexKurisu opened this issue Jul 27, 2024 · 0 comments
Open
2 tasks done

bug: incorrect multiline comment highlight #10

AlexKurisu opened this issue Jul 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@AlexKurisu
Copy link

AlexKurisu commented Jul 27, 2024

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.22.6 (b40f342067a89cd6331bf4c27407588320f3c263)

Describe the bug

The following code fragment is parsed incorrectly:

#!/bin/sh
# Actually, this is a tcl script \
exec tclsh "$0" ${1+"$@"}

The third line is parsed as an exec command when it should be parsed as comment because of \ in the previous line. Source: Tclsh Docs

Steps To Reproduce/Bad Parse Tree

(source_file ; [0, 0] - [3, 0]
  (comment) ; [0, 0] - [0, 9]
  (comment) ; [1, 0] - [1, 34]
  (command ; [2, 0] - [2, 25]
    name: (simple_word) ; [2, 0] - [2, 4]
    arguments: (word_list ; [2, 5] - [2, 25]
      (simple_word) ; [2, 5] - [2, 10]
      (quoted_word ; [2, 11] - [2, 15]
        (ERROR ; [2, 12] - [2, 14]
          (simple_word))) ; [2, 13] - [2, 14]
      (variable_substitution)))) ; [2, 16] - [2, 25]

Expected Behavior/Parse Tree

The exec tclsh "$0" ${1+"$@"} line is parsed as a comment.

Repro

No response

@AlexKurisu AlexKurisu added the bug Something isn't working label Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant