diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-22 04:22:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-22 04:22:01 +0000 |
commit | 14bda8d3c38113d32850e6f2169761d0a46fec10 (patch) | |
tree | dc9ac4c3d0307bfd6c5427f359070c433eb40e40 /template/vm.inc.tmpl | |
parent | 6dbfaa2ba036e983264f0dbea94f932974f94c4d (diff) | |
download | ruby-14bda8d3c38113d32850e6f2169761d0a46fec10.tar.gz |
tool/instruction.rb: move logics to templates
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template/vm.inc.tmpl')
-rw-r--r-- | template/vm.inc.tmpl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/template/vm.inc.tmpl b/template/vm.inc.tmpl index 11c6d1bcf5..14b6ba3f10 100644 --- a/template/vm.inc.tmpl +++ b/template/vm.inc.tmpl @@ -11,19 +11,23 @@ If you want to fix something, you must edit 'insns.def' */ -<%= -line = 15 -vm_body.gsub(/\n|__CURRENT_LINE__|__CURRENT_FILE__/){ - e = $& + +% line = _erbout.count("\n") + 1 +% @insns.each do |insn| +<% +line += 1 +make_insn_def(insn).split(/(__CURRENT_LINE__|__CURRENT_FILE__)/).each {|e| + %><%= case e when '__CURRENT_LINE__' line.to_s when '__CURRENT_FILE__' "vm.inc" else - line += 1 + line += e.count("\n") e end + %><% } %> - +% end |