From: Roca, Ignasi Date: Thu, 4 Jan 2001 12:47:10 +0000 (+0100) Subject: Corrections for Perl_yylex_r (used by a reentrant parser as Bison) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f202aeac388eea998f0f2557d17b594e2c9670d;p=p5sagit%2Fp5-mst-13.2.git Corrections for Perl_yylex_r (used by a reentrant parser as Bison) Message-ID: <5930DC161690D21196670090271575470370111A@madt009a.siemens.es> The toke.c part only, patching embed.h and proto.h is futile. p4raw-id: //depot/perl@8306 --- diff --git a/toke.c b/toke.c index 76707c1..a085c70 100644 --- a/toke.c +++ b/toke.c @@ -79,7 +79,7 @@ static I32 utf16rev_textfilter(pTHXo_ int idx, SV *sv, int maxlen); # endif YYSTYPE* yylval_pointer[YYMAXLEVEL]; int* yychar_pointer[YYMAXLEVEL]; -int yyactlevel = 0; +int yyactlevel = -1; # undef yylval # undef yychar # define yylval (*yylval_pointer[yyactlevel]) @@ -2068,9 +2068,9 @@ Perl_yylex_r(pTHX_ YYSTYPE *lvalp, int *lcharp) { int r; + yyactlevel++; yylval_pointer[yyactlevel] = lvalp; yychar_pointer[yyactlevel] = lcharp; - yyactlevel++; if (yyactlevel >= YYMAXLEVEL) Perl_croak(aTHX_ "panic: YYMAXLEVEL"); @@ -2085,13 +2085,8 @@ Perl_yylex_r(pTHX_ YYSTYPE *lvalp, int *lcharp) #ifdef __SC__ #pragma segment Perl_yylex #endif - int -#ifdef USE_PURE_BISON -Perl_yylex(pTHX_ YYSTYPE *lvalp, int *lcharp) -#else Perl_yylex(pTHX) -#endif { register char *s; register char *d;