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

Comments

Projects
None yet
3 participants
@elia
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)'

elia added a commit to opal/opal that referenced this issue Mar 22, 2016

elia added a commit to opal/opal that referenced this issue Mar 22, 2016

elia added a commit to opal/opal that referenced this issue Mar 22, 2016

@phluid61

This comment has been minimized.

Contributor

phluid61 commented Aug 20, 2016

Is this related to #4070 ?

@elia

This comment has been minimized.

Contributor

elia commented Aug 21, 2016

Probably yes, see also #3880.

@headius

This comment has been minimized.

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?

@headius headius added this to the JRuby 9.2.0.0 milestone Apr 27, 2017

@elia

This comment has been minimized.

Contributor

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

kares added a commit that referenced this issue Jan 10, 2018

Merge pull request #4096 from brocktimus/stickers_symbols_with_encoding
Extra tests for symbol encoding Re: #4070 + #3719 and possibly #3880
@headius

This comment has been minimized.

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 May 16, 2018

elia added a commit to opal/opal that referenced this issue Jun 13, 2018

@elia

This comment has been minimized.

Contributor

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