Skip to content

Commit

Permalink
Remove parser_show_error_line
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 24, 2024
1 parent 85ff2c4 commit cbc9afa
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -7443,23 +7443,6 @@ parser_precise_mbclen(struct parser_params *p, const char *ptr)
}

#ifndef RIPPER
static inline void
parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
{
rb_parser_string_t *str;
int lineno = p->ruby_sourceline;
if (!yylloc) {
return;
}
else if (yylloc->beg_pos.lineno == lineno) {
str = p->lex.lastline;
}
else {
return;
}
ruby_show_error_line(p, p->error_buffer, Qnil, yylloc, lineno, str);
}

static int
parser_yyerror(struct parser_params *p, const rb_code_location_t *yylloc, const char *msg)
{
Expand Down Expand Up @@ -16260,7 +16243,9 @@ parser_compile_error(struct parser_params *p, const rb_code_location_t *loc, con
p->ruby_sourcefile_string,
lineno, column,
p->enc, fmt, ap);
parser_show_error_line(p, loc);
if (lastline) {
ruby_show_error_line(p, p->error_buffer, Qnil, loc, lineno, lastline);
}
}
else {
VALUE str = rb_enc_str_new(0, 0, p->enc);
Expand Down

0 comments on commit cbc9afa

Please sign in to comment.