summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-07-18 11:57:19 +0100
committerDavid Mitchell <davem@iabyn.com>2016-07-20 09:32:23 +0100
commit185c2e96081e0fd9b6c448a8db6ac4ca85ff1dd4 (patch)
treeca1ed4cb3a92ea9a9d65b577fc7dc44b5de44280 /perly.y
parent3a3625f0ae05ec93b90af756e460a7803fafd8a2 (diff)
downloadperl-185c2e96081e0fd9b6c448a8db6ac4ca85ff1dd4.tar.gz
rename "WORD" lexical token to "BAREWORD"
The enum value "WORD" can apparently clash with a enum value in windows headers. It used to be worked around in windows by #defining YYTOKENTYPE, which caused the enum yytokentype { ... WORD = ...; } in perly.h to be skipped, while still using the #define WORD ... which appears later in the same file. In bison 3.x, the auto-generated perl.h no longer includes the #defines, so this workaround no longer works. Instead, change the name of the token from "WORD" to "BAREWORD".
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y16
1 files changed, 8 insertions, 8 deletions
diff --git a/perly.y b/perly.y
index 489291a016..6eb4b23aad 100644
--- a/perly.y
+++ b/perly.y
@@ -47,7 +47,7 @@
%token <ival> '{' '}' '[' ']' '-' '+' '@' '%' '&' '=' '.'
-%token <opval> WORD METHOD FUNCMETH THING PMFUNC PRIVATEREF QWLIST
+%token <opval> BAREWORD METHOD FUNCMETH THING PMFUNC PRIVATEREF QWLIST
%token <opval> FUNC0OP FUNC0SUB UNIOPSUB LSTOPSUB
%token <opval> PLUGEXPR PLUGSTMT
%token <pval> LABEL
@@ -336,7 +336,7 @@ barestmt: PLUGSTMT
intro_my();
parser->parsed_sub = 1;
}
- | PACKAGE WORD WORD ';'
+ | PACKAGE BAREWORD BAREWORD ';'
{
package($3);
if ($2)
@@ -345,7 +345,7 @@ barestmt: PLUGSTMT
}
| USE startsub
{ CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
- WORD WORD optlistexpr ';'
+ BAREWORD BAREWORD optlistexpr ';'
{
SvREFCNT_inc_simple_void(PL_compcv);
utilize($1, $2, $4, $5, $6);
@@ -453,7 +453,7 @@ barestmt: PLUGSTMT
$$ = newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
(OP*)NULL, $1, $2, 0);
}
- | PACKAGE WORD WORD '{' remember
+ | PACKAGE BAREWORD BAREWORD '{' remember
{
package($3);
if ($2) {
@@ -581,7 +581,7 @@ mnexpr : nexpr
{ $$ = $1; intro_my(); }
;
-formname: WORD { $$ = $1; }
+formname: BAREWORD { $$ = $1; }
| /* NULL */ { $$ = (OP*)NULL; }
;
@@ -602,7 +602,7 @@ startformsub: /* NULL */ /* start a format subroutine scope */
;
/* Name of a subroutine - must be a bareword, could be special */
-subname : WORD
+subname : BAREWORD
| PRIVATEREF
;
@@ -1028,7 +1028,7 @@ term : termbinop
}
'(' listexpr optrepl ')'
{ $$ = pmruntime($1, $4, $5, 1, $<ival>2); }
- | WORD
+ | BAREWORD
| listop
| YADAYADA
{
@@ -1145,7 +1145,7 @@ gelem : star
;
/* Indirect objects */
-indirob : WORD
+indirob : BAREWORD
{ $$ = scalar($1); }
| scalar %prec PREC_LOW
{ $$ = scalar($1); }