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

encoding of utf8 symbols (eg. :λ) #3719

Closed
elia opened this issue Mar 9, 2016 · 6 comments
Closed

encoding of utf8 symbols (eg. :λ) #3719

elia opened this issue Mar 9, 2016 · 6 comments

Comments

@elia
Copy link
Contributor

elia commented Mar 9, 2016

The failing Opal build: https://travis-ci.org/opal/opal/jobs/114673459#L372
The failing specs have been added recently, also maybe it's just a matter of setting the correct locale env vars as in #2204

Environment

$ java -Xmx32m -version
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)
$ javac -J-Xmx32m -version
javac 1.7.0_76
$ ruby --version
jruby: warning: unknown property jruby.cext.enabled
jruby 9.1.0.0-SNAPSHOT (2.3.0) 2016-03-09 5b08612 Java HotSpot(TM) 64-Bit Server VM 24.76-b04 on 1.7.0_76-b13 +jit [linux-amd64]
$ rvm --version
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
$ bundle --version
jruby: warning: unknown property jruby.cext.enabled
Bundler version 1.6.9
$ gem --version
jruby: warning: unknown property jruby.cext.enabled
2.4.8

Expected/Actual Behavior

  1) Opal::Parser parses unicode local variables
     Failure/Error: parsed("λ = 1").should == [:lasgn, , [:int, 1]]
       expected: [:lasgn, :?, [:int, 1]]
            got: (:lasgn, , (:int, 1)) (using ==)
     # ./spec/lib/parser/variables_spec.rb:106:in `block in (root)'
  2) Opal::Parser parses unicode constants
     Failure/Error: parsed("FOOλ = 1").should == [:cdecl, :FOOλ, [:int, 1]]
       expected: [:cdecl, :FOO?, [:int, 1]]
            got: (:cdecl, :FOOλ, (:int, 1)) (using ==)
     # ./spec/lib/parser/variables_spec.rb:102:in `block in (root)'
@phluid61
Copy link
Contributor

Is this related to #4070 ?

@elia
Copy link
Contributor Author

elia commented Aug 21, 2016

Probably yes, see also #3880.

@headius
Copy link
Member

headius commented Apr 27, 2017

#4070 is fixed but #3880 is not. There's a chance this is already fixed for 9.1.9.0, or it may be fixed by work @enebo and I are doing to finally fix up symbol encodings (probably for 9.2, depending on impact).

I could not find the original branch for this reproduction, so I'm unsure how to test it. @elia?

@elia
Copy link
Contributor Author

elia commented Apr 27, 2017

@headius the reason is that we switched to use the parser gem for parsing instead of our home brew solution and the specs are now gone from master. The relevant spec is still available on the 0-10-stable branch.

Feel free to close this issue at your discretion.


In case you want to repro the issue just do the following:

git clone https://github.com/opal/opal --recursive --branch 0-10-stable
bundle install
# remove the RUBY_PLATFORM check
bundle exec rspec spec/lib/parser/variables_spec.rb

@headius
Copy link
Member

headius commented May 16, 2018

This is almost certainly fixed by @enebo's work on symbols. Reopen if not...I am on a slow connection and could not verify using @elia's instrucitons.

@headius headius closed this as completed May 16, 2018
elia added a commit to opal/opal that referenced this issue Jun 13, 2018
@elia
Copy link
Contributor Author

elia commented Jun 13, 2018

@headius confirmed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants