summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 7d1d81f9ef..885b5d312e 100644
--- a/parse.y
+++ b/parse.y
@@ -3300,10 +3300,14 @@ yylex()
rb_warn("invalid character syntax; use ?\\%c", c);
}
}
+ ternary:
pushback(c);
lex_state = EXPR_BEG;
return '?';
}
+ if ((ISALNUM(c) || c == '_') && lex_p < lex_pend && is_identchar(*lex_p)) {
+ goto ternary;
+ }
else if (c == '\\') {
c = read_escape();
}