irb icon indicating copy to clipboard operation
irb copied to clipboard

Fix termination check of `x in *`

Open tompng opened this issue 10 months ago • 0 comments

Fix #1080

It is hard to distinguish multiplication from pattern match from tokens. Token * are both [[3, 0], :on_op, "*", BEG].

# x in *
<<A; x in
A
*
# string * value(missing)
<<A\
A
*

So in this pull request, treat this :on_op, '*', BEG as should_continue == true only when the whole code is syntax valid.

Also fixes x in ** x => * x => ** and def f(*,**)=f *, **

tompng avatar Jan 29 '25 08:01 tompng