From 9e9551378171f33a6dea7d90c79eaf2dafe8fb1e Mon Sep 17 00:00:00 2001 From: mame Date: Sat, 20 Jan 2018 06:11:21 +0000 Subject: parse.y: Remove unneeded var_field_1 trick I thought this trick was needed because the result of var_field was passed to different arguments, as follows: ``` $1 = var_field(p, $1); $$ = backref_assign_error(p, $1, $1, &@$); ``` Currently the DSL supports that one result is passed to one argument. However, after the refactoring, I found that `backref_assign_error` uses only one `$1`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/ripper/tools/dsl.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'ext/ripper/tools') diff --git a/ext/ripper/tools/dsl.rb b/ext/ripper/tools/dsl.rb index 3857ec0702..c4c5a36e27 100644 --- a/ext/ripper/tools/dsl.rb +++ b/ext/ripper/tools/dsl.rb @@ -9,7 +9,6 @@ class DSL @error = options.include?("error") @brace = options.include?("brace") @final = options.include?("final") - @var_field_1 = options.include?("var_field_1") # create $1 == "$1", $2 == "$2", ... re, s = "", "" @@ -37,7 +36,6 @@ class DSL s = "#{ s } = #@code;" s << "ripper_error(p);" if @error s = "{#{ s }}" if @brace - s = "$1 = var_field(p, $1);" + s if @var_field_1 "\t\t\t#{s}" end -- cgit v1.2.3