[svn:parrot] r35651 - trunk/languages/perl6/src/classes

[email protected]
Newsgroups perl.cvs.parrot
Message-ID <[email protected]>
Author: pmichaud
Date: Fri Jan 16 14:03:16 2009
New Revision: 35651

Modified:
   trunk/languages/perl6/src/classes/Grammar.pir

Log:
[rakudo]: Change Grammar.ACCEPTS to Grammar.parse.


Modified: trunk/languages/perl6/src/classes/Grammar.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Grammar.pir	(original)
+++ trunk/languages/perl6/src/classes/Grammar.pir	Fri Jan 16 14:03:16 2009
@@ -10,43 +10,31 @@
 
 =cut
 
-.namespace [ 'Grammar' ]
-
-
-=head1 SUBROUTINES
-
-=over 4
-
-=item onload()
-
-=cut
-
-.sub 'onload' :anon :init :load
+.sub '' :anon :init :load
     load_bytecode "PGE.pbc"
     .local pmc p6meta
     p6meta = get_hll_global ['Perl6Object'], '$!P6META'
     p6meta.'new_class'('Grammar', 'parent'=>'PGE::Grammar')
 .end
 
-=item PROTOOVERRIDES()
+=head2 Methods
 
-Tell C<P6object> that the ACCEPTS method overrides the one
-for protoobjects.
+=over
 
-=cut
+=item parse(string)
 
-.sub 'PROTOOVERRIDES' :method
-    .return ('new', 'ACCEPTS')
-.end
+Parse a string according to the TOP rule in the grammar.
 
+=cut
 
-=item ACCEPTS(topic)
+=item parse(topic)
 
 Invokes the TOP rule in the grammar on the given topic.
 
 =cut
 
-.sub 'ACCEPTS' :method
+.namespace ['Grammar']
+.sub 'parse' :method
     .param pmc topic
     .local pmc TOP
 
@@ -59,9 +47,6 @@
     match = TOP(topic, 'grammar' => $S0)
     $P0 = getinterp
     $P1 = $P0['lexpad';1]
-    unless null $P1 goto found_pad
-    $P1 = $P0['lexpad';2]
-found_pad:
     $P1['$/'] = match
     .return(match)
 
@@ -69,7 +54,6 @@
     'die'("The grammar has no TOP rule to invoke.")
 .end
 
-
 =back
 
 =cut
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.