diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-04-21 19:05:08 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-04-21 19:05:08 +0000 |
commit | 651b5b28673befa3f36a39b00591c15d5b30cca2 (patch) | |
tree | a0b972c92157745dc69c47556215c9c238d1c9b7 | |
parent | 9f7da6d537556dbe72c14a7f3fb5896e5591eace (diff) | |
download | perl-651b5b28673befa3f36a39b00591c15d5b30cca2.tar.gz |
Several members of struct yy_parser can go on a diet. Some I32s were
actually only holding chars.
p4raw-id: //depot/perl@31015
-rw-r--r-- | intrpvar.h | 4 | ||||
-rw-r--r-- | op.c | 4 | ||||
-rw-r--r-- | parser.h | 12 | ||||
-rw-r--r-- | perl.h | 4 | ||||
-rw-r--r-- | toke.c | 10 |
5 files changed, 17 insertions, 17 deletions
diff --git a/intrpvar.h b/intrpvar.h index 781de8f70e..12a9084dd7 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -285,7 +285,7 @@ PERLVARI(Icshname, const char *, CSH) PERLVARI(Icshlen, I32, 0) #endif -PERLVAR(Ilex_state, U32) /* next token is determined */ +PERLVAR(Ilex_state, U8) /* next token is determined */ /* What we know when we're in LEX_KNOWNEXT state. */ #ifdef PERL_MAD @@ -302,7 +302,7 @@ PERLVAR(Ibufptr, char *) PERLVAR(Ioldbufptr, char *) PERLVAR(Ioldoldbufptr, char *) PERLVAR(Ibufend, char *) -PERLVARI(Iexpect,int, XSTATE) /* how to interpret ambiguous tokens */ +PERLVARI(Iexpect, U8, XSTATE) /* how to interpret ambiguous tokens */ PERLVAR(Imulti_end, I32) /* last line of multi-line string */ @@ -1817,7 +1817,7 @@ S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs, bool for_my) /* fake up C<use attributes $pkg,$rv,@attrs> */ ENTER; /* need to protect against side-effects of 'use' */ - SAVEINT(PL_expect); + SAVEI8(PL_expect); stashsv = stash ? newSVhek(HvNAME_HEK(stash)) : &PL_sv_no; #define ATTRSMODULE "attributes" @@ -3864,7 +3864,7 @@ Perl_vload_module(pTHX_ U32 flags, SV *name, SV *ver, va_list *args) { const line_t ocopline = PL_copline; COP * const ocurcop = PL_curcop; - const int oexpect = PL_expect; + const U8 oexpect = PL_expect; utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), veop, modname, imop); @@ -42,19 +42,19 @@ typedef struct yy_parser { I32 lex_casemods; /* casemod count */ char *lex_brackstack;/* what kind of brackets to pop */ char *lex_casestack; /* what kind of case mods in effect */ - U32 lex_defer; /* state after determined token */ - I32 lex_dojoin; /* doing an array interpolation */ - int lex_expect; /* expect after determined token */ + U8 lex_defer; /* state after determined token */ + bool lex_dojoin; /* doing an array interpolation */ + U8 lex_expect; /* expect after determined token */ I32 lex_formbrack; /* bracket count at outer format level */ OP *lex_inpat; /* in pattern $) and $| are special */ OP *lex_op; /* extra info to pass back on op */ SV *lex_repl; /* runtime replacement from s/// */ - I32 lex_inwhat; /* what kind of quoting are we in */ + U16 lex_inwhat; /* what kind of quoting are we in */ 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_open; /* delimiter of said string */ - I32 multi_close; /* delimiter of said string */ + char multi_open; /* delimiter of said string */ + char multi_close; /* delimiter of said string */ char pending_ident; /* pending identifier lookup */ bool preambled; SUBLEXINFO sublex_info; @@ -3278,8 +3278,8 @@ struct nexttoken { typedef struct _sublex_info SUBLEXINFO; struct _sublex_info { - I32 super_state; /* lexer state to save */ - I32 sub_inwhat; /* "lex_inwhat" to use */ + U8 super_state; /* lexer state to save */ + U16 sub_inwhat; /* "lex_inwhat" to use */ OP *sub_op; /* "lex_op" to use */ char *super_bufptr; /* PL_bufptr that was */ char *super_bufend; /* PL_bufend that was */ @@ -645,7 +645,7 @@ Perl_lex_start(pTHX_ SV *line) /* initialise lexer state */ - SAVEI32(PL_lex_state); + SAVEI8(PL_lex_state); #ifdef PERL_MAD if (PL_lex_state == LEX_KNOWNEXT) { I32 toke = parser->old_parser->lasttoke; @@ -678,7 +678,7 @@ Perl_lex_start(pTHX_ SV *line) SAVEPPTR(PL_linestart); SAVESPTR(PL_linestr); SAVEDESTRUCTOR_X(restore_rsfp, PL_rsfp); - SAVEINT(PL_expect); + SAVEI8(PL_expect); PL_copline = NOLINE; PL_lex_state = LEX_NORMAL; @@ -1658,13 +1658,13 @@ S_sublex_push(pTHX) ENTER; PL_lex_state = PL_sublex_info.super_state; - SAVEI32(PL_lex_dojoin); + SAVEBOOL(PL_lex_dojoin); SAVEI32(PL_lex_brackets); SAVEI32(PL_lex_casemods); SAVEI32(PL_lex_starts); - SAVEI32(PL_lex_state); + SAVEI8(PL_lex_state); SAVEVPTR(PL_lex_inpat); - SAVEI32(PL_lex_inwhat); + SAVEI8(PL_lex_inwhat); SAVECOPLINE(PL_curcop); SAVEPPTR(PL_bufptr); SAVEPPTR(PL_bufend); |