Author: jonathan
Date: Fri Jan 16 09:58:08 2009
New Revision: 35638
Added:
trunk/languages/perl6/src/classes/Submethod.pir (contents, props changed)
Modified:
trunk/languages/perl6/config/makefiles/root.in
trunk/languages/perl6/src/parser/actions.pm
Log:
[rakudo] Parse submethods and bless them into the Submethod class (also added here). Don't do the correct dispatch on them yet.
Modified: trunk/languages/perl6/config/makefiles/root.in
==============================================================================
--- trunk/languages/perl6/config/makefiles/root.in (original)
+++ trunk/languages/perl6/config/makefiles/root.in Fri Jan 16 09:58:08 2009
@@ -75,6 +75,7 @@
src/classes/Sub.pir \
src/classes/Regex.pir \
src/classes/Method.pir \
+ src/classes/Submethod.pir \
src/classes/Junction.pir \
src/classes/Failure.pir \
src/classes/Exception.pir \
Added: trunk/languages/perl6/src/classes/Submethod.pir
==============================================================================
--- (empty file)
+++ trunk/languages/perl6/src/classes/Submethod.pir Fri Jan 16 09:58:08 2009
@@ -0,0 +1,31 @@
+## $Id$
+
+=head1 TITLE
+
+Submethod - Perl 6 Submethod class
+
+=head1 DESCRIPTION
+
+This file sets up the Perl 6 C<Submethod> class, the class for submethods.
+
+=cut
+
+.namespace ['Submethod']
+
+.sub 'onload' :anon :load :init
+ .local pmc p6meta
+ p6meta = get_hll_global ['Perl6Object'], '$!P6META'
+ p6meta.'new_class'('Submethod', 'parent'=>'Routine')
+.end
+
+=over 4
+
+=back
+
+=cut
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Fri Jan 16 09:58:08 2009
@@ -883,7 +883,8 @@
set_block_type($past, 'Method');
}
elsif $key eq 'submethod' {
- $/.panic('submethod declarations not yet implemented');
+ $past := $($<method_def>);
+ set_block_type($past, 'Submethod');
}
$past.node($/);
if (+@($past[1])) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.