Skip to content

Commit 55c4f67

Browse files
committed
Add a whole new lexer token type for block-taking list operators; use that instead of the custom hackery
1 parent 3e214b8 commit 55c4f67

File tree

11 files changed

+1549
-1560
lines changed

11 files changed

+1549
-1560
lines changed

embed.fnc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5897,7 +5897,8 @@ S |int |intuit_method |NN char *s \
58975897
|NULLOK NOCHECK CV *cv
58985898
S |int |intuit_more |NN char *s \
58995899
|NN char *e
5900-
S |I32 |lop |I32 f \
5900+
S |I32 |lop |enum yytokentype t \
5901+
|I32 f \
59015902
|U8 x \
59025903
|NN char *s
59035904
Sr |void |missingterm |NULLOK char *s \

embed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@
17001700
# define incline(a,b) S_incline(aTHX_ a,b)
17011701
# define intuit_method(a,b,c) S_intuit_method(aTHX_ a,b,c)
17021702
# define intuit_more(a,b) S_intuit_more(aTHX_ a,b)
1703-
# define lop(a,b,c) S_lop(aTHX_ a,b,c)
1703+
# define lop(a,b,c,d) S_lop(aTHX_ a,b,c,d)
17041704
# define missingterm(a,b) S_missingterm(aTHX_ a,b)
17051705
# define parse_ident(a,b,c,d,e,f) S_parse_ident(aTHX_ a,b,c,d,e,f)
17061706
# define pending_ident() S_pending_ident(aTHX)

op.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13238,24 +13238,6 @@ Perl_ck_grep(pTHX_ OP *o)
1323813238
Perl_croak(aTHX_ "panic: ck_grep, type=%u", (unsigned) kid->op_type);
1323913239
kid = kUNOP->op_first;
1324013240

13241-
switch(o->op_type) {
13242-
case OP_ANYSTART:
13243-
case OP_ALLSTART:
13244-
/* any { BLOCK } would create an OP_NULL[OP_SCOPE[...]] or
13245-
* OP_NULL[OP_LEAVE[...]] here. If we don't see this structure
13246-
* then it must have been any EXPR, ... which we forbid
13247-
* TODO: See if we can forbid this somehow in perly.y itself
13248-
*/
13249-
if(!OP_TYPE_IS(kid, OP_NULL) ||
13250-
!(OP_TYPE_IS(kUNOP->op_first, OP_SCOPE) || OP_TYPE_IS(kUNOP->op_first, OP_LEAVE))) {
13251-
/* diag_listed_as: any EXPR, LIST is not allowed */
13252-
/* diag_listed_as: all EXPR, LIST is not allowed */
13253-
croak("%s EXPR, LIST is not allowed",
13254-
o->op_type == OP_ANYSTART ? "any" : "all");
13255-
}
13256-
break;
13257-
}
13258-
1325913241
gwop = alloc_LOGOP(type, o, LINKLIST(kid));
1326013242
kid->op_next = (OP*)gwop;
1326113243
o->op_private = gwop->op_private = 0;

0 commit comments

Comments
 (0)