git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2015-12-24 14:30:13 +00:00
Родитель 89b3281668
Коммит 2fd34fa328
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -8,7 +8,7 @@ Thu Dec 24 18:43:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
(rb_compile_bug): deprecate internal functions. (rb_compile_bug): deprecate internal functions.
* parse.y (parser_yyerror): construct exception message with * parse.y (parser_yyerror): construct exception message with
source code and carret. source code and caret.
Thu Dec 24 17:25:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Dec 24 17:25:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>

Просмотреть файл

@ -5410,7 +5410,7 @@ parser_yyerror(struct parser_params *parser, const char *msg)
const int max_line_margin = 30; const int max_line_margin = 30;
const char *p, *pe; const char *p, *pe;
const char *pre = "", *post = ""; const char *pre = "", *post = "";
const char *code = "", *carret = "", *newline = ""; const char *code = "", *caret = "", *newline = "";
char *buf; char *buf;
long len; long len;
int i; int i;
@ -5446,7 +5446,7 @@ parser_yyerror(struct parser_params *parser, const char *msg)
i = (int)(lex_p - p); i = (int)(lex_p - p);
buf = ALLOCA_N(char, i+2); buf = ALLOCA_N(char, i+2);
code = p; code = p;
carret = p2 = buf; caret = p2 = buf;
while (i-- > 0) { while (i-- > 0) {
*p2++ = *p++ == '\t' ? '\t' : ' '; *p2++ = *p++ == '\t' ? '\t' : ' ';
} }
@ -5460,7 +5460,7 @@ parser_yyerror(struct parser_params *parser, const char *msg)
compile_error(PARSER_ARG "%s%s""%s%.*s%s%s""%s%s", compile_error(PARSER_ARG "%s%s""%s%.*s%s%s""%s%s",
msg, newline, msg, newline,
pre, (int)len, code, post, newline, pre, (int)len, code, post, newline,
pre, carret); pre, caret);
#else #else
dispatch1(parse_error, STR_NEW2(msg)); dispatch1(parse_error, STR_NEW2(msg));
ripper_error(); ripper_error();