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

Block comment terminator edge case #203

Open
Will-Sommers opened this issue Feb 28, 2022 · 0 comments
Open

Block comment terminator edge case #203

Will-Sommers opened this issue Feb 28, 2022 · 0 comments

Comments

@Will-Sommers
Copy link

Hi y'all,

While working on adding Ruby to cursorless I discovered this edge case bug.

The following code is valid Ruby with block comments requiring the =begin/=end block comment beginning and ending identifiers to be on line start. However, the first =end is erroneously recognized as the block comment terminator.

=begin
hello
world =end
=end

The following program results in the following output:

[program](https://tree-sitter.github.io/tree-sitter/playground#) [0, 0] - [4, 0]
  [comment](https://tree-sitter.github.io/tree-sitter/playground#) [0, 0] - [2, 10]
  [assignment](https://tree-sitter.github.io/tree-sitter/playground#) [2, 10] - [3, 4]
    left: [MISSING identifier](https://tree-sitter.github.io/tree-sitter/playground#) [2, 10] - [2, 10]
    right: [identifier](https://tree-sitter.github.io/tree-sitter/playground#) [3, 1] - [3, 4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant