summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-01-31 11:28:34 +0100
committerH.Merijn Brand <h.m.brand@xs4all.nl>2007-01-31 09:51:48 +0000
commit57b84237ab396aa1e1efe3b629c2b636d4869d93 (patch)
tree016f82272df0f514b151fb27817812a5dfbd3b71 /regcomp.c
parent6bf2040610392df602020bede2ff438921b1b7f5 (diff)
downloadperl-57b84237ab396aa1e1efe3b629c2b636d4869d93.tar.gz
regcomp.c: remove some gotos that cause compiler consternation.
Date: Wed, 31 Jan 2007 10:28:34 +0100 p4raw-id: //depot/perl@30083
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/regcomp.c b/regcomp.c
index 18f432b8ea..ec79ceda5c 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5075,8 +5075,10 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
nextchar(pRExC_state);
return ret;
}
- goto unknown;
- case '<': /* (?<...) */
+ RExC_parse++;
+ vFAIL3("Sequence (%.*s...) not recognized", RExC_parse-seqstart, seqstart);
+ /*NOTREACHED*/
+ case '<': /* (?<...) */
if (*RExC_parse == '!')
paren = ',';
else if (*RExC_parse != '=')
@@ -5091,8 +5093,11 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
SIZE_ONLY ? /* reverse test from the others */
REG_RSN_RETURN_NAME :
REG_RSN_RETURN_NULL);
- if (RExC_parse == name_start)
- goto unknown;
+ if (RExC_parse == name_start) {
+ RExC_parse++;
+ vFAIL3("Sequence (%.*s...) not recognized", RExC_parse-seqstart, seqstart);
+ /*NOTREACHED*/
+ }
if (*RExC_parse != paren)
vFAIL2("Sequence (?%c... not terminated",
paren=='>' ? '<' : paren);
@@ -5261,8 +5266,11 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
/* FALL THROUGH*/
case '?': /* (??...) */
is_logical = 1;
- if (*RExC_parse != '{')
- goto unknown;
+ if (*RExC_parse != '{') {
+ RExC_parse++;
+ vFAIL3("Sequence (%.*s...) not recognized", RExC_parse-seqstart, seqstart);
+ /*NOTREACHED*/
+ }
paren = *RExC_parse++;
/* FALL THROUGH */
case '{': /* (?{...}) */
@@ -5508,8 +5516,11 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
}
break;
case '-':
- if (flagsp == &negflags)
- goto unknown;
+ if (flagsp == &negflags) {
+ RExC_parse++;
+ vFAIL3("Sequence (%.*s...) not recognized", RExC_parse-seqstart, seqstart);
+ /*NOTREACHED*/
+ }
flagsp = &negflags;
wastedflags = 0; /* reset so (?g-c) warns twice */
break;
@@ -5529,7 +5540,6 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
}
/*NOTREACHED*/
default:
- unknown:
RExC_parse++;
vFAIL3("Sequence (%.*s...) not recognized", RExC_parse-seqstart, seqstart);
/*NOTREACHED*/