summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parse.y16
1 files changed, 14 insertions, 2 deletions
@@ -775,6 +775,7 @@ static VALUE parser_heredoc_dedent(struct parser_params*,VALUE);
# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
#ifdef RIPPER
static ID id_warn, id_warning;
# define WARN_S(s) STR_NEW2(s)
# define WARN_I(i) INT2NUM(i)
# define PRIsWARN "s"
@@ -788,6 +789,7 @@ static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
# define compile_error ripper_compile_error
# define PARSER_ARG parser,
#else
# define WARN_S(s) s
# define WARN_I(i) i
# define PRIsWARN PRIsVALUE
@@ -7468,7 +7470,7 @@ parse_numeric(struct parser_params *parser, int c)
}
static int
-parse_qmark(struct parser_params *parser)
{
rb_encoding *enc;
register int c;
@@ -7521,6 +7523,16 @@ parse_qmark(struct parser_params *parser)
}
else if ((rb_enc_isalnum(c, current_enc) || c == '_') &&
lex_p < lex_pend && is_identchar(lex_p, lex_pend, current_enc)) {
goto ternary;
}
else if (c == '\\') {
@@ -8267,7 +8279,7 @@ parser_yylex(struct parser_params *parser)
return tSTRING_BEG;
case '?':
- return parse_qmark(parser);
case '&':
if ((c = nextc()) == '&') {