Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError when parsing hash with _-prefixed symbol keys in a block #5785

Closed
lopopolo opened this issue Aug 22, 2022 · 0 comments
Closed

SyntaxError when parsing hash with _-prefixed symbol keys in a block #5785

lopopolo opened this issue Aug 22, 2022 · 0 comments

Comments

@lopopolo
Copy link
Contributor

This code raises a SyntaxError:

it "adds the entries from other, overwriting duplicate keys. Returns self" do
  h = { _1: 'a', _2: '3' }
end

This code does not:

h = { _1: 'a', _2: '3' }

And neither does this code:

it "adds the entries from other, overwriting duplicate keys. Returns self" do
end

Artichoke REPL (mruby 3.1.0)

$ cat crash.rb
it "adds the entries from other, overwriting duplicate keys. Returns self" do
  h = { _1: 'a', _2: '3' }
end
$ cargo run --bin airb -q
artichoke 0.1.0-pre.0 (2022-08-14 revision 6111) [x86_64-apple-darwin]
[rustc 1.63.0 (4b91a6ea7 2022-08-08) on x86_64-apple-darwin]
>>> require 'crash'
Traceback (most recent call last):
        2: from (airb):1
        1: from (airb):1:in require
SyntaxError (syntax error)
>>> h = { _1: 'a', _2: '3' }
=> {:_1=>"a", :_2=>"3"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant