Project

General

Profile

Actions

Bug #17345

closed

ripper: nothing raised when assigning to keyword variables

Added by no6v (Nobuhiro IMAI) almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0dev (2020-11-25T04:36:39Z master 00f046ef57) [x86_64-linux]
[ruby-core:101089]

Description

require "ripper"

Ripper.tokenize("retry=1", raise_errors: true)
# => SyntaxError (syntax error, unexpected '=', expecting end-of-input)

Ripper.tokenize("nil=1", raise_errors: true) # => ["nil", "=", "1"]
lexer = Ripper::Lexer.new("nil=1")
lexer.tokenize # => ["nil", "=", "1"]
lexer.error? # => true
lexer.errors # => []

Lexer recognizes there was an error, but nothing is set to errors.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #20649: Ripper fails to tokenize `def f; (x)::A =`ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0