ruby-changes:49846
From: mame <ko1@a...>
Date: Sat, 20 Jan 2018 00:43:48 +0900 (JST)
Subject: [ruby-changes:49846] mame:r61964 (trunk): parse.y: Remove unneeded type decls for Ripper
mame 2018-01-20 00:43:42 +0900 (Sat, 20 Jan 2018) New Revision: 61964 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61964 Log: parse.y: Remove unneeded type decls for Ripper I think that they are not used. Modified files: trunk/ext/ripper/tools/dsl.rb trunk/ext/ripper/tools/preproc.rb trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61963) +++ parse.y (revision 61964) @@ -874,10 +874,6 @@ static void token_info_pop(struct parser https://github.com/ruby/ruby/blob/trunk/parse.y#L874 %type <id> fsym keyword_variable user_variable sym symbol operation operation2 operation3 %type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg %type <id> f_kwrest f_label f_arg_asgn call_op call_op2 reswords relop -/*%%%*/ -/*% -%type <val> program then do -%*/ %token END_OF_INPUT 0 "end-of-input" %token tUPLUS RUBY_TOKEN(UPLUS) "unary+" %token tUMINUS RUBY_TOKEN(UMINUS) "unary-" @@ -968,11 +964,7 @@ program : { https://github.com/ruby/ruby/blob/trunk/parse.y#L964 } p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, $2), &@$); /*% %*/ - /*% ripper: program!($2) %*/ - /*%%%*/ - /*% - p->result = $$; - %*/ + /*% ripper[final]: program!($2) %*/ local_pop(p); } ; @@ -2686,14 +2678,11 @@ k_return : keyword_return https://github.com/ruby/ruby/blob/trunk/parse.y#L2678 ; then : term - /*% ripper[brace]: "Qnil" %*/ | keyword_then | term keyword_then - /*% ripper[brace]: $2 %*/ ; do : term - /*% ripper[brace]: "Qnil" %*/ | keyword_do_cond ; Index: ext/ripper/tools/preproc.rb =================================================================== --- ext/ripper/tools/preproc.rb (revision 61963) +++ ext/ripper/tools/preproc.rb (revision 61964) @@ -43,12 +43,6 @@ def prelude(f, out) https://github.com/ruby/ruby/blob/trunk/ext/ripper/tools/preproc.rb#L43 @exprs = {} while line = f.gets case line - when %r</\*%%%\*/> - out << '/*' << $/ - when %r</\*%> - out << '*/' << $/ - when %r<%\*/> - out << $/ when /\A%%/ out << '%%' << $/ return Index: ext/ripper/tools/dsl.rb =================================================================== --- ext/ripper/tools/dsl.rb (revision 61963) +++ ext/ripper/tools/dsl.rb (revision 61964) @@ -8,6 +8,7 @@ class DSL https://github.com/ruby/ruby/blob/trunk/ext/ripper/tools/dsl.rb#L8 @events = {} @error = options.include?("error") @brace = options.include?("brace") + @final = options.include?("final") # create $1 == "$1", $2 == "$2", ... re, s = "", "" @@ -28,6 +29,7 @@ class DSL https://github.com/ruby/ruby/blob/trunk/ext/ripper/tools/dsl.rb#L29 def generate s = "$$" + s = "p->result" if @final s = "\t\t\t#{ s } = #@code;" s << "ripper_error(p);" if @error s = "{#{ s }}" if @brace -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/