summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-04-21 19:05:08 +0000
committerNicholas Clark <nick@ccl4.org>2007-04-21 19:05:08 +0000
commit651b5b28673befa3f36a39b00591c15d5b30cca2 (patch)
treea0b972c92157745dc69c47556215c9c238d1c9b7
parent9f7da6d537556dbe72c14a7f3fb5896e5591eace (diff)
downloadperl-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.h4
-rw-r--r--op.c4
-rw-r--r--parser.h12
-rw-r--r--perl.h4
-rw-r--r--toke.c10
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 */
diff --git a/op.c b/op.c
index 5ebbe176fd..9e16fc83fc 100644
--- a/op.c
+++ b/op.c
@@ -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);
diff --git a/parser.h b/parser.h
index dd9f28ed23..da6d63bfa4 100644
--- a/parser.h
+++ b/parser.h
@@ -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;
diff --git a/perl.h b/perl.h
index 452b70de48..6d9488bb64 100644
--- a/perl.h
+++ b/perl.h
@@ -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 */
diff --git a/toke.c b/toke.c
index d5fbd0a4ca..12d91afa77 100644
--- a/toke.c
+++ b/toke.c
@@ -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);