diff options
-rw-r--r-- | parse.y | 6 | ||||
-rwxr-xr-x | tool/ytab.sed | 3 |
2 files changed, 9 insertions, 0 deletions
@@ -45,6 +45,12 @@ #define YYCALLOC(nelem, size) rb_parser_calloc(parser, (nelem), (size)) #define YYFREE(ptr) rb_parser_free(parser, (ptr)) #define YYFPRINTF rb_parser_printf +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + rb_parser_printf(parser, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +#endif #undef malloc #undef realloc #undef calloc diff --git a/tool/ytab.sed b/tool/ytab.sed index ce5a942b00..706cf75a9a 100755 --- a/tool/ytab.sed +++ b/tool/ytab.sed @@ -47,6 +47,9 @@ a\ } x } +/^yy_reduce_print/,/^}/{ + s/fprintf *(stderr,/YYFPRINTF (parser,/g +} s/\( YYFPRINTF *(\)yyoutput,/\1parser,/ s/\( YYFPRINTF *(\)stderr,/\1parser,/ s/\( YYDPRINTF *((\)stderr,/\1parser,/ |