summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perly.act2
-rw-r--r--perly.h49
-rw-r--r--perly.tab92
-rw-r--r--perly.y4
-rw-r--r--toke.c3
5 files changed, 77 insertions, 73 deletions
diff --git a/perly.act b/perly.act
index 35d7119716..2a59215c80 100644
--- a/perly.act
+++ b/perly.act
@@ -2130,6 +2130,6 @@ case 2:
/* Generated from:
- * 4254f7a193750fc5d4d9a58ee880004d69cfaecdf245c298f9f6357f963e5f42 perly.y
+ * 6ae29de007d736f59463d634fd5d8ca5929a88e3038442ff8d802b6f1c8e602c perly.y
* acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl
* ex: set ro: */
diff --git a/perly.h b/perly.h
index 7fbcd2fb5b..8cea4a40dc 100644
--- a/perly.h
+++ b/perly.h
@@ -132,29 +132,30 @@ extern int yydebug;
ANDOP = 331,
NOTOP = 332,
ASSIGNOP = 333,
- PERLY_COLON = 334,
- OROR = 335,
- DORDOR = 336,
- ANDAND = 337,
- BITOROP = 338,
- BITANDOP = 339,
- CHEQOP = 340,
- NCEQOP = 341,
- CHRELOP = 342,
- NCRELOP = 343,
- SHIFTOP = 344,
- MATCHOP = 345,
- PERLY_EXCLAMATION_MARK = 346,
- PERLY_TILDE = 347,
- UMINUS = 348,
- REFGEN = 349,
- POWOP = 350,
- PREINC = 351,
- PREDEC = 352,
- POSTINC = 353,
- POSTDEC = 354,
- POSTJOIN = 355,
- ARROW = 356
+ PERLY_QUESTION_MARK = 334,
+ PERLY_COLON = 335,
+ OROR = 336,
+ DORDOR = 337,
+ ANDAND = 338,
+ BITOROP = 339,
+ BITANDOP = 340,
+ CHEQOP = 341,
+ NCEQOP = 342,
+ CHRELOP = 343,
+ NCRELOP = 344,
+ SHIFTOP = 345,
+ MATCHOP = 346,
+ PERLY_EXCLAMATION_MARK = 347,
+ PERLY_TILDE = 348,
+ UMINUS = 349,
+ REFGEN = 350,
+ POWOP = 351,
+ PREINC = 352,
+ PREDEC = 353,
+ POSTINC = 354,
+ POSTDEC = 355,
+ POSTJOIN = 356,
+ ARROW = 357
};
#endif
@@ -206,6 +207,6 @@ int yyparse (void);
/* Generated from:
- * 4254f7a193750fc5d4d9a58ee880004d69cfaecdf245c298f9f6357f963e5f42 perly.y
+ * 6ae29de007d736f59463d634fd5d8ca5929a88e3038442ff8d802b6f1c8e602c perly.y
* acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl
* ex: set ro: */
diff --git a/perly.tab b/perly.tab
index 50e2a9bf68..1298090830 100644
--- a/perly.tab
+++ b/perly.tab
@@ -18,7 +18,7 @@
#define YYNSTATES 573
#define YYUNDEFTOK 2
-#define YYMAXUTOK 356
+#define YYMAXUTOK 357
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
@@ -36,7 +36,7 @@ static const yytype_int8 yytranslate[] =
2, 2, 2, 2, 2, 2, 109, 13, 2, 2,
108, 107, 110, 11, 2, 10, 2, 111, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 83, 12, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 12, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -63,9 +63,9 @@ static const yytype_int8 yytranslate[] =
49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, 80, 81, 82, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 104, 105, 106
+ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106
};
#if YYDEBUG
@@ -123,27 +123,28 @@ static const char *const yytname[] =
"YADAYADA", "FUNC0", "FUNC1", "FUNC", "UNIOP", "LSTOP", "MULOP", "ADDOP",
"DOLSHARP", "DO", "HASHBRACK", "NOAMP", "LOCAL", "MY", "REQUIRE",
"COLONATTR", "FORMLBRACK", "FORMRBRACK", "SUBLEXSTART", "SUBLEXEND",
- "PREC_LOW", "OROP", "DOROP", "ANDOP", "NOTOP", "ASSIGNOP", "'?'",
- "PERLY_COLON", "OROR", "DORDOR", "ANDAND", "BITOROP", "BITANDOP",
- "CHEQOP", "NCEQOP", "CHRELOP", "NCRELOP", "SHIFTOP", "MATCHOP",
- "PERLY_EXCLAMATION_MARK", "PERLY_TILDE", "UMINUS", "REFGEN", "POWOP",
- "PREINC", "PREDEC", "POSTINC", "POSTDEC", "POSTJOIN", "ARROW", "')'",
- "'('", "'$'", "'*'", "'/'", "$accept", "grammar", "@1", "@2", "@3", "@4",
- "@5", "@6", "@7", "block", "formblock", "remember", "mblock",
- "mremember", "stmtseq", "formstmtseq", "fullstmt", "labfullstmt",
- "barestmt", "$@8", "$@9", "$@10", "$@11", "$@12", "@13", "$@14",
- "formline", "formarg", "condition", "sideff", "else", "cont", "mintro",
- "nexpr", "texpr", "iexpr", "mexpr", "mnexpr", "formname", "startsub",
- "startanonsub", "startformsub", "subname", "proto", "subattrlist",
- "myattrlist", "sigvarname", "sigslurpsigil", "sigslurpelem",
- "sigdefault", "sigscalarelem", "sigelem", "siglist", "siglistornull",
- "optsubsignature", "subsignature", "subsigguts", "$@15", "optsubbody",
- "subbody", "optsigsubbody", "sigsubbody", "expr", "listexpr", "listop",
- "@16", "method", "subscripted", "termbinop", "termrelop", "relopchain",
- "termeqop", "eqopchain", "termunop", "anonymous", "termdo", "term",
- "@17", "myattrterm", "myterm", "optlistexpr", "optexpr", "optrepl",
- "my_scalar", "my_var", "refgen_topic", "my_refgen", "amper", "scalar",
- "ary", "hsh", "arylen", "star", "sliceme", "kvslice", "gelem", "indirob", YY_NULLPTR
+ "PREC_LOW", "OROP", "DOROP", "ANDOP", "NOTOP", "ASSIGNOP",
+ "PERLY_QUESTION_MARK", "PERLY_COLON", "OROR", "DORDOR", "ANDAND",
+ "BITOROP", "BITANDOP", "CHEQOP", "NCEQOP", "CHRELOP", "NCRELOP",
+ "SHIFTOP", "MATCHOP", "PERLY_EXCLAMATION_MARK", "PERLY_TILDE", "UMINUS",
+ "REFGEN", "POWOP", "PREINC", "PREDEC", "POSTINC", "POSTDEC", "POSTJOIN",
+ "ARROW", "')'", "'('", "'$'", "'*'", "'/'", "$accept", "grammar", "@1",
+ "@2", "@3", "@4", "@5", "@6", "@7", "block", "formblock", "remember",
+ "mblock", "mremember", "stmtseq", "formstmtseq", "fullstmt",
+ "labfullstmt", "barestmt", "$@8", "$@9", "$@10", "$@11", "$@12", "@13",
+ "$@14", "formline", "formarg", "condition", "sideff", "else", "cont",
+ "mintro", "nexpr", "texpr", "iexpr", "mexpr", "mnexpr", "formname",
+ "startsub", "startanonsub", "startformsub", "subname", "proto",
+ "subattrlist", "myattrlist", "sigvarname", "sigslurpsigil",
+ "sigslurpelem", "sigdefault", "sigscalarelem", "sigelem", "siglist",
+ "siglistornull", "optsubsignature", "subsignature", "subsigguts", "$@15",
+ "optsubbody", "subbody", "optsigsubbody", "sigsubbody", "expr",
+ "listexpr", "listop", "@16", "method", "subscripted", "termbinop",
+ "termrelop", "relopchain", "termeqop", "eqopchain", "termunop",
+ "anonymous", "termdo", "term", "@17", "myattrterm", "myterm",
+ "optlistexpr", "optexpr", "optrepl", "my_scalar", "my_var",
+ "refgen_topic", "my_refgen", "amper", "scalar", "ary", "hsh", "arylen",
+ "star", "sliceme", "kvslice", "gelem", "indirob", YY_NULLPTR
};
#endif
@@ -160,9 +161,9 @@ static const yytype_int16 yytoknum[] =
301, 302, 303, 304, 305, 306, 307, 308, 309, 310,
311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
- 331, 332, 333, 63, 334, 335, 336, 337, 338, 339,
- 340, 341, 342, 343, 344, 345, 346, 347, 348, 349,
- 350, 351, 352, 353, 354, 355, 356, 41, 40, 36,
+ 331, 332, 333, 334, 335, 336, 337, 338, 339, 340,
+ 341, 342, 343, 344, 345, 346, 347, 348, 349, 350,
+ 351, 352, 353, 354, 355, 356, 357, 41, 40, 36,
42, 47
};
# endif
@@ -1177,30 +1178,31 @@ static const toketypes yy_type_tab[] =
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
- toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
+ toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
- toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
- toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_ival, toketype_opval,
- toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival,
- toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_ival, toketype_opval,
+ toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
+ toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_ival,
+ toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
+ toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_opval, toketype_ival,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
- toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval,
- toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
+ toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval
};
/* Generated from:
- * 4254f7a193750fc5d4d9a58ee880004d69cfaecdf245c298f9f6357f963e5f42 perly.y
+ * 6ae29de007d736f59463d634fd5d8ca5929a88e3038442ff8d802b6f1c8e602c perly.y
* acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl
* ex: set ro: */
diff --git a/perly.y b/perly.y
index b05536b23a..7f1158857e 100644
--- a/perly.y
+++ b/perly.y
@@ -102,7 +102,7 @@
%nonassoc LSTOP LSTOPSUB
%left PERLY_COMMA
%right <ival> ASSIGNOP
-%right <ival> '?' PERLY_COLON
+%right <ival> PERLY_QUESTION_MARK PERLY_COLON
%nonassoc DOTDOT
%left <ival> OROR DORDOR
%left <ival> ANDAND
@@ -1158,7 +1158,7 @@ term[product] : termbinop
| termunop
| anonymous
| termdo
- | term[condition] '?' term[then] PERLY_COLON term[else]
+ | term[condition] PERLY_QUESTION_MARK term[then] PERLY_COLON term[else]
{ $$ = newCONDOP(0, $condition, $then, $else); }
| REFGEN term[operand] /* \$x, \@y, \%z */
{ $$ = newUNOP(OP_REFGEN, 0, $operand); }
diff --git a/toke.c b/toke.c
index a0c9c47970..0535e8f9d0 100644
--- a/toke.c
+++ b/toke.c
@@ -396,6 +396,7 @@ static struct debug_tokens {
DEBUG_TOKEN (IVAL, PERLY_DOT),
DEBUG_TOKEN (IVAL, PERLY_EQUAL_SIGN),
DEBUG_TOKEN (IVAL, PERLY_EXCLAMATION_MARK),
+ DEBUG_TOKEN (IVAL, PERLY_QUESTION_MARK),
DEBUG_TOKEN (IVAL, PERLY_SEMICOLON),
DEBUG_TOKEN (IVAL, PERLY_TILDE),
{ PLUGEXPR, TOKENTYPE_OPVAL, "PLUGEXPR" },
@@ -8991,7 +8992,7 @@ yyl_try(pTHX_ char *s)
TOKEN(0);
}
PL_lex_allbrackets++;
- OPERATOR('?');
+ OPERATOR(PERLY_QUESTION_MARK);
case '.':
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack