diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-03-10 11:31:14 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-03-10 11:31:14 +0000 |
commit | c94115d8a8e2e3c3d1a5486519667eba8297650c (patch) | |
tree | 2d7ada8c3bde436c2ac5906827b454a32a0f3f7c /toke.c | |
parent | abbb319842d03cfdb615b06ae57e058d7e36b88c (diff) | |
download | perl-c94115d8a8e2e3c3d1a5486519667eba8297650c.tar.gz |
Summon constman! S_checkcomma now has all 3 arguments const char.
p4raw-id: //depot/perl@27459
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -10167,7 +10167,7 @@ unknown: } STATIC void -S_checkcomma(pTHX_ register char *s, const char *name, const char *what) +S_checkcomma(pTHX_ const char *s, const char *name, const char *what) { dVAR; const char *w; @@ -10201,17 +10201,12 @@ S_checkcomma(pTHX_ register char *s, const char *name, const char *what) while (s < PL_bufend && isSPACE(*s)) s++; if (*s == ',') { - I32 kw; - CV *cv; - *s = '\0'; /* XXX If we didn't do this, we could const a lot of toke.c */ - kw = keyword(w, s - w); - *s = ','; - if (kw) + GV* gv; + if (keyword(w, s - w)) return; - *s = '\0'; - cv = get_cv(w, FALSE); - *s = ','; - if (cv) + + gv = gv_fetchpvn_flags(w, s - w, 0, SVt_PVCV); + if (gv && GvCVu(gv)) return; Perl_croak(aTHX_ "No comma allowed after %s", what); } |