develooper Front page | perl.cvs.parrot | Postings from November 2008

[svn:parrot] r32588 - trunk/languages/forth

From:
coke
Date:
November 12, 2008 20:25
Subject:
[svn:parrot] r32588 - trunk/languages/forth
Message ID:
20081113042545.C1DE7CB9AF@x12.develooper.com
Author: coke
Date: Wed Nov 12 20:25:45 2008
New Revision: 32588

Modified:
   trunk/languages/forth/forth.pir
   trunk/languages/forth/words.pir

Log:
can't use .return instead of tailcall; use of bareword method names is [DEPRECATED]


Modified: trunk/languages/forth/forth.pir
==============================================================================
--- trunk/languages/forth/forth.pir	(original)
+++ trunk/languages/forth/forth.pir	Wed Nov 12 20:25:45 2008
@@ -87,7 +87,7 @@
     stream = new 'TokenStream', input
     stack  = new 'VirtualStack'
 
-    code.emit(<<"END_PIR")
+    code.'emit'(<<"END_PIR")
 .sub code :anon
     .local pmc stack
     stack = get_hll_global " stack"
@@ -103,15 +103,15 @@
     goto next_token
 
 done:
-    $S0 = stack.consolidate_to_cstack()
+    $S0 = stack.'consolidate_to_cstack'()
     code .= $S0
-    code.emit(<<"END_PIR")
+    code.'emit'(<<"END_PIR")
     .return(stack)
 .end
 END_PIR
 
     $P0 = compreg "PIR"
-    .return $P0(code)
+    .tailcall $P0(code)
 .end
 
 .sub ' dispatch'
@@ -139,16 +139,16 @@
     .return()
 
 user_word:
-    $S1 = stack.consolidate_to_cstack()
+    $S1 = stack.'consolidate_to_cstack'()
     code .= $S1
     $S0 = dict[$S0]
-    code.emit("    '%0'(stack)", $S0)
+    code.'emit'("    '%0'(stack)", $S0)
     .return()
 
 user_var:
     $I0 = vars[$S0]
-    $S0 = code.unique('$P')
-    code.emit(<<'END_PIR', $S0, $I0)
+    $S0 = code.'unique'('$P')
+    code.'emit'(<<'END_PIR', $S0, $I0)
     %0 = new 'Integer'
     %0 = %1
 END_PIR
@@ -163,8 +163,8 @@
     throw $P0
 
 numeric:
-    $S0 = code.unique('$P')
-    code.emit(<<"END_PIR", $S0, token)
+    $S0 = code.'unique'('$P')
+    code.'emit'(<<"END_PIR", $S0, token)
     %0 = new 'Integer'
     %0 = %1
 END_PIR

Modified: trunk/languages/forth/words.pir
==============================================================================
--- trunk/languages/forth/words.pir	(original)
+++ trunk/languages/forth/words.pir	Wed Nov 12 20:25:45 2008
@@ -36,8 +36,8 @@
     nword  = new 'CodeString'
 
     subname = ' ' . name
-    subname = nword.unique(subname)
-    nword.emit(<<"END_PIR", subname)
+    subname = nword.'unique'(subname)
+    nword.'emit'(<<"END_PIR", subname)
 .sub '%0'
     .param pmc stack
 END_PIR
@@ -53,9 +53,9 @@
     goto loop
 
 done:
-    $S0 = nstack.consolidate_to_cstack()
+    $S0 = nstack.'consolidate_to_cstack'()
     nword .= $S0
-    nword.emit(<<"END_PIR")
+    nword.'emit'(<<"END_PIR")
     .return()
 .end
 END_PIR
@@ -74,7 +74,7 @@
     .param pmc stack
 
     $S0 = pop stack
-    code.emit(<<"END_PIR", $S0)
+    code.'emit'(<<"END_PIR", $S0)
     $P0 = %0
     print $P0
     print " "
@@ -91,7 +91,7 @@
 
     if stack goto compiletime
 
-    code.emit(<<"END_PIR")
+    code.'emit'(<<"END_PIR")
     print "<"
     $I0 = elements stack
     print $I0
@@ -107,9 +107,9 @@
     $I0 = elements stack
     $S0 = $I0
     $S1 = join "\nprint ' '\nprint ", stack
-    $S2 = code.unique('empty')
+    $S2 = code.'unique'('empty')
 
-    code.emit(<<"END_PIR", $S0, $S1, $S2)
+    code.'emit'(<<"END_PIR", $S0, $S1, $S2)
     print "<"
     $I0 = elements stack
     $I1 = $I0 + %0
@@ -140,9 +140,9 @@
     goto loop
 done:
 
-    $S0 = code.unique('loop')
-    $S1 = code.unique('done')
-    code.emit(<<"END_PIR", $S0, $S1)
+    $S0 = code.'unique'('loop')
+    $S1 = code.'unique'('done')
+    code.'emit'(<<"END_PIR", $S0, $S1)
 %0:
     unless stack goto %1
     $S0 = pop stack
@@ -157,9 +157,9 @@
     .param pmc stream
     .param pmc stack
 
-    $S0 = stream.remove_upto('"')
-    $S0 = code.escape($S0)
-    code.emit("print %0", $S0)
+    $S0 = stream.'remove_upto'('"')
+    $S0 = code.'escape'($S0)
+    code.'emit'("print %0", $S0)
 
     .return()
 .end
@@ -172,7 +172,7 @@
 
     if stack goto compiletime
 
-    code.emit('$P0 = pop stack')
+    code.'emit'('$P0 = pop stack')
     .return()
 
 compiletime:
