ruby / prism

Prism Ruby parser
https://ruby.github.io/prism/
MIT License
825 stars 139 forks source link

Lex difference for self assignment #2838

Closed Earlopain closed 4 months ago

Earlopain commented 4 months ago

I'm throwing rake lex through some stuff and found a few differences:

Prism.lex_ripper("test ||= test")
=> [[[1, 0], :on_ident, "test", CMDARG], [[1, 5], :on_op, "||=", BEG], [[1, 9], :on_ident, "test", END|LABEL]]

Prism.lex_compat("test ||= test").value
=> [[[1, 0], :on_ident, "test", CMDARG], [[1, 5], :on_op, "||=", BEG], [[1, 9], :on_ident, "test", ARG]]

Similar things for test &&= test.

Are differences like that worth reporting?

kddnewton commented 4 months ago

Hey @Earlopain — I've just opened a PR for this. Yes, please report these!

Earlopain commented 4 months ago

Sure, I'll do that. I don't have that many actually, most went away after I switched to nightly ruby which I didn't do beforehand