lib/parser/ruby-next/lexer.rl in ruby-next-parser-2.8.0.6 vs lib/parser/ruby-next/lexer.rl in ruby-next-parser-2.8.0.7

- old
+ new

@@ -282,10 +282,17 @@ @command_start = false %% write exec; # % + # Ragel creates a local variable called `testEof` but it doesn't use + # it in any assignment. This dead code is here to swallow the warning. + # It has no runtime cost because Ruby doesn't produce any instructions from it. + if false + testEof + end + @p = p if @token_queue.any? @token_queue.shift elsif @cs == klass.lex_error @@ -2022,10 +2029,17 @@ fnext expr_beg; fbreak; }; '...' => { - if @version >= 27 + if @version >= 28 + if @lambda_stack.any? && @lambda_stack.last + 1 == @paren_nest + # To reject `->(...)` like `->...` + emit(:tDOT3) + else + emit(:tBDOT3) + end + elsif @version >= 27 emit(:tBDOT3) else emit(:tDOT3) end