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

Multiple Errors #195

Open
marcandre opened this issue Nov 7, 2020 · 3 comments
Open

Multiple Errors #195

marcandre opened this issue Nov 7, 2020 · 3 comments

Comments

@marcandre
Copy link

I find it difficult to know what triggered an error. I understand unparser does not want to depend on locations, but it would be helpful to have a source line...

The following 2 files generate errors:
https://github.com/deep-cover/deep-cover/blob/master/core_gem/spec/char_cover/exception_else.rb
https://github.com/deep-cover/deep-cover/blob/master/core_gem/spec/char_cover/literals.rb

Even if highly unusual, they are valid Ruby code.

@mbj
Copy link
Owner

mbj commented Nov 9, 2020

@marcandre This issue contains 2 classes: The splat node not dispatching mlhs correctly, that one is fixed.

The other is the dstr issue I discuss in #196

@mbj
Copy link
Owner

mbj commented Dec 1, 2020

@marcandre There is another class, and its interesting: spec/char_cover/exception_else.rb

contains code like this:

begin
else
end

that when parsed with parser:

bundle exec ruby-parse -e 'begin; else; end'                     <<<
(fragment:0):1:8: error: else without rescue is useless
(fragment:0):1: begin; else; end
(fragment:0):1: 

fails.

I do not think unparser will and should not ever work on code like this, until parser would have a knob to emit an AST for this case.

I'll put that file on the ignore list for the moment.

@marcandre
Copy link
Author

I do not think unparser will and should not ever work on code like this, until parser would have a knob to emit an AST for this case.

Absolutely 👍

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

2 participants