Skip to content

Block comment terminator edge case #203

@Will-Sommers

Description

@Will-Sommers

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions