This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move PL_multi_end into the PL_parser struct
authorDave Mitchell <davem@fdisolutions.com>
Mon, 21 May 2007 21:02:50 +0000 (21:02 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Mon, 21 May 2007 21:02:50 +0000 (21:02 +0000)
p4raw-id: //depot/perl@31254

embedvar.h
intrpvar.h
op.c
parser.h
perlapi.h
sv.c
toke.c

index 1272bfc..b02de5e 100644 (file)
 #define PL_minus_p             (vTHX->Iminus_p)
 #define PL_modcount            (vTHX->Imodcount)
 #define PL_modglobal           (vTHX->Imodglobal)
-#define PL_multi_end           (vTHX->Imulti_end)
 #define PL_my_cxt_keys         (vTHX->Imy_cxt_keys)
 #define PL_my_cxt_list         (vTHX->Imy_cxt_list)
 #define PL_my_cxt_size         (vTHX->Imy_cxt_size)
 #define PL_Iminus_p            PL_minus_p
 #define PL_Imodcount           PL_modcount
 #define PL_Imodglobal          PL_modglobal
-#define PL_Imulti_end          PL_multi_end
 #define PL_Imy_cxt_keys                PL_my_cxt_keys
 #define PL_Imy_cxt_list                PL_my_cxt_list
 #define PL_Imy_cxt_size                PL_my_cxt_size
index 77e455f..20e1c97 100644 (file)
@@ -655,8 +655,6 @@ PERLVARI(Irehash_seed, UV, 0)               /* 582 hash initializer */
 PERLVARI(Idumper_fd, int, -1)
 #endif
 
-PERLVAR(Imulti_end,    I32)            /* last line of multi-line string */
-
 #ifdef PERL_IMPLICIT_CONTEXT
 PERLVARI(Imy_cxt_size, int, 0)         /* size of PL_my_cxt_list */
 PERLVARI(Imy_cxt_list, void **, NULL) /* per-module array of MY_CXT pointers */
diff --git a/op.c b/op.c
index ba5e200..5445e31 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3494,8 +3494,8 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg)
        OP *curop;
        if (pm->op_pmflags & PMf_EVAL) {
            curop = NULL;
-           if (CopLINE(PL_curcop) < (line_t)PL_multi_end)
-               CopLINE_set(PL_curcop, (line_t)PL_multi_end);
+           if (CopLINE(PL_curcop) < (line_t)PL_parser->multi_end)
+               CopLINE_set(PL_curcop, (line_t)PL_parser->multi_end);
        }
        else if (repl->op_type == OP_CONST)
            curop = repl;
index 271d35a..7e42c80 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -55,10 +55,12 @@ typedef struct yy_parser {
     I32                lex_starts;     /* how many interps done on level */
     SV         *lex_stuff;     /* runtime pattern from m// or s/// */
     I32                multi_start;    /* 1st line of multi-line string */
+    I32                multi_end;      /* last line of multi-line string */
     char       multi_open;     /* delimiter of said string */
     char       multi_close;    /* delimiter of said string */
     char       pending_ident;  /* pending identifier lookup */
     bool       preambled;
+    /* XXX I32 space */
     SUBLEXINFO sublex_info;
     SV         *linestr;       /* current chunk of src text */
     char       *bufptr;        
index a45571c..4585f5e 100644 (file)
--- a/perlapi.h
+++ b/perlapi.h
@@ -448,8 +448,6 @@ END_EXTERN_C
 #define PL_modcount            (*Perl_Imodcount_ptr(aTHX))
 #undef  PL_modglobal
 #define PL_modglobal           (*Perl_Imodglobal_ptr(aTHX))
-#undef  PL_multi_end
-#define PL_multi_end           (*Perl_Imulti_end_ptr(aTHX))
 #undef  PL_my_cxt_keys
 #define PL_my_cxt_keys         (*Perl_Imy_cxt_keys_ptr(aTHX))
 #undef  PL_my_cxt_list
diff --git a/sv.c b/sv.c
index c614632..d1d6702 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -9572,6 +9572,7 @@ Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
     parser->multi_close        = proto->multi_close;
     parser->multi_open = proto->multi_open;
     parser->multi_start        = proto->multi_start;
+    parser->multi_end  = proto->multi_end;
     parser->pending_ident = proto->pending_ident;
     parser->preambled  = proto->preambled;
     parser->sublex_info        = proto->sublex_info; /* XXX not quite right */
@@ -11266,8 +11267,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
 
     PL_parser          = parser_dup(proto_perl->Iparser, param);
 
-    PL_multi_end       = proto_perl->Imulti_end;
-
     PL_error_count     = proto_perl->Ierror_count;
     PL_subline         = proto_perl->Isubline;
     PL_subname         = sv_dup_inc(proto_perl->Isubname, param);
diff --git a/toke.c b/toke.c
index ef1c6a5..f59372b 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -66,6 +66,7 @@
 #define PL_in_my               (PL_parser->in_my)
 #define PL_in_my_stash         (PL_parser->in_my_stash)
 #define PL_tokenbuf            (PL_parser->tokenbuf)
+#define PL_multi_end           (PL_parser->multi_end)
 
 #ifdef PERL_MAD
 #  define PL_endwhite          (PL_parser->endwhite)