summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
Diffstat (limited to 'tool')
-rwxr-xr-xtool/node_name.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/tool/node_name.rb b/tool/node_name.rb
index 5c67d7c..dc0584e 100755
--- a/tool/node_name.rb
+++ b/tool/node_name.rb
@@ -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