Author: particle
Date: Wed Oct  5 21:08:11 2005
New Revision: 9365

Modified:
   trunk/languages/tcl/lib/builtins/incr.pir
Log:
modify tcl's 'incr' to use heredocs when generating pir

Modified: trunk/languages/tcl/lib/builtins/incr.pir
==============================================================================
--- trunk/languages/tcl/lib/builtins/incr.pir   (original)
+++ trunk/languages/tcl/lib/builtins/incr.pir   Wed Oct  5 21:08:11 2005
@@ -25,9 +25,13 @@
   (value_num,temp_code) = compiler(value,register_num)
   pir_code .= temp_code
   register_num = value_num + 1
-  pir_code .= ".local pmc read,set,number\nread=find_global \"_Tcl\", 
\"__read\"\n"
-  pir_code .= "number=find_global \"_Tcl\", \"__number\"\n"
-  pir_code .= "set=find_global \"_Tcl\", \"__set\"\n$P"
+  pir_code .= <<"END_PIR"
+.local pmc read, set, number
+read = find_global "_Tcl", "__read"
+number = find_global "_Tcl", "__number"
+set = find_global "_Tcl", "__set"
+END_PIR
+  pir_code .= "$P"
   $S0 = register_num
   pir_code .= $S0
   pir_code .= "=read($P"
@@ -62,9 +66,13 @@ got_increment:
   (value_num,temp_code) = compiler(value,register_num)
   pir_code .= temp_code
   register_num = value_num + 1
-  pir_code .= ".local pmc read,set,number\nread=find_global \"_Tcl\", 
\"__read\"\n"
-  pir_code .= "number=find_global \"_Tcl\", \"__number\"\n"
-  pir_code .= "set=find_global \"_Tcl\", \"__set\"\n$P"
+  pir_code .= <<"END_PIR"
+.local pmc read, set, number
+read = find_global "_Tcl", "__read"
+number = find_global "_Tcl", "__number"
+set = find_global "_Tcl", "__set"
+END_PIR
+  pir_code .= "$P"
   $S0 = register_num
   pir_code .= $S0
   pir_code .= "=read($P"

Reply via email to