tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
152 stars 36 forks source link

Ranges of syntax-nodes starting are off by one line #3

Closed clojj closed 6 years ago

clojj commented 6 years ago

In the following, the package 'tree-sitter-syntax-visualizer' highlights the selected span, which is computed by the language's tree-sitter grammar. The span (hopefully the original one from the parser) is at the very bottom of each screenshot.

With tree-sitter-python, I get these (correct) spans in Python code: python-1 python-2

With tree-sitter-haskell (current master, locally installed/referenced in the language-haskell package), I get these spans:

this looks good.. haskell-1

...but these look, if not completely wrong, but at least the starting line seems wrong haskell-2 haskell-3 haskell-4

Comparing the Python scanner.cc to the one from Haskell, I have a wild guess, that maybe for the special token-type LAYOUT_SEMICOLON, there is a missing invocation of

advance(lexer, ...);

?

clojj commented 6 years ago

closed in favor of a new issue with more concise description of the underlying problem