diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-01-11 15:34:05 -0500 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-06 16:01:36 +0000 |
commit | cc6b73957505a73b130c87add7bf3d534f129041 (patch) | |
tree | 9eae2f71c172110fb9ec7dfb5f002ebb937fd46c /toke.c | |
parent | e5724059399517e049ad3e9429cfece6d66ce97f (diff) | |
download | perl-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.c | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -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) { |