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

(heredoc_end) matches the EOF mark #182

Open
stsewd opened this issue Jul 9, 2021 · 0 comments
Open

(heredoc_end) matches the EOF mark #182

stsewd opened this issue Jul 9, 2021 · 0 comments

Comments

@stsewd
Copy link

stsewd commented Jul 9, 2021

def run
  a = <<~E
end

This file generates the following tree

program [0, 0] - [3, 0]
  method [0, 0] - [3, 0]
    name: identifier [0, 4] - [0, 7]
    assignment [1, 2] - [1, 10]
      left: identifier [1, 2] - [1, 3]
      right: heredoc_beginning [1, 6] - [1, 10]
    heredoc_body [1, 10] - [3, 0]
      heredoc_content [1, 10] - [3, 0]
      heredoc_end [3, 0] - [3, 0]
    MISSING end [3, 0] - [3, 0]

I know this isn't a completely valid file, but it would be nice to not generate a token for the EOF mark ((3, 0) position).
This is causing several bugs on neovim nvim-treesitter/nvim-treesitter#1531, we are making our code to check for cases like this so feel free to close this if you think is fine generating tokens like this for an incomplete file.

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