This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Too strict pattern for parsing group lists.
[perl5.git] / perly_c.diff
1 *** y.tab.c.orig        Thu Aug 26 22:31:26 1999
2 --- y.tab.c     Thu Aug 26 22:32:22 1999
3 ***************
4 *** 1447,1456 ****
5   yyparse()
6   {
7       register int yym, yyn, yystate;
8   #if YYDEBUG
9       register char *yys;
10 !     extern char *getenv();
11   
12       if (yys = getenv("YYDEBUG"))
13       {
14           yyn = *yys;
15 --- 1447,1473 ----
16   yyparse()
17   {
18       register int yym, yyn, yystate;
19 +     register short *yyssp;
20 +     register YYSTYPE *yyvsp;
21 +     short* yyss;
22 +     YYSTYPE* yyvs;
23 +     unsigned yystacksize = YYSTACKSIZE;
24 +     int retval = 0;
25   #if YYDEBUG
26       register char *yys;
27 ! #endif
28   
29 +     struct ysv *ysave;
30 +     New(73, ysave, 1, struct ysv);
31 +     SAVEDESTRUCTOR(yydestruct, ysave);
32 +     ysave->oldyydebug = yydebug;
33 +     ysave->oldyynerrs = yynerrs;
34 +     ysave->oldyyerrflag       = yyerrflag;
35 +     ysave->oldyychar  = yychar;
36 +     ysave->oldyyval   = yyval;
37 +     ysave->oldyylval  = yylval;
38 +   
39 + #if YYDEBUG
40       if (yys = getenv("YYDEBUG"))
41       {
42           yyn = *yys;
43 ***************
44 *** 1463,1468 ****
45 --- 1480,1495 ----
46       yyerrflag = 0;
47       yychar = (-1);
48   
49 +     /*
50 +     ** Initialize private stacks (yyparse may be called from an action)
51 +     */
52 +     New(73, yyss, yystacksize, short);
53 +     New(73, yyvs, yystacksize, YYSTYPE);
54 +     ysave->yyss = yyss;
55 +     ysave->yyvs = yyvs;
56 +     if (!yyvs || !yyss)
57 +       goto yyoverflow;
58
59       yyssp = yyss;
60       yyvsp = yyvs;
61       *yyssp = yystate = 0;
62 ***************
63 *** 1493,1499 ****
64   #endif
65           if (yyssp >= yyss + yystacksize - 1)
66           {
67 !             goto yyoverflow;
68           }
69           *++yyssp = yystate = yytable[yyn];
70           *++yyvsp = yylval;
71 --- 1520,1538 ----
72   #endif
73           if (yyssp >= yyss + yystacksize - 1)
74           {
75 !           /*
76 !           ** reallocate and recover.  Note that pointers
77 !           ** have to be reset, or bad things will happen
78 !           */
79 !           int yyps_index = (yyssp - yyss);
80 !           int yypv_index = (yyvsp - yyvs);
81 !           yystacksize += YYSTACKSIZE;
82 !           ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
83 !           ysave->yyss = Renew(yyss, yystacksize, short);
84 !           if (!yyvs || !yyss)
85 !               goto yyoverflow;
86 !           yyssp = yyss + yyps_index;
87 !           yyvsp = yyvs + yypv_index;
88           }
89           *++yyssp = yystate = yytable[yyn];
90           *++yyvsp = yylval;
91 ***************
92 *** 1534,1540 ****
93   #endif
94                   if (yyssp >= yyss + yystacksize - 1)
95                   {
96 !                     goto yyoverflow;
97                   }
98                   *++yyssp = yystate = yytable[yyn];
99                   *++yyvsp = yylval;
100 --- 1573,1591 ----
101   #endif
102                   if (yyssp >= yyss + yystacksize - 1)
103                   {
104 !                   /*
105 !                   ** reallocate and recover.  Note that pointers
106 !                   ** have to be reset, or bad things will happen
107 !                   */
108 !                   int yyps_index = (yyssp - yyss);
109 !                   int yypv_index = (yyvsp - yyvs);
110 !                   yystacksize += YYSTACKSIZE;
111 !                   ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
112 !                   ysave->yyss = Renew(yyss, yystacksize, short);
113 !                   if (!yyvs || !yyss)
114 !                       goto yyoverflow;
115 !                   yyssp = yyss + yyps_index;
116 !                   yyvsp = yyvs + yypv_index;
117                   }
118                   *++yyssp = yystate = yytable[yyn];
119                   *++yyvsp = yylval;
120 ***************
121 *** 2473,2487 ****
122   #endif
123       if (yyssp >= yyss + yystacksize - 1)
124       {
125 !         goto yyoverflow;
126       }
127       *++yyssp = yystate;
128       *++yyvsp = yyval;
129       goto yyloop;
130   yyoverflow:
131 !     yyerror("yacc stack overflow");
132   yyabort:
133 !     return (1);
134   yyaccept:
135 !     return (0);
136   }
137 --- 2524,2570 ----
138   #endif
139       if (yyssp >= yyss + yystacksize - 1)
140       {
141 !       /*
142 !       ** reallocate and recover.  Note that pointers
143 !       ** have to be reset, or bad things will happen
144 !       */
145 !       int yyps_index = (yyssp - yyss);
146 !       int yypv_index = (yyvsp - yyvs);
147 !       yystacksize += YYSTACKSIZE;
148 !       ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
149 !       ysave->yyss = Renew(yyss, yystacksize, short);
150 !       if (!yyvs || !yyss)
151 !           goto yyoverflow;
152 !       yyssp = yyss + yyps_index;
153 !       yyvsp = yyvs + yypv_index;
154       }
155       *++yyssp = yystate;
156       *++yyvsp = yyval;
157       goto yyloop;
158   yyoverflow:
159 !     yyerror("Out of memory for yacc stack");
160   yyabort:
161 !     retval = 1;
162   yyaccept:
163 !     return retval;
164 ! }
165
166 ! #ifdef PERL_OBJECT
167 ! #define NO_XSLOCKS
168 ! #include "XSUB.h"
169 ! #endif
170
171 ! static void
172 ! yydestruct(pTHXo_ void *ptr)
173 ! {
174 !     struct ysv* ysave = (struct ysv*)ptr;
175 !     if (ysave->yyss) Safefree(ysave->yyss);
176 !     if (ysave->yyvs) Safefree(ysave->yyvs);
177 !     yydebug   = ysave->oldyydebug;
178 !     yynerrs   = ysave->oldyynerrs;
179 !     yyerrflag = ysave->oldyyerrflag;
180 !     yychar    = ysave->oldyychar;
181 !     yyval     = ysave->oldyyval;
182 !     yylval    = ysave->oldyylval;
183 !     Safefree(ysave);
184   }