@@ -186,7 +186,7 @@
     .param pmc stream
     .param pmc stack
 
-    code.emit(<<'END_PIR')
+    code.'emit'(<<'END_PIR')
     $P0 = stack[-2]
     push stack, $P0
 END_PIR
@@ -200,7 +200,7 @@
     .param pmc stream
     .param pmc stack
 
-    code.emit(<<'END_PIR')
+    code.'emit'(<<'END_PIR')
     $P0 = pop stack
     $P1 = pop stack
     push stack, $P0
@@ -218,7 +218,7 @@
 
     if stack goto compiletime
 
-    code.emit(<<'END_PIR')
+    code.'emit'(<<'END_PIR')
     $P0 = stack[-1]
     push stack, $P0
 END_PIR
@@ -242,11 +242,11 @@
     b = pop stack
     a = pop stack
 
-    $S0 = code.unique("$P")
-    $S1 = code.unique("$P")
-    $S2 = code.unique("$P")
+    $S0 = code.'unique'("$P")
+    $S1 = code.'unique'("$P")
+    $S2 = code.'unique'("$P")
 
-    code.emit(<<"END_PIR", a, b, c, $S0, $S1, $S2)
+    code.'emit'(<<"END_PIR", a, b, c, $S0, $S1, $S2)
     %3 = %0
     %4 = %1
     %5 = %2
@@ -263,12 +263,12 @@
     .param pmc stream
     .param pmc stack
 
-    $S0 = stack.consolidate_to_cstack()
+    $S0 = stack.'consolidate_to_cstack'()
     code .= $S0
 
     .local string label
-    label = code.unique('loop')
-    code.emit(<<"END_PIR", label)
+    label = code.'unique'('loop')
+    code.'emit'(<<"END_PIR", label)
 %0:
 END_PIR
 
@@ -286,10 +286,10 @@
 
 until:
     $S1 = pop stack
-    $S2 = code.unique("$P")
-    $S0 = stack.consolidate_to_cstack()
+    $S2 = code.'unique'("$P")
+    $S0 = stack.'consolidate_to_cstack'()
     code .= $S0
-    code.emit(<<"END_PIR", label, $S1, $S2)
+    code.'emit'(<<"END_PIR", label, $S1, $S2)
     %2 = %1
     unless %2 goto %0
 END_PIR
@@ -307,13 +307,13 @@
     .param pmc stack
 
     $S4 = pop stack
-    $S1 = code.unique('$P')
-    $S2 = code.unique('else')
-    $S3 = code.unique('done')
+    $S1 = code.'unique'('$P')
+    $S2 = code.'unique'('else')
+    $S3 = code.'unique'('done')
 
-    $S0 = stack.consolidate_to_cstack()
+    $S0 = stack.'consolidate_to_cstack'()
     code .= $S0
-    code.emit(<<"END_PIR", $S4, $S1, $S2, $S3)
+    code.'emit'(<<"END_PIR", $S4, $S1, $S2, $S3)
     %1 = %0
     unless %1 goto %2
 END_PIR
@@ -331,9 +331,9 @@
     goto if_loop
 
 else:
-    $S0 = stack.consolidate_to_cstack()
+    $S0 = stack.'consolidate_to_cstack'()
     code .= $S0
-    code.emit(<<"END_PIR", $S2, $S3)
+    code.'emit'(<<"END_PIR", $S2, $S3)
     goto %1
 %0:
 END_PIR
@@ -349,10 +349,10 @@
     goto else_loop
 
 if_done:
-    code.emit("%0:", $S2)
+    code.'emit'("%0:", $S2)
 done:
-    code.emit("%0:", $S3)
-    $S0 = stack.consolidate_to_cstack()
+    code.'emit'("%0:", $S3)
+    $S0 = stack.'consolidate_to_cstack'()
     code .= $S0
     .return()
 
@@ -367,7 +367,7 @@
     .param pmc stream
     .param pmc stack
 
-    code.emit('print "\n"')
+    code.'emit'('print "\n"')
 
     .return()
 .end
@@ -380,9 +380,9 @@
 
     .local string a
     a   = pop stack
-    $S0 = code.unique("$P")
+    $S0 = code.'unique'("$P")
 
-    code.emit(<<"END_PIR", a, $S0)
+    code.'emit'(<<"END_PIR", a, $S0)
     $I0 = %0
     $I0 = islt $I0, 0
     %1  = new 'Integer'
@@ -402,11 +402,11 @@
     .local string a, b
     b = pop stack
     a = pop stack
-    $S0 = code.unique("$P")
-    $S1 = code.unique("$P")
-    $S2 = code.unique("$P")
+    $S0 = code.'unique'("$P")
+    $S1 = code.'unique'("$P")
+    $S2 = code.'unique'("$P")
 
-    code.emit(<<"END_PIR", b, a, $S0, $S1, $S2)
+    code.'emit'(<<"END_PIR", b, a, $S0, $S1, $S2)
     %2 = %0
     %3 = %1
     %4 = new 'Float'
@@ -426,11 +426,11 @@
     .local string a, b
     b = pop stack
     a = pop stack
-    $S0 = code.unique("$P")
-    $S1 = code.unique("$P")
-    $S2 = code.unique("$P")
+    $S0 = code.'unique'("$P")
+    $S1 = code.'unique'("$P")
+    $S2 = code.'unique'("$P")
 
-    code.emit(<<"END_PIR", b, a, $S0, $S1, $S2)
+    code.'emit'(<<"END_PIR", b, a, $S0, $S1, $S2)
     %2 = %0
     %3 = %1
     %4 = new 'Float'



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About