Skip to content

Commit

Permalink
Removed unused argument
Browse files Browse the repository at this point in the history
Eventually, `read_escape` does not use `encp`.
  • Loading branch information
nobu committed Oct 25, 2023
1 parent f26d53e commit 2f8a719
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -7965,7 +7965,7 @@ tokadd_utf8(struct parser_params *p, rb_encoding **encp,
#define ESCAPE_META 2

static int
read_escape(struct parser_params *p, int flags, rb_encoding **encp)
read_escape(struct parser_params *p, int flags)
{
int c;
size_t numlen;
Expand Down Expand Up @@ -8024,7 +8024,7 @@ read_escape(struct parser_params *p, int flags, rb_encoding **encp)
nextc(p);
goto eof;
}
return read_escape(p, flags|ESCAPE_META, encp) | 0x80;
return read_escape(p, flags|ESCAPE_META) | 0x80;
}
else if (c == -1 || !ISASCII(c)) goto eof;
else {
Expand Down Expand Up @@ -8053,7 +8053,7 @@ read_escape(struct parser_params *p, int flags, rb_encoding **encp)
nextc(p);
goto eof;
}
c = read_escape(p, flags|ESCAPE_CONTROL, encp);
c = read_escape(p, flags|ESCAPE_CONTROL);
}
else if (c == '?')
return 0177;
Expand Down Expand Up @@ -8101,7 +8101,7 @@ tokaddmbc(struct parser_params *p, int c, rb_encoding *enc)
}

static int
tokadd_escape(struct parser_params *p, rb_encoding **encp)
tokadd_escape(struct parser_params *p)
{
int c;
size_t numlen;
Expand Down Expand Up @@ -8341,7 +8341,7 @@ tokadd_string(struct parser_params *p,
case 'C':
case 'M': {
pushback(p, c);
c = read_escape(p, 0, enc);
c = read_escape(p, 0);

char *t = tokspace(p, rb_strlen_lit("\\x00"));
*t++ = '\\';
Expand All @@ -8357,7 +8357,7 @@ tokadd_string(struct parser_params *p,
continue;
}
pushback(p, c);
if ((c = tokadd_escape(p, enc)) < 0)
if ((c = tokadd_escape(p)) < 0)
return -1;
if (*enc && *enc != *encp) {
mixed_escape(p->lex.ptok+2, *enc, *encp);
Expand All @@ -8367,7 +8367,7 @@ tokadd_string(struct parser_params *p,
else if (func & STR_FUNC_EXPAND) {
pushback(p, c);
if (func & STR_FUNC_ESCAPE) tokadd(p, '\\');
c = read_escape(p, 0, enc);
c = read_escape(p, 0);
}
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
/* ignore backslashed spaces in %w */
Expand Down Expand Up @@ -9908,7 +9908,7 @@ parse_qmark(struct parser_params *p, int space_seen)
if (tokadd_mbchar(p, c) == -1) return 0;
}
else {
c = read_escape(p, 0, &enc);
c = read_escape(p, 0);
tokadd(p, c);
}
}
Expand Down

0 comments on commit 2f8a719

Please sign in to comment.