ruby-changes:48529
From: nobu <ko1@a...>
Date: Sat, 4 Nov 2017 21:01:47 +0900 (JST)
Subject: [ruby-changes:48529] nobu:r60644 (trunk): parse.y: suppress warnings
nobu 2017-11-04 21:01:42 +0900 (Sat, 04 Nov 2017) New Revision: 60644 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60644 Log: parse.y: suppress warnings * parse.y (parser_set_line): removed no longer used function. * parse.y (rb_strterm_heredoc_t): adjust type of sourceline to ruby_sourceline. * parse.y (rb_strterm_t): get rid of redefinition. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 60643) +++ parse.y (revision 60644) @@ -350,12 +350,6 @@ static int parser_yyerror(struct parser_ https://github.com/ruby/ruby/blob/trunk/parse.y#L350 static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*); static inline void -parser_set_line(NODE *n, int l) -{ - nd_set_line(n, l); -} - -static inline void rb_discard_node_gen(struct parser_params *parser, NODE *n) { rb_ast_delete_node(parser->ast, n); @@ -763,24 +757,27 @@ typedef struct rb_strterm_literal_struct https://github.com/ruby/ruby/blob/trunk/parse.y#L757 } rb_strterm_literal_t; typedef struct rb_strterm_heredoc_struct { - VALUE sourceline; + union { + VALUE dummy; + int sourceline; + } u1; VALUE term; /* `"END"` of `<<"END"` */ VALUE lastline; /* the string of line that contains `<<"END"` */ union { VALUE dummy; long lastidx; /* the column of `<<"END"` */ - } u3; + } u3; } rb_strterm_heredoc_t; #define STRTERM_HEREDOC IMEMO_FL_USER0 -typedef struct rb_strterm_struct { +struct rb_strterm_struct { VALUE flags; union { rb_strterm_literal_t literal; rb_strterm_heredoc_t heredoc; } u; -} rb_strterm_t; +}; void rb_strterm_mark(VALUE obj) @@ -6794,7 +6791,7 @@ parser_heredoc_restore(struct parser_par https://github.com/ruby/ruby/blob/trunk/parse.y#L6791 lex_pend = lex_pbeg + RSTRING_LEN(line); lex_p = lex_pbeg + here->u3.lastidx; heredoc_end = ruby_sourceline; - ruby_sourceline = here->sourceline; + ruby_sourceline = here->u1.sourceline; token_flush(parser); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/