summaryrefslogtreecommitdiff
path: root/perly.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-08 18:47:35 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-08 18:47:35 +0000
commit51371543ca1a75ed152020ad0846b5b8cf11c32f (patch)
tree9bfd9a21697b0769e2681483631c742642dd8c45 /perly.c
parent4d61ec052de5c3a91dc64c80c032c2cbec44d845 (diff)
downloadperl-51371543ca1a75ed152020ad0846b5b8cf11c32f.tar.gz
more PERL_OBJECT cleanups (changes still untested on Unix!)
p4raw-id: //depot/perl@3660
Diffstat (limited to 'perly.c')
-rw-r--r--perly.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/perly.c b/perly.c
index 1a31506367..b92de4eb21 100644
--- a/perly.c
+++ b/perly.c
@@ -16,6 +16,8 @@ static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91";
#define dep() deprecate("\"do\" to call subroutines")
+static void yydestruct(pTHXo_ void *ptr);
+
#line 30 "perly.y"
#define YYERRCODE 256
static short yylhs[] = { -1,
@@ -1316,21 +1318,6 @@ struct ysv {
YYSTYPE oldyylval;
};
-void
-Perl_yydestruct(pTHX_ 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
Perl_yyparse(pTHX)
{
@@ -1350,7 +1337,7 @@ Perl_yyparse(pTHX)
struct ysv *ysave;
New(73, ysave, 1, struct ysv);
- SAVEDESTRUCTOR(Perl_yydestruct, ysave);
+ SAVEDESTRUCTOR(yydestruct, ysave);
ysave->oldyydebug = yydebug;
ysave->oldyynerrs = yynerrs;
ysave->oldyyerrflag = yyerrflag;
@@ -2384,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);
+}