aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-16 03:16:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-16 03:16:15 +0000
commit28e554a69758d28f1a077d2f73932c1b9f7547ad (patch)
tree08abfe0deb252c22dacf51af13b216617fbc3ecd /parse.y
parentdc1e6f17baafa4da77202e48803bd6e507e83b7d (diff)
downloadruby-28e554a69758d28f1a077d2f73932c1b9f7547ad.tar.gz
parse.y: expand tokadd_mbchar
* parse.y (tokadd_mbchar): renamed and expand callers with p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y20
1 files changed, 9 insertions, 11 deletions
diff --git a/parse.y b/parse.y
index 3548363fa3..d52295b0d7 100644
--- a/parse.y
+++ b/parse.y
@@ -5748,7 +5748,7 @@ parser_regx_options(struct parser_params *p)
}
static int
-parser_tokadd_mbchar(struct parser_params *p, int c)
+tokadd_mbchar(struct parser_params *p, int c)
{
int len = parser_precise_mbclen(p, p->lex.pcur-1);
if (len < 0) return -1;
@@ -5758,8 +5758,6 @@ parser_tokadd_mbchar(struct parser_params *p, int c)
return c;
}
-#define tokadd_mbchar(c) parser_tokadd_mbchar(p, (c))
-
static inline int
simple_re_meta(int c)
{
@@ -5917,7 +5915,7 @@ parser_tokadd_string(struct parser_params *p,
mixed_error(enc, *encp);
continue;
}
- if (tokadd_mbchar(c) == -1) return -1;
+ if (tokadd_mbchar(p, c) == -1) return -1;
continue;
}
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
@@ -6169,7 +6167,7 @@ parser_heredoc_identifier(struct parser_params *p)
tokadd(func);
term = c;
while ((c = nextc()) != -1 && c != term) {
- if (tokadd_mbchar(c) == -1) return 0;
+ if (tokadd_mbchar(p, c) == -1) return 0;
if (!newline && c == '\n') newline = 1;
else if (newline) newline = 2;
}
@@ -6200,7 +6198,7 @@ parser_heredoc_identifier(struct parser_params *p)
tokadd(term_len);
tokadd(func |= str_dquote);
do {
- if (tokadd_mbchar(c) == -1) return 0;
+ if (tokadd_mbchar(p, c) == -1) return 0;
} while ((c = nextc()) != -1 && parser_is_identchar());
pushback(c);
break;
@@ -7297,7 +7295,7 @@ parse_qmark(struct parser_params *p, int space_seen)
newtok();
enc = p->enc;
if (!parser_isascii()) {
- if (tokadd_mbchar(c) == -1) return 0;
+ if (tokadd_mbchar(p, c) == -1) return 0;
}
else if ((rb_enc_isalnum(c, p->enc) || c == '_') &&
p->lex.pcur < p->lex.pend && is_identchar(p->lex.pcur, p->lex.pend, p->enc)) {
@@ -7323,7 +7321,7 @@ parse_qmark(struct parser_params *p, int space_seen)
}
else if (!lex_eol_p() && !(c = *p->lex.pcur, ISASCII(c))) {
nextc();
- if (tokadd_mbchar(c) == -1) return 0;
+ if (tokadd_mbchar(p, c) == -1) return 0;
}
else {
c = read_escape(0, &enc);
@@ -7433,7 +7431,7 @@ static int
tokadd_ident(struct parser_params *p, int c)
{
do {
- if (tokadd_mbchar(c) == -1) return -1;
+ if (tokadd_mbchar(p, c) == -1) return -1;
c = nextc();
} while (parser_is_identchar());
pushback(c);
@@ -7515,7 +7513,7 @@ parse_gvar(struct parser_params *p, const enum lex_state_e last_state)
tokadd(c);
c = nextc();
if (parser_is_identchar()) {
- if (tokadd_mbchar(c) == -1) return 0;
+ if (tokadd_mbchar(p, c) == -1) return 0;
}
else {
pushback(c);
@@ -7622,7 +7620,7 @@ parse_ident(struct parser_params *p, int c, int cmd_state)
do {
if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
- if (tokadd_mbchar(c) == -1) return 0;
+ if (tokadd_mbchar(p, c) == -1) return 0;
c = nextc();
} while (parser_is_identchar());
if ((c == '!' || c == '?') && !peek('=')) {