Skip to content

Commit 6f04944

Browse files
committed
Implement PPC0027: Create all and any operators
As these only permit `any BLOCK LIST` and not the deferred-expression form like `grep EXPR, LIST`, we create a whole new token type, BLKLSTOP, to represent these. The parser then only accepts the block form and not the expression form when parsing these.
1 parent de4fe8b commit 6f04944

38 files changed

+2732
-2226
lines changed

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6256,6 +6256,7 @@ t/op/aassign.t test list assign
62566256
t/op/alarm.t See if alarm works
62576257
t/op/anonconst.t See if :const works
62586258
t/op/anonsub.t See if anonymous subroutines work
6259+
t/op/any_all.t See if feature 'any' and 'all' work
62596260
t/op/append.t See if . works
62606261
t/op/args.t See if operations on @_ work
62616262
t/op/arith2.t See if arithmetic works

embed.fnc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5957,7 +5957,8 @@ S |int |intuit_method |NN char *s \
59575957
|NULLOK NOCHECK CV *cv
59585958
S |int |intuit_more |NN char *s \
59595959
|NN char *e
5960-
S |I32 |lop |I32 f \
5960+
S |I32 |lop |enum yytokentype t \
5961+
|I32 f \
59615962
|U8 x \
59625963
|NN char *s
59635964
Sr |void |missingterm |NULLOK char *s \

embed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@
17151715
# define incline(a,b) S_incline(aTHX_ a,b)
17161716
# define intuit_method(a,b,c) S_intuit_method(aTHX_ a,b,c)
17171717
# define intuit_more(a,b) S_intuit_more(aTHX_ a,b)
1718-
# define lop(a,b,c) S_lop(aTHX_ a,b,c)
1718+
# define lop(a,b,c,d) S_lop(aTHX_ a,b,c,d)
17191719
# define missingterm(a,b) S_missingterm(aTHX_ a,b)
17201720
# define parse_ident(a,b,c,d,e,f) S_parse_ident(aTHX_ a,b,c,d,e,f)
17211721
# define pending_ident() S_pending_ident(aTHX)

ext/Opcode/Opcode.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package Opcode 1.66;
1+
package Opcode 1.67;
22

33
use strict;
44

@@ -377,6 +377,7 @@ used to implement a resource attack (e.g., consume all available CPU time).
377377
378378
grepstart grepwhile
379379
mapstart mapwhile
380+
anystart allstart anywhile
380381
enteriter iter
381382
enterloop leaveloop unstack
382383
last next redo

ext/Pod-Functions/t/Functions.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ Functions for real @ARRAYs:
9191
each, keys, pop, push, shift, splice, unshift, values
9292
9393
Functions for list data:
94-
grep, join, map, qw/STRING/, reverse, sort, unpack
94+
all, any, grep, join, map, qw/STRING/, reverse, sort,
95+
unpack
9596
9697
Functions for real %HASHes:
9798
delete, each, exists, keys, values

feature.h

Lines changed: 59 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ S_maybe_add_coresub(pTHX_ HV * const stash, GV *gv,
610610
case KEY___DATA__: case KEY___END__ :
611611
case KEY_ADJUST : case KEY_AUTOLOAD: case KEY_BEGIN : case KEY_CHECK :
612612
case KEY_DESTROY : case KEY_END : case KEY_INIT : case KEY_UNITCHECK:
613-
case KEY_and : case KEY_catch : case KEY_class :
613+
case KEY_all : case KEY_and : case KEY_any :
614+
case KEY_catch : case KEY_class :
614615
case KEY_continue: case KEY_cmp : case KEY_defer :
615616
case KEY_do : case KEY_dump : case KEY_else : case KEY_elsif :
616617
case KEY_eq : case KEY_eval : case KEY_field :

keywords.c

Lines changed: 23 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)