Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / perly.c
diff --git a/perly.c b/perly.c
index 739c347..b92de4e 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -4,6 +4,7 @@ static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91";
 #define YYBYACC 1
 #line 16 "perly.y"
 #include "EXTERN.h"
+#define PERL_IN_PERLY_C
 #include "perl.h"
 
 #define yydebug            PL_yydebug
@@ -13,20 +14,9 @@ static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91";
 #define yyval      PL_yyval
 #define yylval     PL_yylval
 
-#ifdef PERL_OBJECT
-static void
-Dep(CPerlObj *pPerl)
-{
-    pPerl->deprecate("\"do\" to call subroutines");
-}
-#define dep() Dep(this)
-#else
-static void
-dep(void)
-{
-    deprecate("\"do\" to call subroutines");
-}
-#endif
+#define dep() deprecate("\"do\" to call subroutines")
+
+static void yydestruct(pTHXo_ void *ptr);
 
 #line 30 "perly.y"
 #define YYERRCODE 256
@@ -1328,23 +1318,8 @@ struct ysv {
     YYSTYPE oldyylval;
 };
 
-void
-yydestruct(void *ptr)
-{
-    struct ysv* ysave = (struct ysv*)ptr;
-    if (ysave->yyss) Safefree(ysave->yyss);
-    if (ysave->yyvs) Safefree(ysave->yyvs);
-    yydebug    = ysave->oldyydebug;
-    yynerrs    = ysave->oldyynerrs;
-    yyerrflag  = ysave->oldyyerrflag;
-    yychar     = ysave->oldyychar;
-    yyval      = ysave->oldyyval;
-    yylval     = ysave->oldyylval;
-    Safefree(ysave);
-}
-
 int
-yyparse(void)
+Perl_yyparse(pTHX)
 {
     register int yym, yyn, yystate;
     register short *yyssp;
@@ -1801,7 +1776,7 @@ case 57:
 { STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv,n_a);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
                              || strEQ(name, "INIT"))
-                             CvUNIQUE_on(PL_compcv);
+                             CvSPECIAL_on(PL_compcv);
                          yyval.opval = yyvsp[0].opval; }
 break;
 case 58:
@@ -1826,7 +1801,7 @@ case 63:
 break;
 case 64:
 #line 330 "perly.y"
-{ CvUNIQUE_on(PL_compcv); /* It's a BEGIN {} */ }
+{ CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
 break;
 case 65:
 #line 332 "perly.y"
@@ -2396,3 +2371,24 @@ yyabort:
 yyaccept:
     return retval;
 }
+
+
+#ifdef PERL_OBJECT
+#define NO_XSLOCKS
+#include "XSUB.h"
+#endif
+
+static void
+yydestruct(pTHXo_ void *ptr)
+{
+    struct ysv* ysave = (struct ysv*)ptr;
+    if (ysave->yyss) Safefree(ysave->yyss);
+    if (ysave->yyvs) Safefree(ysave->yyvs);
+    yydebug    = ysave->oldyydebug;
+    yynerrs    = ysave->oldyynerrs;
+    yyerrflag  = ysave->oldyyerrflag;
+    yychar     = ysave->oldyychar;
+    yyval      = ysave->oldyyval;
+    yylval     = ysave->oldyylval;
+    Safefree(ysave);
+}