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

ruby-changes:39422

From: nobu <ko1@a...>
Date: Fri, 7 Aug 2015 17:23:34 +0900 (JST)
Subject: [ruby-changes:39422] nobu:r51503 (trunk): parse.y: require pure parser

nobu	2015-08-07 17:23:09 +0900 (Fri, 07 Aug 2015)

  New Revision: 51503

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

  Log:
    parse.y: require pure parser
    
    * parse.y (yylex): non-pure parser has not been supported since
      merger of ripper.  change argument types from void pointers.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51502)
+++ ChangeLog	(revision 51503)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Aug  7 17:23:06 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (yylex): non-pure parser has not been supported since
+	  merger of ripper.  change argument types from void pointers.
+
 Fri Aug  7 17:07:56 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* proc.c (method_super_method): uncallable method entry does not
Index: parse.y
===================================================================
--- parse.y	(revision 51502)
+++ parse.y	(revision 51503)
@@ -11,6 +11,9 @@ https://github.com/ruby/ruby/blob/trunk/parse.y#L11
 
 %{
 
+#if !YYPURE
+# error needs pure parser
+#endif
 #ifndef PARSER_DEBUG
 #define PARSER_DEBUG 0
 #endif
@@ -360,11 +363,7 @@ static int parser_yyerror(struct parser_ https://github.com/ruby/ruby/blob/trunk/parse.y#L363
 #define ruby_coverage		(parser->coverage)
 #endif
 
-#if YYPURE
-static int yylex(void*, void*);
-#else
-static int yylex(void*);
-#endif
+static int yylex(YYSTYPE*, struct parser_params*);
 
 #ifndef RIPPER
 #define yyparse ruby_yyparse
@@ -8526,20 +8525,13 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8525
     return parse_ident(parser, c, cmd_state);
 }
 
-#if YYPURE
 static int
-yylex(void *lval, void *p)
-#else
-yylex(void *p)
-#endif
+yylex(YYSTYPE *lval, struct parser_params *parser)
 {
-    struct parser_params *parser = (struct parser_params*)p;
     int t;
 
-#if YYPURE
     parser->parser_yylval = lval;
-    parser->parser_yylval->val = Qundef;
-#endif
+    lval->val = Qundef;
     t = parser_yylex(parser);
 #ifdef RIPPER
     if (!NIL_P(parser->delayed)) {

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

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