[svn:parrot] r39566 - in trunk/docs: book pdds
coke at svn.parrot.org
coke at svn.parrot.org
Mon Jun 15 00:41:54 UTC 2009
Author: coke
Date: Mon Jun 15 00:41:52 2009
New Revision: 39566
URL: https://trac.parrot.org/parrot/changeset/39566
Log:
pass the t/examples/pod.t by TODO'ing or fixing some sample PIR code.
Modified:
trunk/docs/book/ch03_pir.pod
trunk/docs/pdds/pdd19_pir.pod
Modified: trunk/docs/book/ch03_pir.pod
==============================================================================
--- trunk/docs/book/ch03_pir.pod Sun Jun 14 23:16:06 2009 (r39565)
+++ trunk/docs/book/ch03_pir.pod Mon Jun 15 00:41:52 2009 (r39566)
@@ -1534,7 +1534,7 @@
(See TT #483)
-=begin PIR
+=begin PIR_TODO
.sub 'MyMethod' :method
$S0 = self # Already defined as "self"
@@ -1547,7 +1547,7 @@
say $S0
.end
-=end PIR
+=end PIR_TODO
This example defines two methods in the C<Foo> class. It calls one from the
main body of the subroutine and the other from within the first method:
Modified: trunk/docs/pdds/pdd19_pir.pod
==============================================================================
--- trunk/docs/pdds/pdd19_pir.pod Sun Jun 14 23:16:06 2009 (r39565)
+++ trunk/docs/pdds/pdd19_pir.pod Mon Jun 15 00:41:52 2009 (r39566)
@@ -1171,7 +1171,7 @@
The automatic name munging on C<.macro_local> variables allows for using
multiple macros, like so:
-=begin PIR
+=begin PIR_TODO
.macro foo(a)
.macro_local int $a
@@ -1186,7 +1186,7 @@
.bar("x")
.end
-=end PIR
+=end PIR_TODO
This will result in code for the parser as follows:
@@ -1221,20 +1221,24 @@
=begin PIR_FRAGMENT
+ .macro foo(b)
+ #...
+ .endm
+
.foo("x")
=end PIR_FRAGMENT
there will be two variables: C<b> and C<x>. When the macro is invoked twice:
-=begin PIR
+=begin PIR_TODO
.sub main
.foo("x")
.foo("y")
.end
-=end PIR
+=end PIR_TODO
the resulting code that is given to the parser will read as follows:
@@ -1267,13 +1271,12 @@
.param int b
.param int c
- .begin_return
- .set_return xy
- .end_return
-
+ # ...
+ .local pmc xy
+ .return(xy)
.end
-=end PIR
+=end PIR_INVALID
=head3 Subroutine Call
@@ -1375,7 +1378,7 @@
The syntax is very similar to subroutine calls. The call is done with
C<.meth_call> which must immediately be preceded by the C<.invocant>:
-=begin PIR_FRAGMENT
+=begin PIR_FRAGMENT_TODO
.local int x, y, z
.local pmc class, obj
@@ -1392,7 +1395,7 @@
.end_call
...
-=end PIR_FRAGMENT
+=end PIR_FRAGMENT_TODO
The return continuation is optional. The method can be a string
More information about the parrot-commits
mailing list