Skip to content

Conversation

@felix-andreas
Copy link

Currently, when parsing files with CRLF (\r\n) line endings, comment nodes incorrectly include the trailing \r character.

This PR updates the grammar to exclude \r from the comment node content, aligning the behavior with other grammars such as tree-sitter-javascript.

Example Input

# comment

Output of tree-sitter parse

Before this PR

(program [0, 0] - [1, 0]
  (comment [0, 0] - [0, 10]))

Using this PR

(program [0, 0] - [1, 0]
  (comment [0, 0] - [0, 9]))

  • Also fixes formatting of grammar.js in line 74 and 208/209.

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

Successfully merging this pull request may close these issues.

1 participant