Skip to content

Commit

Permalink
Update to joni that allows more named capture names. Fixes #4287.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 17, 2016
1 parent 822705a commit 3995a2d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/pom.rb
Expand Up @@ -55,7 +55,7 @@
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'

jar 'org.jruby.joni:joni:2.1.11'
jar 'org.jruby.joni:joni:2.1.12-SNAPSHOT'
jar 'org.jruby.extras:bytelist:1.0.13'
jar 'org.jruby.jcodings:jcodings:1.0.18'
jar 'org.jruby:dirgra:0.3'
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Expand Up @@ -175,7 +175,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby.joni</groupId>
<artifactId>joni</artifactId>
<version>2.1.11</version>
<version>2.1.12-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jruby.extras</groupId>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/parser/ParserSupport.java
Expand Up @@ -55,6 +55,7 @@
import org.jruby.runtime.DynamicScope;
import org.jruby.runtime.Signature;
import org.jruby.util.ByteList;
import org.jruby.util.IdUtil;
import org.jruby.util.KeyValuePair;
import org.jruby.util.RegexpOptions;
import org.jruby.util.StringSupport;
Expand Down Expand Up @@ -1307,8 +1308,7 @@ private List<Integer> allocateNamedLocals(RegexpNode regexpNode) {
StaticScope scope = getCurrentScope();

for (int i = 0; i < length; i++) {
// TODO: Pass by non-local-varnamed things but make sure consistent with list we get from regexp
if (RubyLexer.getKeyword(names[i]) == null && !Character.isUpperCase(names[i].charAt(0))) {
if (RubyLexer.getKeyword(names[i]) == null && IdUtil.isLocal(names[i])) {
int slot = scope.isDefined(names[i]);
if (slot >= 0) {
// If verbose and the variable is not just another named capture, warn
Expand Down
3 changes: 1 addition & 2 deletions test/mri.index
Expand Up @@ -75,8 +75,7 @@ ruby/test_range.rb
ruby/test_rational.rb
ruby/test_rational2.rb
ruby/test_readpartial.rb
# jruby/jruby#4287
#ruby/test_regexp.rb
ruby/test_regexp.rb
ruby/test_require.rb
# jruby/jruby#4288
#ruby/test_refinement.rb
Expand Down

0 comments on commit 3995a2d

Please sign in to comment.