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

Returns nil instead of regex match group inside conditional #2787

Closed
kaiserprogrammer opened this Issue Mar 31, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@kaiserprogrammer
Copy link

kaiserprogrammer commented Mar 31, 2015

Problem with DBI gem under jruby-9.0.0.0.pre

def parse_url(driver_url)
  if driver_url =~ /^(DBI|dbi):([^:]+)(:(.*))$/ 
    [$2, $4]
  else
    raise InterfaceError, "Invalid Data Source Name"
  end
end

parse_url("dbi:jdbc:sqlite")

returns [nil, nil] instead of ["jdbc", "sqlite"]

@enebo enebo added this to the 9.0.0.0.pre2 milestone Apr 1, 2015

@enebo enebo added the ir label Apr 1, 2015

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Apr 1, 2015

Randomly guessing this was an IR bug and not a regexp problem. I do not see this issue anymore on HEAD:

system ~/work/jruby master *+ 1404% jruby -Xjit.threshold=0 -Xjit.background=false  ../snippets/re2.rb 
["jdbc", "sqlite"]
system ~/work/jruby master *+ 1405% jruby -X-C -Xjit.threshold=0 -Xjit.background=false  ../snippets/re2.rb 
["jdbc", "sqlite"]
system ~/work/jruby master *+ 1406% jruby -X-C -Xjit.threshold=100000 -Xjit.background=false  ../snippets/re2.rb 
["jdbc", "sqlite"]

The syntax is a little arcane but I am testing startup interpreter, full interpreter, and JIT. Resolving.

@enebo enebo closed this Apr 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.