Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f625358bbe53
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e44f334c0b7a
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 22, 2016

  1. Copy the full SHA
    4b5ba40 View commit details
  2. Copy the full SHA
    e44f334 View commit details
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ext/ripper/RipperLexer.java
Original file line number Diff line number Diff line change
@@ -1245,7 +1245,7 @@ private int identifierToken(int last_state, int result, String value) {
setState(EXPR_END);
}

identValue = value;
identValue = value.intern();
return result;
}

6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/ext/ripper/RipperParser.java
Original file line number Diff line number Diff line change
@@ -1829,10 +1829,10 @@ public Object yyparse (RipperLexer yyLex) throws java.io.IOException {
};
states[38] = new RipperParserState() {
@Override public Object execute(RipperParser p, Object yyVal, Object[] yyVals, int yyTop) {
yyVal = p.dispatch("on_assign_error",
p.dispatch("on_opassign",
yyVal = p.dispatch("on_opassign",
p.dispatch("on_const_path_field", ((IRubyObject)yyVals[-4+yyTop]), ((IRubyObject)yyVals[-2+yyTop])),
((IRubyObject)yyVals[-1+yyTop]), ((IRubyObject)yyVals[0+yyTop])));
((IRubyObject)yyVals[-1+yyTop]),
((IRubyObject)yyVals[0+yyTop]));
return yyVal;
}
};
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/ext/ripper/RipperParser.y
Original file line number Diff line number Diff line change
@@ -340,10 +340,10 @@ stmt : kALIAS fitem {
$4, $5);
}
| primary_value tCOLON2 tCONSTANT tOP_ASGN command_call {
$$ = p.dispatch("on_assign_error",
p.dispatch("on_opassign",
$$ = p.dispatch("on_opassign",
p.dispatch("on_const_path_field", $1, $3),
$4, $5));
$4,
$5);
}
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call {
$$ = p.dispatch("on_opassign",
13 changes: 7 additions & 6 deletions core/src/main/java/org/jruby/ext/ripper/RipperParserBase.java
Original file line number Diff line number Diff line change
@@ -137,7 +137,9 @@ public IRubyObject assignable(IRubyObject name) {
}
} else if (javaName.charAt(0) == '$') { // MRI: ID_GLOBAL
return name;
}
}

currentScope.assign(null, javaName.intern(), null);

return name;
}
@@ -184,8 +186,7 @@ protected void getterIdentifierError(String identifier) {

// FIXME: Consider removing identifier.
public boolean is_id_var(IRubyObject identifier) {
String ident = lexer.getIdent();
ident.intern();
String ident = lexer.getIdent().intern();
char c = ident.charAt(0);

if (c == '$' || c == '@' || Character.toUpperCase(c) == c) return true;
@@ -280,9 +281,9 @@ public IRubyObject shadowing_lvar(IRubyObject identifier) {
StaticScope current = getCurrentScope();
if (current.isBlockScope()) {
if (current.exists(name) >= 0) yyerror("duplicated argument name");
if (lexer.isVerbose() && current.isDefined(name) >= 0) {
lexer.warning("shadowing outer local variable - " + name);

if (current.isDefined(name) >= 0) {
lexer.warning("shadowing outer local variable - %s", name);
}
} else if (current.exists(name) >= 0) {
yyerror("duplicated argument name");