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

Incomplete method definition parses as if it ends on the first line #234

Open
dgutov opened this issue Jan 25, 2023 · 0 comments
Open

Incomplete method definition parses as if it ends on the first line #234

dgutov opened this issue Jan 25, 2023 · 0 comments

Comments

@dgutov
Copy link

dgutov commented Jan 25, 2023

The file contents like:

def foo
|

(| denotes the cursor)

parse without error to structure

(program
 (method def body: (identifier) end))

which on its own is a bit surprising (a virtual "end"?), but the really unfortunate part is that the end of the parsed node is put on the first line, thus the second line is essentially said to be outside of the method (as any straightforward analyzer of the parse tree would conclude). Which makes things more difficult for indentation code.

Could we position the "virtual end" at the end of the file in this example?

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