summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-01-11 15:34:05 -0500
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-06 16:01:36 +0000
commitcc6b73957505a73b130c87add7bf3d534f129041 (patch)
tree9eae2f71c172110fb9ec7dfb5f002ebb937fd46c /toke.c
parente5724059399517e049ad3e9429cfece6d66ce97f (diff)
downloadperl-cc6b73957505a73b130c87add7bf3d534f129041.tar.gz
5.004_56: Patch to Tie::Hash and docs
Date: Sun, 11 Jan 1998 20:34:05 -0500 (EST) Subject: 5.004_56: Patch to (?{}) quoting + cosmetic Date: Mon, 2 Feb 1998 01:28:46 -0500 (EST) p4raw-id: //depot/perl@470
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index 23174221d0..28c5a42c4c 100644
--- a/toke.c
+++ b/toke.c
@@ -802,9 +802,31 @@ scan_const(char *start)
s++;
}
}
- else if (*s == '(' && lex_inpat && s[1] == '?' && s[2] == '#') {
- while (s < send && *s != ')')
- *d++ = *s++;
+ else if (*s == '(' && lex_inpat && s[1] == '?') {
+ if (s[2] == '#') {
+ while (s < send && *s != ')')
+ *d++ = *s++;
+ } else if (s[2] == '{') { /* This should march regcomp.c */
+ I32 count = 1;
+ char *regparse = s + 3;
+ char c;
+
+ while (count && (c = *regparse)) {
+ if (c == '\\' && regparse[1])
+ regparse++;
+ else if (c == '{')
+ count++;
+ else if (c == '}')
+ count--;
+ regparse++;
+ }
+ if (*regparse == ')')
+ regparse++;
+ else
+ yyerror("Sequence (?{...}) not terminated or not {}-balanced");
+ while (s < regparse && *s != ')')
+ *d++ = *s++;
+ }
}
else if (*s == '#' && lex_inpat &&
((PMOP*)lex_inpat)->op_pmflags & PMf_EXTENDED) {