ruby-changes:56150
From: git <ko1@a...>
Date: Wed, 19 Jun 2019 18:57:32 +0900 (JST)
Subject: [ruby-changes:56150] git: b93508b32c (trunk): * remove trailing spaces, append newline at EOF.
https://git.ruby-lang.org/ruby.git/commit/?id=b93508b32c From b93508b32c8f11bd468a885745338eab259bd2cd Mon Sep 17 00:00:00 2001 From: git <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Wed, 19 Jun 2019 18:19:20 +0900 Subject: * remove trailing spaces, append newline at EOF. diff --git a/lib/racc/grammar.rb b/lib/racc/grammar.rb index e55785a..cc4e48e 100644 --- a/lib/racc/grammar.rb +++ b/lib/racc/grammar.rb @@ -569,7 +569,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/grammar.rb#L569 check_symbols_useless s end until r.size == rs and s.size == ss end - + def check_rules_useless(rules) rules.delete_if do |rule| rule.useless = false @@ -853,7 +853,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/grammar.rb#L853 end private - + def ptr_bug! raise "racc: fatal: pointer not exist: self: #{to_s}" end diff --git a/lib/racc/grammarfileparser.rb b/lib/racc/grammarfileparser.rb index 37b8c37..488f3e6 100644 --- a/lib/racc/grammarfileparser.rb +++ b/lib/racc/grammarfileparser.rb @@ -284,7 +284,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/grammarfileparser.rb#L284 end label end - + def add_user_code(label, src) @result.params.send(USER_CODE_LABELS[label]).push src end diff --git a/lib/racc/iset.rb b/lib/racc/iset.rb index a79e709..1e5fcf5 100644 --- a/lib/racc/iset.rb +++ b/lib/racc/iset.rb @@ -85,7 +85,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/iset.rb#L85 def dup ISet.new(@set.dup) end - + end # class ISet end # module Racc diff --git a/lib/racc/logfilegenerator.rb b/lib/racc/logfilegenerator.rb index b95b1af..05a4e0c 100644 --- a/lib/racc/logfilegenerator.rb +++ b/lib/racc/logfilegenerator.rb @@ -132,7 +132,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/logfilegenerator.rb#L132 def outact(f, t, act) case act when Shift - f.printf " %-12s shift, and go to state %d\n", + f.printf " %-12s shift, and go to state %d\n", t.to_s, act.goto_id when Reduce f.printf " %-12s reduce using rule %d (%s)\n", diff --git a/lib/racc/state.rb b/lib/racc/state.rb index 347a743..814d14d 100644 --- a/lib/racc/state.rb +++ b/lib/racc/state.rb @@ -168,7 +168,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/state.rb#L168 @states.push dest @statecache[k] = dest - + puts "core_to_state: create state ID #{dest.ident}" if @d_state else if @d_state @@ -306,7 +306,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/state.rb#L306 la end - + def create_tmap(size) Array.new(size, 0) # use Integer as bitmap end @@ -510,13 +510,13 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/state.rb#L510 end end end - + ASSOC = { :Left => :Reduce, :Right => :Shift, :Nonassoc => :Error } - + def do_resolve_sr(stok, rtok) puts "resolve_sr: s/r conflict: rtok=#{rtok}, stok=#{stok}" if @d_prec @@ -773,7 +773,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/state.rb#L773 attr_reader :symbol attr_reader :from_state attr_reader :to_state - + def inspect "(#{@from_state.ident}-#{@symbol}->#{@to_state.ident})" end @@ -936,11 +936,11 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/state.rb#L936 @shift = shift @reduce = reduce end - + attr_reader :stateid attr_reader :shift attr_reader :reduce - + def to_s sprintf('state %d: S/R conflict rule %d reduce and shift %s', @stateid, @reduce.ruleid, @shift.to_s) @@ -959,7 +959,7 @@ module Racc https://github.com/ruby/ruby/blob/trunk/lib/racc/state.rb#L959 attr_reader :high_prec attr_reader :low_prec attr_reader :token - + def to_s sprintf('state %d: R/R conflict with rule %d and %d on %s', @stateid, @high_prec.ident, @low_prec.ident, @token.to_s) diff --git a/test/racc/assets/error_recovery.y b/test/racc/assets/error_recovery.y index 1fd21ac..7128c36 100644 --- a/test/racc/assets/error_recovery.y +++ b/test/racc/assets/error_recovery.y @@ -32,4 +32,4 @@ end https://github.com/ruby/ruby/blob/trunk/test/racc/assets/error_recovery.y#L32 ---- footer -InfiniteLoop.new.parse \ No newline at end of file +InfiniteLoop.new.parse diff --git a/test/racc/assets/intp.y b/test/racc/assets/intp.y index 24e547d..39e42af 100644 --- a/test/racc/assets/intp.y +++ b/test/racc/assets/intp.y @@ -27,7 +27,7 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/intp.y#L27 result.push val[1] } | stmt_list EOL - + stmt : expr | assign | IDENT realprim @@ -38,7 +38,7 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/intp.y#L38 | if_stmt | while_stmt | defun - + if_stmt : IF stmt THEN EOL stmt_list else_stmt END { result = IfNode.new( @fname, val[0][0], @@ -261,7 +261,7 @@ module Intp https://github.com/ruby/ruby/blob/trunk/test/racc/assets/intp.y#L261 class Core - def initialize + def initialize @ftab = {} @obj = Object.new @stack = [] @@ -318,7 +318,7 @@ module Intp https://github.com/ruby/ruby/blob/trunk/test/racc/assets/intp.y#L318 def lvar?(name) @lvars.key? name end - + def [](key) @lvars[key] end diff --git a/test/racc/assets/liquor.y b/test/racc/assets/liquor.y index 8045a07..edf4411 100644 --- a/test/racc/assets/liquor.y +++ b/test/racc/assets/liquor.y @@ -310,4 +310,4 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/liquor.y#L310 args << [ :kwarg, retag([ k, v ]), k, v ] end } - end \ No newline at end of file + end diff --git a/test/racc/assets/mailp.y b/test/racc/assets/mailp.y index da332a3..eb7d4d5 100644 --- a/test/racc/assets/mailp.y +++ b/test/racc/assets/mailp.y @@ -35,7 +35,7 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L35 @field.domain = mb.domain } ; - + datetime : day DIGIT ATOM DIGIT hour zone # 0 1 2 3 4 5 # day month year @@ -44,11 +44,11 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L44 result = (t + val[4] - val[5]).localtime } ; - + day : /* none */ | ATOM ',' ; - + hour : DIGIT ':' DIGIT { result = (result.to_i * 60 * 60) + (val[2].to_i * 60) @@ -60,16 +60,16 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L60 + val[4].to_i } ; - + zone : ATOM { result = ::TMail.zonestr2i( val[0] ) * 60 } ; - + received : from by via with id for recvdatetime ; - + from : /* none */ | FROM domain { @@ -84,28 +84,28 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L84 @field.from = Address.join( val[1] ) } ; - + by : /* none */ | BY domain { @field.by = Address.join( val[1] ) } ; - + via : /* none */ | VIA ATOM { @field.via = val[1] } ; - + with : /* none */ | WITH ATOM { @field.with.push val[1] } ; - + id : /* none */ | ID msgid { @@ -116,14 +116,14 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L116 @field.msgid = val[1] } ; - + for : /* none */ | FOR addr { @field.for_ = val[1].address } ; - + recvdatetime : /* none */ | ';' datetime @@ -131,7 +131,7 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L131 @field.date = val[1] } ; - + returnpath: '<' '>' | routeaddr { @@ -173,7 +173,7 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L173 } # | phrase ':' ';' { result = AddressGroup.new( result ) } ; - + routeaddr : '<' route spec '>' { result = val[2] @@ -184,22 +184,22 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L184 result = val[1] } ; - + route : at_domains ':' ; - + at_domains: '@' domain { result = [ val[1] ] } | at_domains ',' '@' domain { result.push val[3] } ; - + spec : local '@' domain { result = Address.new( val[0], val[2] ) } | local { result = Address.new( result, nil ) } ; - + local : word { result = val } | local '.' word { result.push val[2] } ; - + domain : domword { result = val } | domain '.' domword { result.push val[2] } ; @@ -215,11 +215,11 @@ rule https://github.com/ruby/ruby/blob/trunk/test/racc/assets/mailp.y#L215 result = val.join('') } ; - (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/