cvsuser 04/11/21 07:05:11
Modified: compilers/p6ge p6ge_gen.c
Log:
Added some comments about group generation.
Revision Changes Path
1.6 +7 -1 parrot/compilers/p6ge/p6ge_gen.c
Index: p6ge_gen.c
===================================================================
RCS file: /cvs/public/parrot/compilers/p6ge/p6ge_gen.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- p6ge_gen.c 21 Nov 2004 02:16:30 -0000 1.5
+++ p6ge_gen.c 21 Nov 2004 15:05:11 -0000 1.6
@@ -262,7 +262,9 @@
/* otherwise, we have work to do */
- /* set the repeat hash */
+ /* GROUP: initialization
+ /* This first part sets up the initial structures for a repeating group.
+ /* We need a repeat count and (possibly) a captures hash. */
emit(" classoffset $I0, match, \"P6GEMatch\"\n");
emit(" $I0 += 3\n");
emit(" getattribute gr_rep, match, $I0\n");
@@ -287,6 +289,10 @@
emit(" gr_rep[%s] = $P1\n", key);
emit(" goto fail\n\n");
+ /* GROUP: repeat code
+ /* This code is called whenever we reach the end of the group's
+ /* subexpression. It handles closing any outstanding capture, and
+ /* repeats the group if the quantifier requires it. */
emit("%s:\n", repsub);
emit(" classoffset $I0, match, \"P6GEMatch\"\n");
emit(" $I0 += 3\n");