summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@scalpel.netlabs.com>1995-11-21 10:01:00 +1200
committerLarry <lwall@scalpel.netlabs.com>1995-11-21 10:01:00 +1200
commit4633a7c4bad06b471d9310620b7fe8ddd158cccd (patch)
tree37ebeb26a64f123784fd8fac6243b124767243b0 /regcomp.c
parent8e07c86ebc651fe92eb7e3b25f801f57cfb8dd6f (diff)
downloadperl-4633a7c4bad06b471d9310620b7fe8ddd158cccd.tar.gz
5.002 beta 1
If you're adventurous, have a look at ftp://ftp.sems.com/pub/outgoing/perl5.0/perl5.002beta1.tar.gz Many thanks to Andy for doing the integration. Obviously, if you consult the bugs database, you'll note there are still plenty of buglets that need fixing, and several enhancements that I've intended to put in still haven't made it in (Hi, Tim and Ilya). But I think it'll be pretty stable. And you can start to fiddle around with prototypes (which are, of course, still totally undocumented). Packrats, don't worry too much about readvertising this widely. Nowadays we're on a T1 here, so our bandwidth is okay. Have the appropriate amount of jollity. Larry
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/regcomp.c b/regcomp.c
index 409d03d3b2..d120eb7bdf 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -499,7 +499,7 @@ I32 *flagp;
}
/* Check for proper termination. */
- if (paren && *nextchar() != ')') {
+ if (paren && (regparse >= regxend || *nextchar() != ')')) {
FAIL("unmatched () in regexp");
} else if (!paren && regparse < regxend) {
if (*regparse == ')') {
@@ -868,6 +868,15 @@ tryagain:
goto defchar;
}
break;
+
+ case '#':
+ if (regflags & PMf_EXTENDED) {
+ while (regparse < regxend && *regparse != '\n') regparse++;
+ if (regparse < regxend)
+ goto tryagain;
+ }
+ /* FALL THROUGH */
+
default: {
register I32 len;
register char ender;
@@ -965,6 +974,11 @@ tryagain:
break;
}
break;
+ case '#':
+ if (regflags & PMf_EXTENDED) {
+ while (p < regxend && *p != '\n') p++;
+ }
+ /* FALL THROUGH */
case ' ': case '\t': case '\n': case '\r': case '\f': case '\v':
if (regflags & PMf_EXTENDED) {
p++;
@@ -1159,16 +1173,16 @@ nextchar()
{
char* retval = regparse++;
- if (regflags & PMf_EXTENDED) {
- for (;;) {
- if (isSPACE(*regparse)) {
+ for (;;) {
+ if (*regparse == '(' && regparse[1] == '?' &&
+ regparse[2] == '#') {
+ while (*regparse && *regparse != ')')
regparse++;
- continue;
- }
- else if (*regparse == '(' && regparse[1] == '?' &&
- regparse[2] == '#') {
- while (*regparse && *regparse != ')')
- regparse++;
+ regparse++;
+ continue;
+ }
+ if (regflags & PMf_EXTENDED) {
+ if (isSPACE(*regparse)) {
regparse++;
continue;
}
@@ -1178,10 +1192,9 @@ nextchar()
regparse++;
continue;
}
- break;
}
+ return retval;
}
- return retval;
}
/*