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

Syntax error in interpolated symbol #3108

Closed
jbreeden opened this issue Feb 15, 2016 · 0 comments
Closed

Syntax error in interpolated symbol #3108

jbreeden opened this issue Feb 15, 2016 · 0 comments

Comments

@jbreeden
Copy link
Contributor

I'm trying to get Ruby's specs against MRuby + mruby-apr, but I've run into a funny parser error. It seems you can interpolate one value - but not two - in a symbol definition:

# This one's OK
> :"__mspec_#{'test'}_"
 => :__mspec_test_

# This one shouldn't be raising
> :"__mspec_#{'test'}_#{'test2'}__"
line 3: syntax error, unexpected tSTRING_PART, expecting tSTRING

Just to note, the obvious workaround works just fine:

> "__mspec_#{'test'}_#{'test2'}__".to_sym
 => :__mspec_test_test2__
@matz matz closed this as completed in da96c33 Feb 16, 2016
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