summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-01 23:57:04 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-01 23:57:04 +0000
commit9c708baa2de1db5eb3541459385967c9b6a8dbd4 (patch)
treeafc7a1724250a16887613cd510519d5600cebad0 /template
parent1ccf555a707324facc28f8a8f075c5e23a0a359d (diff)
* eval_intern.h, yarvcore.h: move declaration of sysstack_error
to yarvcore.h. * iseq.c: fix symbol name (:toplevel -> :top). * lib/vm/instruction.rb, template/vm.inc.tmpl: replacable current file name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r--template/vm.inc.tmpl18
1 files changed, 9 insertions, 9 deletions
diff --git a/template/vm.inc.tmpl b/template/vm.inc.tmpl
index 8b49beb114..f79de9785a 100644
--- a/template/vm.inc.tmpl
+++ b/template/vm.inc.tmpl
@@ -12,17 +12,17 @@
*/
<%=
-ret = ''
-offset = 15
-line_no = 0
-vm_body.each_line{|line|
- if line =~ /^\#line __CURRENT_LINE__/
- ret << line.sub(/__CURRENT_LINE__/, "#{line_no+offset}")
+line = 15
+vm_body.gsub(/\n|__CURRENT_LINE__|__CURRENT_FILE__/){|e|
+ case e
+ when '__CURRENT_LINE__'
+ line.to_s
+ when '__CURRENT_FILE__'
+ "vm.inc"
else
- ret <<line
+ line += 1
+ e
end
- line_no += 1
}
-ret
%>