summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/helpers
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-25 14:09:10 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-25 14:09:10 +0000
commit0a5b4c13ad16bacfa5659f7ac92eb7abf9416261 (patch)
treea50901558bb6bf4831411235c990c14d4abd4c02 /tool/ruby_vm/helpers
parent24b57b102c1992b679f8f8c0fd1a0239289a129b (diff)
vm.inc now in C99
This changeset modifies the VM generator so that vm.inc is written in C99. Also added some comments in _insn_entry.erb so that the intention of each parts to be made more clear. I think this improves overall readability of the generated VM. Confirmed that the exact same binary is generated before/after this changeset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm/helpers')
-rw-r--r--tool/ruby_vm/helpers/dumper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/ruby_vm/helpers/dumper.rb b/tool/ruby_vm/helpers/dumper.rb
index c0a45b19e2..00c301c01c 100644
--- a/tool/ruby_vm/helpers/dumper.rb
+++ b/tool/ruby_vm/helpers/dumper.rb
@@ -49,8 +49,8 @@ class RubyVM::Dumper
end
def replace_pragma_line str, lineno
- if str == "#pragma RubyVM reset source\n" then
- return "#line #{lineno + 2} #{@file}\n"
+ if /#(\s*)pragma RubyVM reset source\n/ =~ str then
+ return "##{$1}line #{lineno + 2} #{@file}\n"
else
return str
end