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: 4920dee2d296
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a55075a1ba35
Choose a head ref
  • 6 commits
  • 9 files changed
  • 1 contributor

Commits on Jan 29, 2016

  1. Copy the full SHA
    929bab3 View commit details
  2. Copy the full SHA
    ae01882 View commit details
  3. Copy the full SHA
    9a6df03 View commit details
  4. Copy the full SHA
    dcba083 View commit details

Commits on Jan 30, 2016

  1. Copy the full SHA
    9ddd74c View commit details
  2. Copy the full SHA
    a55075a View commit details
26 changes: 21 additions & 5 deletions core/src/main/java/org/jruby/ext/ripper/RipperLexer.java
Original file line number Diff line number Diff line change
@@ -1163,6 +1163,7 @@ private String tokenToEventId(int token) {
case ' ': return "on_words_sep";
case Tokens.tBANG: return "on_op";
case Tokens.tPERCENT: return "on_op";
case Tokens.tANDDOT: return "on_op";
case Tokens.tAMPER2: return "on_op";
case Tokens.tSTAR2: return "on_op";
case Tokens.tPLUS: return "on_op";
@@ -1650,6 +1651,8 @@ private int ampersand(boolean spaceSeen) throws IOException {
case '=':
setState(LexState.EXPR_BEG);
return Tokens.tOP_ASGN;
case '.':
return Tokens.tANDDOT;
}
pushback(c);

@@ -1677,11 +1680,19 @@ private int at() throws IOException {
c = nextc();
result = Tokens.tCVAR;
} else {
result = Tokens.tIVAR;
result = Tokens.tIVAR;
}

if (c != EOF && (Character.isDigit(c) || !isIdentifierChar(c))) {
if (tokenBuffer.length() == 1) {

if (c == EOF || Character.isSpaceChar(c)) {
if (result == Tokens.tIVAR) {
compile_error("`@' without identifiers is not allowed as an instance variable name");
return EOF;
}

compile_error("`@@' without identifiers is not allowed as a class variable name");
return EOF;
} else if (Character.isDigit(c) || !isIdentifierChar(c)) {
if (result == Tokens.tIVAR) {
compile_error("`@" + ((char) c) + "' is not allowed as an instance variable name");
return EOF;
}
@@ -1905,7 +1916,12 @@ private int dollar() throws IOException {
return identifierToken(last_state, Tokens.tGVAR, ("$" + (char) c).intern());
default:
if (!isIdentifierChar(c)) {
compile_error("`$" + ((char) c) + "' is not allowed as a global variable name");
if (c == EOF || Character.isSpaceChar(c)) {
compile_error("`$' without identifiers is not allowed as a global variable name");
} else {
pushback(c);
compile_error("`$" + ((char) c) + "' is not allowed as a global variable name");
}
return EOF;
}

Loading