parser icon indicating copy to clipboard operation
parser copied to clipboard

ruby/ruby@62ec5eb - error messages improvements

Open iliabylich opened this issue 6 years ago • 5 comments

https://github.com/ruby/ruby/commit/62ec5eb01874472e2df9d871ef329d5a76b9c853

@whitequark Could you please confirm that it should be backported?

iliabylich avatar Jan 21 '19 12:01 iliabylich

This is a general quality improvement that should ideally be done, but our error messages on invalid inputs are not part of the API contract nor they, in general, match MRI.

whitequark avatar Jan 21 '19 12:01 whitequark

Let's close it then. parser is a tool for parsing, I think it's even better to return a raw token name in the error message

iliabylich avatar Jan 21 '19 13:01 iliabylich

I think it's even better to return a raw token name in the error message

I definitely disagree. Parser is a general Ruby frontend used as plumbing in many different tools. It should not spew internal token names in error messages and any instance where it does that is an oversight.

whitequark avatar Jan 21 '19 13:01 whitequark

So, what's your verdict? Should it be implemented in parser?

iliabylich avatar Jan 21 '19 13:01 iliabylich

Yes. I was only saying that it isn't a blocker, and we do not need to match MRI's behavior or release train when introducing this.

whitequark avatar Jan 21 '19 13:01 whitequark