Attachment "x" to
ticket [1178541fff]
added by
wielemaker
2005-04-07 21:42:01.
? README
? test
? test.pl
? x
Index: regc_lex.c
===================================================================
RCS file: /usr/local/cvsroot/pl/packages/xpce/src/rgx/regc_lex.c,v
retrieving revision 1.1
diff -u -w -r1.1 regc_lex.c
--- regc_lex.c 4 Apr 2005 14:50:06 -0000 1.1
+++ regc_lex.c 7 Apr 2005 14:37:12 -0000
@@ -283,11 +283,13 @@
/* remember flavor of last token */
v->lasttype = v->nexttype;
+#if 0 /* JW: moved to parsebranch() */
/* REG_BOSONLY */
if (v->nexttype == EMPTY && (v->cflags®_BOSONLY)) {
/* at start of a REG_BOSONLY RE */
RETV(SBEGIN, 0); /* same as \A */
}
+#endif
/* if we're nested and we've hit end, return to outer level */
if (v->savenow != NULL && ATEOS()) {
Index: regcomp.c
===================================================================
RCS file: /usr/local/cvsroot/pl/packages/xpce/src/rgx/regcomp.c,v
retrieving revision 1.2
diff -u -w -r1.2 regcomp.c
--- regcomp.c 7 Apr 2005 08:15:13 -0000 1.2
+++ regcomp.c 7 Apr 2005 14:37:13 -0000
@@ -678,6 +678,14 @@
seencontent = 0;
t = subre(v, '=', 0, left, right); /* op '=' is tentative */
NOERRN();
+
+ /* Insert a \A (SBEGIN) in each toplevel branch */
+ if ( stopper == EOS && !partial && (v->cflags®_BOSONLY)) {
+ newarc(v->nfa, '^', 0, lp, right);
+ newarc(v->nfa, '^', 1, lp, right);
+ seencontent = 1;
+ }
+
while (!SEE('|') && !SEE(stopper) && !SEE(EOS)) {
if (seencontent) { /* implicit concat operator */
lp = newstate(v->nfa);