summaryrefslogtreecommitdiff
path: root/parser.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-27 09:18:29 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-27 23:24:01 -0700
commitd794b5224fb01fd9fb94ed555497ebfea2aa1c96 (patch)
treed1e802f70aa768b349b3b62214332fe11f235a2f /parser.h
parent4dc843bcb987cdd0350fd58f9ea65fb4f26f2283 (diff)
downloadperl-d794b5224fb01fd9fb94ed555497ebfea2aa1c96.tar.gz
Add PL_parser->lex_shared struct; move herelines into it
PL_parser->herelines needs to be visible to inner lexing scopes, which also need to have their own copy of it, so that the here-doc parser can modify the right herelines variable corresponding to the PL_linestr from which it is stealing its body. (A subsequent commit will take take of that.)
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/parser.h b/parser.h
index cdcf0b1ee3..0e5a8e37a9 100644
--- a/parser.h
+++ b/parser.h
@@ -21,6 +21,13 @@ typedef struct {
#endif
} yy_stack_frame;
+/* Fields that need to be shared with (i.e., visible to) inner lex-
+ ing scopes. */
+typedef struct yy_lexshared {
+ struct yy_lexshared *ls_prev;
+ line_t herelines; /* number of lines in here-doc */
+} LEXSHARED;
+
typedef struct yy_parser {
/* parser state */
@@ -63,6 +70,7 @@ typedef struct yy_parser {
bool preambled;
I32 lex_allbrackets;/* (), [], {}, ?: bracket count */
SUBLEXINFO sublex_info;
+ LEXSHARED *lex_shared;
SV *linestr; /* current chunk of src text */
char *bufptr; /* carries the cursor (current parsing
position) from one invocation of yylex
@@ -108,7 +116,6 @@ typedef struct yy_parser {
COP *saved_curcop; /* the previous PL_curcop */
char tokenbuf[256];
- line_t herelines; /* number of lines in here-doc */
U8 lex_fakeeof; /* precedence at which to fake EOF */
U8 lex_flags;
PERL_BITFIELD16 in_pod:1; /* lexer is within a =pod section */