Skip to content

Commit

Permalink
vertical bar is not a valid character in an lvar name (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Apr 20, 2021
1 parent 49ed4dd commit 9453219
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parser/builders/default.rb
Expand Up @@ -1724,7 +1724,7 @@ def arg_name_collides?(this_name, that_name)
end

def check_lvar_name(name, loc)
if name =~ /\A[[[:lower:]]|_][[[:alnum:]]_]*\z/
if name =~ /\A[[[:lower:]]_][[[:alnum:]]_]*\z/
# OK
else
diagnostic :error, :lvar_name, { name: name }, loc
Expand Down

0 comments on commit 9453219

Please sign in to comment.