mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
tool/node_name.rb: rewrote without flip-flop
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
164a93c8b7
commit
5af7cda5a5
1 changed files with 3 additions and 5 deletions
|
@ -1,10 +1,8 @@
|
|||
#! ./miniruby
|
||||
#! ./miniruby -n
|
||||
|
||||
# Used when making Ruby to generate node_name.inc.
|
||||
# See common.mk for details.
|
||||
|
||||
while gets
|
||||
if ~/enum node_type \{/..~/^\};/
|
||||
~/(NODE_.+),/ and puts(" case #{$1}:\n\treturn \"#{$1}\";")
|
||||
end
|
||||
if (t ||= /^enum node_type \{/ =~ $_) and (t = /^\};/ !~ $_)
|
||||
/(NODE_.+),/ =~ $_ and puts(" case #{$1}:\n\treturn \"#{$1}\";")
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue