[前][次][番号順一覧][スレッド一覧]

ruby-changes:41029

From: nobu <ko1@a...>
Date: Mon, 14 Dec 2015 15:37:08 +0900 (JST)
Subject: [ruby-changes:41029] nobu:r53108 (trunk): ytab.sed: for bison 2

nobu	2015-12-14 15:36:50 +0900 (Mon, 14 Dec 2015)

  New Revision: 53108

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53108

  Log:
    ytab.sed: for bison 2
    
    * tool/ytab.sed: substitute `fprintf`s used directory in
      yy_reduce_print by bison 2.

  Modified files:
    trunk/parse.y
    trunk/tool/ytab.sed
Index: parse.y
===================================================================
--- parse.y	(revision 53107)
+++ parse.y	(revision 53108)
@@ -45,6 +45,12 @@ https://github.com/ruby/ruby/blob/trunk/parse.y#L45
 #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
Index: tool/ytab.sed
===================================================================
--- tool/ytab.sed	(revision 53107)
+++ tool/ytab.sed	(revision 53108)
@@ -47,6 +47,9 @@ a\ https://github.com/ruby/ruby/blob/trunk/tool/ytab.sed#L47
   }
   x
 }
+/^yy_reduce_print/,/^}/{
+  s/fprintf *(stderr,/YYFPRINTF (parser,/g
+}
 s/\( YYFPRINTF *(\)yyoutput,/\1parser,/
 s/\( YYFPRINTF *(\)stderr,/\1parser,/
 s/\( YYDPRINTF *((\)stderr,/\1parser,/

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]