[svn:parrot] r46545 - trunk/compilers/pct/src/POST

pmichaud at svn.parrot.org pmichaud at svn.parrot.org
Wed May 12 22:35:56 UTC 2010


Author: pmichaud
Date: Wed May 12 22:35:56 2010
New Revision: 46545
URL: https://trac.parrot.org/parrot/changeset/46545

Log:
[pct]:  Switch POST::Compiler to use PAST::Compiler.escape instead of CodeString

Modified:
   trunk/compilers/pct/src/POST/Compiler.pir

Modified: trunk/compilers/pct/src/POST/Compiler.pir
==============================================================================
--- trunk/compilers/pct/src/POST/Compiler.pir	Wed May 12 22:35:49 2010	(r46544)
+++ trunk/compilers/pct/src/POST/Compiler.pir	Wed May 12 22:35:56 2010	(r46545)
@@ -33,6 +33,22 @@
 .end
 
 
+=item C<escape(string str)>
+
+Returns an escaped value of C<str> suitable for including in PIR.
+If the string contains any non-ASCII characters, then it's
+prefixed with 'unicode:'.  (This method just delegates to
+PAST::Compiler.escape, which does the same thing.)
+
+=cut
+
+.sub 'escape' :method
+    .param pmc str
+    $P0 = get_hll_global ['PAST'], 'Compiler'
+    .tailcall $P0.'escape'(str)
+.end
+
+
 .sub 'to_pir' :method
     .param pmc post
     .param pmc adverbs         :slurpy :named
@@ -248,7 +264,7 @@
     if null outerpost goto pirflags_done
     unless outerpost goto pirflags_done
     outername = outerpost.'subid'()
-    $S0 = subpir.'escape'(outername)
+    $S0 = self.'escape'(outername)
     pirflags = concat pirflags, ' :outer('
     concat pirflags, $S0
     concat pirflags, ')'
@@ -291,11 +307,11 @@
 
   subpir_post:
     unless hll goto subpir_ns
-    $P0 = subpir.'escape'(hll)
+    $P0 = self.'escape'(hll)
     subpir.'emit'("\n.HLL %0", $P0)
   subpir_ns:
     subpir.'emit'("\n.namespace %0", nskey)
-    $S0 = subpir.'escape'(name)
+    $S0 = self.'escape'(name)
     subpir.'emit'(".sub %0 %1", $S0, pirflags)
     .local pmc paramlist
     paramlist = node['paramlist']


More information about the parrot-commits mailing list