From cd80cda9a1e25d7a1278f9d1c7db8ab94384c124 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 18 Nov 2024 15:40:50 +1100 Subject: [PATCH] Revert "switch removal: remove given/when/break/continue" This reverts commit dff5181acc0f5386556522c0ae4e59f672162f6e. --- MANIFEST | 2 + cop.h | 28 +- dump.c | 2 + embed.fnc | 18 + embed.h | 10 + ext/Opcode/Opcode.pm | 5 +- gv.c | 6 +- inline.h | 46 + keywords.c | 136 ++- keywords.h | 480 ++++---- lib/B/Deparse-core.t | 9 +- lib/B/Deparse.pm | 34 +- lib/B/Deparse.t | 57 +- lib/B/Op_private.pm | 4 + op.c | 215 +++- opcode.h | 44 +- opnames.h | 400 +++---- perl.h | 2 + perly.act | 1075 +++++++++--------- perly.h | 183 +-- perly.tab | 2508 +++++++++++++++++++++--------------------- perly.y | 12 + pod/perldiag.pod | 47 + pod/perlguts.pod | 2 + pod/perlsyn.pod | 444 +++++++- pp_ctl.c | 227 +++- pp_proto.h | 6 + proto.h | 52 + regen/keywords.pl | 8 + regen/opcodes | 7 + sv.c | 5 + t/lib/croak/pp_ctl | 11 +- t/lib/feature/switch | 142 +++ t/op/coreamp.t | 26 +- t/op/coresubs.t | 6 +- t/op/cproto.t | 7 +- t/op/state.t | 14 +- t/op/switch.t | 1384 +++++++++++++++++++++++ t/op/taint.t | 28 +- toke.c | 35 +- 40 files changed, 5354 insertions(+), 2373 deletions(-) create mode 100644 t/lib/feature/switch create mode 100644 t/op/switch.t diff --git a/MANIFEST b/MANIFEST index a8e85831de5a..8a267c6a1ee2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -6131,6 +6131,7 @@ t/lib/feature/multidimensional Tests for enabling/disabling $foo{$x, $y} => $fo t/lib/feature/nonesuch Tests for enabling/disabling nonexistent feature t/lib/feature/removed Tests for enabling/disabling removed feature t/lib/feature/say Tests for enabling/disabling say feature +t/lib/feature/switch Tests for enabling/disabling switch feature t/lib/h2ph.h Test header file for h2ph t/lib/h2ph.pht Generated output from h2ph.h by h2ph, for comparison t/lib/locale/latin1 Part of locale.t in Latin 1 @@ -6456,6 +6457,7 @@ t/op/substr_thr.t See if substr works in another thread t/op/svflags.t See if POK is set as expected. t/op/svleak.pl Test file for svleak.t t/op/svleak.t See if stuff leaks SVs +t/op/switch.t See if switches (given/when) work t/op/symbolcache.t See if undef/delete works on stashes with functions t/op/sysio.t See if sysread and syswrite work t/op/taint.t See if tainting works diff --git a/cop.h b/cop.h index 58d079a3b7fc..1d85a08cb348 100644 --- a/cop.h +++ b/cop.h @@ -1127,21 +1127,27 @@ struct context { and a static array of context names in pp_ctl.c */ #define CXTYPEMASK 0xf #define CXt_NULL 0 /* currently only used for sort BLOCK */ -#define CXt_BLOCK 1 +#define CXt_WHEN 1 +#define CXt_BLOCK 2 +/* When micro-optimising :-) keep GIVEN next to the LOOPs, as these 5 share a + jump table in pp_ctl.c + The first 4 don't have a 'case' in at least one switch statement in pp_ctl.c +*/ +#define CXt_GIVEN 3 /* be careful of the ordering of these five. Macros like CxTYPE_is_LOOP, * CxFOREACH compare ranges */ -#define CXt_LOOP_ARY 2 /* for (@ary) { ...; } */ -#define CXt_LOOP_LAZYSV 3 /* for ('a'..'z') { ...; } */ -#define CXt_LOOP_LAZYIV 4 /* for (1..9) { ...; } */ -#define CXt_LOOP_LIST 5 /* for (1,2,3) { ...; } */ -#define CXt_LOOP_PLAIN 6 /* while (...) { ...; } +#define CXt_LOOP_ARY 4 /* for (@ary) { ...; } */ +#define CXt_LOOP_LAZYSV 5 /* for ('a'..'z') { ...; } */ +#define CXt_LOOP_LAZYIV 6 /* for (1..9) { ...; } */ +#define CXt_LOOP_LIST 7 /* for (1,2,3) { ...; } */ +#define CXt_LOOP_PLAIN 8 /* while (...) { ...; } or plain block { ...; } */ -#define CXt_SUB 7 -#define CXt_FORMAT 8 -#define CXt_EVAL 9 /* eval'', eval{}, try{} */ -#define CXt_SUBST 10 -#define CXt_DEFER 11 +#define CXt_SUB 9 +#define CXt_FORMAT 10 +#define CXt_EVAL 11 /* eval'', eval{}, try{} */ +#define CXt_SUBST 12 +#define CXt_DEFER 13 /* SUBST doesn't feature in all switch statements. */ /* private flags for CXt_SUB and CXt_FORMAT */ diff --git a/dump.c b/dump.c index cad3e2b884c8..41d9549b3ab8 100644 --- a/dump.c +++ b/dump.c @@ -1448,6 +1448,8 @@ S_do_op_dump_bar(pTHX_ I32 level, UV bar, PerlIO *file, const OP *o) case OP_DORASSIGN: case OP_ANDASSIGN: case OP_ARGDEFELEM: + case OP_ENTERGIVEN: + case OP_ENTERWHEN: case OP_ENTERTRY: case OP_ONCE: S_opdump_indent(aTHX_ o, level, bar, file, "OTHER"); diff --git a/embed.fnc b/embed.fnc index e243842764b0..68b0fa37319c 100644 --- a/embed.fnc +++ b/embed.fnc @@ -2213,6 +2213,9 @@ ARdp |OP * |newFOROP |I32 flags \ |NN OP *expr \ |NULLOK OP *block \ |NULLOK OP *cont +ARdp |OP * |newGIVENOP |NN OP *cond \ + |NN OP *block \ + |PADOFFSET defsv_off : Used in scope.c eopx |GP * |newGP |NN GV * const gv Adm |GV * |newGVgen |NN const char *pack @@ -2357,6 +2360,8 @@ ERXopx |char * |new_warnings_bitfield \ |NULLOK char *buffer \ |NN const char * const bits \ |STRLEN size +ARdp |OP * |newWHENOP |NULLOK OP *cond \ + |NN OP *block ARdp |OP * |newWHILEOP |I32 flags \ |I32 debuggable \ |NULLOK LOOP *loop \ @@ -4861,6 +4866,7 @@ RST |bool |is_handle_constructor \ Ti |bool |is_standard_filehandle_name \ |NN const char *fhname S |OP * |listkids |NULLOK OP *o +S |bool |looks_like_bool|NN const OP *o S |OP * |modkids |NULLOK OP *o \ |I32 type S |void |move_proto_attr|NN OP **proto \ @@ -4870,6 +4876,11 @@ S |void |move_proto_attr|NN OP **proto \ S |OP * |my_kid |NULLOK OP *o \ |NULLOK OP *attrs \ |NN OP **imopsp +S |OP * |newGIVWHENOP |NULLOK OP *cond \ + |NN OP *block \ + |I32 enter_opcode \ + |I32 leave_opcode \ + |PADOFFSET entertarg RS |OP * |new_logop |I32 type \ |I32 flags \ |NN OP **firstp \ @@ -5087,12 +5098,14 @@ RS |OP * |dofindlabel |NN OP *o \ |NN OP **oplimit S |MAGIC *|doparseform |NN SV *sv RS |I32 |dopoptoeval |I32 startingblock +RS |I32 |dopoptogivenfor|I32 startingblock RS |I32 |dopoptolabel |NN const char *label \ |STRLEN len \ |U32 flags RS |I32 |dopoptoloop |I32 startingblock RS |I32 |dopoptosub_at |NN const PERL_CONTEXT *cxstk \ |I32 startingblock +RS |I32 |dopoptowhen |I32 startingblock S |OP * |do_smartmatch |NULLOK HV *seen_this \ |NULLOK HV *seen_other \ |const bool copied @@ -6204,11 +6217,13 @@ CTp |Malloc_t|mem_log_realloc \ Cipx |void |cx_popblock |NN PERL_CONTEXT *cx Cipx |void |cx_popeval |NN PERL_CONTEXT *cx Cipx |void |cx_popformat |NN PERL_CONTEXT *cx +Cipx |void |cx_popgiven |NN PERL_CONTEXT *cx Cipx |void |cx_poploop |NN PERL_CONTEXT *cx Cipx |void |cx_popsub |NN PERL_CONTEXT *cx Cipx |void |cx_popsub_args |NN PERL_CONTEXT *cx Cipx |void |cx_popsub_common \ |NN PERL_CONTEXT *cx +Cipx |void |cx_popwhen |NN PERL_CONTEXT *cx Cipx |PERL_CONTEXT *|cx_pushblock \ |U8 type \ |U8 gimme \ @@ -6221,6 +6236,8 @@ Cipx |void |cx_pushformat |NN PERL_CONTEXT *cx \ |NN CV *cv \ |NULLOK OP *retop \ |NULLOK GV *gv +Cipx |void |cx_pushgiven |NN PERL_CONTEXT *cx \ + |NULLOK SV *orig_defsv Cipx |void |cx_pushloop_for|NN PERL_CONTEXT *cx \ |NN void *itervarp \ |NULLOK SV *itersave @@ -6232,6 +6249,7 @@ Cipx |void |cx_pushsub |NN PERL_CONTEXT *cx \ |bool hasargs Cipx |void |cx_pushtry |NN PERL_CONTEXT *cx \ |NULLOK OP *retop +Cipx |void |cx_pushwhen |NN PERL_CONTEXT *cx Cipx |void |cx_topblock |NN PERL_CONTEXT *cx Cipx |U8 |gimme_V #endif /* !defined(PERL_NO_INLINE_FUNCTIONS) */ diff --git a/embed.h b/embed.h index b71a11813630..b528b18e9904 100644 --- a/embed.h +++ b/embed.h @@ -425,6 +425,7 @@ # define newDEFSVOP() Perl_newDEFSVOP(aTHX) # define newFORM(a,b,c) Perl_newFORM(aTHX_ a,b,c) # define newFOROP(a,b,c,d,e) Perl_newFOROP(aTHX_ a,b,c,d,e) +# define newGIVENOP(a,b,c) Perl_newGIVENOP(aTHX_ a,b,c) # define newGVOP(a,b,c) Perl_newGVOP(aTHX_ a,b,c) # define newGVREF(a,b) Perl_newGVREF(aTHX_ a,b) # define newGVgen_flags(a,b) Perl_newGVgen_flags(aTHX_ a,b) @@ -480,6 +481,7 @@ # define newTRYCATCHOP(a,b,c,d) Perl_newTRYCATCHOP(aTHX_ a,b,c,d) # define newUNOP(a,b,c) Perl_newUNOP(aTHX_ a,b,c) # define newUNOP_AUX(a,b,c,d) Perl_newUNOP_AUX(aTHX_ a,b,c,d) +# define newWHENOP(a,b) Perl_newWHENOP(aTHX_ a,b) # define newWHILEOP(a,b,c,d,e,f,g) Perl_newWHILEOP(aTHX_ a,b,c,d,e,f,g) # define newXS(a,b,c) Perl_newXS(aTHX_ a,b,c) # define newXS_flags(a,b,c,d,e) Perl_newXS_flags(aTHX_ a,b,c,d,e) @@ -1546,9 +1548,11 @@ # define is_handle_constructor S_is_handle_constructor # define is_standard_filehandle_name S_is_standard_filehandle_name # define listkids(a) S_listkids(aTHX_ a) +# define looks_like_bool(a) S_looks_like_bool(aTHX_ a) # define modkids(a,b) S_modkids(aTHX_ a,b) # define move_proto_attr(a,b,c,d) S_move_proto_attr(aTHX_ a,b,c,d) # define my_kid(a,b,c) S_my_kid(aTHX_ a,b,c) +# define newGIVWHENOP(a,b,c,d,e) S_newGIVWHENOP(aTHX_ a,b,c,d,e) # define newMETHOP_internal(a,b,c,d) S_newMETHOP_internal(aTHX_ a,b,c,d) # define new_logop(a,b,c,d) S_new_logop(aTHX_ a,b,c,d) # define no_fh_allowed(a) S_no_fh_allowed(aTHX_ a) @@ -1640,9 +1644,11 @@ # define dofindlabel(a,b,c,d,e,f) S_dofindlabel(aTHX_ a,b,c,d,e,f) # define doparseform(a) S_doparseform(aTHX_ a) # define dopoptoeval(a) S_dopoptoeval(aTHX_ a) +# define dopoptogivenfor(a) S_dopoptogivenfor(aTHX_ a) # define dopoptolabel(a,b,c) S_dopoptolabel(aTHX_ a,b,c) # define dopoptoloop(a) S_dopoptoloop(aTHX_ a) # define dopoptosub_at(a,b) S_dopoptosub_at(aTHX_ a,b) +# define dopoptowhen(a) S_dopoptowhen(aTHX_ a) # define make_matcher(a) S_make_matcher(aTHX_ a) # define matcher_matches_sv(a,b) S_matcher_matches_sv(aTHX_ a,b) # define num_overflow S_num_overflow @@ -2229,17 +2235,21 @@ # define cx_popblock(a) Perl_cx_popblock(aTHX_ a) # define cx_popeval(a) Perl_cx_popeval(aTHX_ a) # define cx_popformat(a) Perl_cx_popformat(aTHX_ a) +# define cx_popgiven(a) Perl_cx_popgiven(aTHX_ a) # define cx_poploop(a) Perl_cx_poploop(aTHX_ a) # define cx_popsub(a) Perl_cx_popsub(aTHX_ a) # define cx_popsub_args(a) Perl_cx_popsub_args(aTHX_ a) # define cx_popsub_common(a) Perl_cx_popsub_common(aTHX_ a) +# define cx_popwhen(a) Perl_cx_popwhen(aTHX_ a) # define cx_pushblock(a,b,c,d) Perl_cx_pushblock(aTHX_ a,b,c,d) # define cx_pusheval(a,b,c) Perl_cx_pusheval(aTHX_ a,b,c) # define cx_pushformat(a,b,c,d) Perl_cx_pushformat(aTHX_ a,b,c,d) +# define cx_pushgiven(a,b) Perl_cx_pushgiven(aTHX_ a,b) # define cx_pushloop_for(a,b,c) Perl_cx_pushloop_for(aTHX_ a,b,c) # define cx_pushloop_plain(a) Perl_cx_pushloop_plain(aTHX_ a) # define cx_pushsub(a,b,c,d) Perl_cx_pushsub(aTHX_ a,b,c,d) # define cx_pushtry(a,b) Perl_cx_pushtry(aTHX_ a,b) +# define cx_pushwhen(a) Perl_cx_pushwhen(aTHX_ a) # define cx_topblock(a) Perl_cx_topblock(aTHX_ a) # define gimme_V() Perl_gimme_V(aTHX) # endif /* !defined(PERL_NO_INLINE_FUNCTIONS) */ diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index 7ad39a89f5bf..0bab44788aae 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -1,4 +1,4 @@ -package Opcode 1.68; +package Opcode 1.69; use strict; @@ -436,6 +436,9 @@ These are a hotchpotch of opcodes still waiting to be considered entertry leavetry -- can be used to 'hide' fatal errors entertrycatch poptry catch leavetrycatch -- similar + entergiven leavegiven + enterwhen leavewhen + break continue smartmatch pushdefer diff --git a/gv.c b/gv.c index 6e72aa3b7985..f76a56c56e32 100644 --- a/gv.c +++ b/gv.c @@ -612,12 +612,12 @@ S_maybe_add_coresub(pTHX_ HV * const stash, GV *gv, case KEY_DESTROY : case KEY_END : case KEY_INIT : case KEY_UNITCHECK: case KEY_all : case KEY_and : case KEY_any : case KEY_catch : case KEY_class : - case KEY_continue: case KEY_cmp : case KEY_defer : + case KEY_cmp : case KEY_default : case KEY_defer : case KEY_do : case KEY_dump : case KEY_else : case KEY_elsif : case KEY_eq : case KEY_eval : case KEY_field : case KEY_finally: case KEY_for : case KEY_foreach: case KEY_format: case KEY_ge : - case KEY_goto : case KEY_grep : case KEY_gt : + case KEY_given : case KEY_goto : case KEY_grep : case KEY_gt : case KEY_if : case KEY_isa : case KEY_last : case KEY_le : case KEY_local : case KEY_lt : case KEY_m : @@ -630,7 +630,7 @@ S_maybe_add_coresub(pTHX_ HV * const stash, GV *gv, case KEY_state: case KEY_sub : case KEY_tr : case KEY_try : case KEY_unless: - case KEY_until: case KEY_use : case KEY_while : + case KEY_until: case KEY_use : case KEY_when : case KEY_while : case KEY_x : case KEY_xor : case KEY_y : return NULL; case KEY_chomp: case KEY_chop: case KEY_defined: case KEY_delete: diff --git a/inline.h b/inline.h index 0bac2329a888..732f3a5d41b7 100644 --- a/inline.h +++ b/inline.h @@ -3791,6 +3791,52 @@ Perl_cx_poploop(pTHX_ PERL_CONTEXT *cx) } +PERL_STATIC_INLINE void +Perl_cx_pushwhen(pTHX_ PERL_CONTEXT *cx) +{ + PERL_ARGS_ASSERT_CX_PUSHWHEN; + + cx->blk_givwhen.leave_op = cLOGOP->op_other; +} + + +PERL_STATIC_INLINE void +Perl_cx_popwhen(pTHX_ PERL_CONTEXT *cx) +{ + PERL_ARGS_ASSERT_CX_POPWHEN; + assert(CxTYPE(cx) == CXt_WHEN); + + PERL_UNUSED_ARG(cx); + PERL_UNUSED_CONTEXT; + /* currently NOOP */ +} + + +PERL_STATIC_INLINE void +Perl_cx_pushgiven(pTHX_ PERL_CONTEXT *cx, SV *orig_defsv) +{ + PERL_ARGS_ASSERT_CX_PUSHGIVEN; + + cx->blk_givwhen.leave_op = cLOGOP->op_other; + cx->blk_givwhen.defsv_save = orig_defsv; +} + + +PERL_STATIC_INLINE void +Perl_cx_popgiven(pTHX_ PERL_CONTEXT *cx) +{ + SV *sv; + + PERL_ARGS_ASSERT_CX_POPGIVEN; + assert(CxTYPE(cx) == CXt_GIVEN); + + sv = GvSV(PL_defgv); + GvSV(PL_defgv) = cx->blk_givwhen.defsv_save; + cx->blk_givwhen.defsv_save = NULL; + SvREFCNT_dec(sv); +} + + /* Make @_ empty in-place in simple cases: a cheap av_clear(). * See Perl_clear_defarray() for non-simple cases */ diff --git a/keywords.c b/keywords.c index fb4bfd8e3982..c5ddc821db86 100644 --- a/keywords.c +++ b/keywords.c @@ -533,7 +533,7 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) goto unknown; } - case 4: /* 39 tokens of length 4 */ + case 4: /* 40 tokens of length 4 */ switch (name[0]) { case 'I': @@ -953,38 +953,49 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) } case 'w': - if (name[1] == 'a') + switch (name[1]) { - switch (name[2]) - { - case 'i': - if (name[3] == 't') - { /* wait */ - return -KEY_wait; - } + case 'a': + switch (name[2]) + { + case 'i': + if (name[3] == 't') + { /* wait */ + return -KEY_wait; + } - goto unknown; + goto unknown; - case 'r': - if (name[3] == 'n') - { /* warn */ - return -KEY_warn; - } + case 'r': + if (name[3] == 'n') + { /* warn */ + return -KEY_warn; + } - goto unknown; + goto unknown; - default: - goto unknown; - } - } + default: + goto unknown; + } - goto unknown; + case 'h': + if (name[2] == 'e' && + name[3] == 'n') + { /* when */ + return (all_keywords || FEATURE_SWITCH_IS_ENABLED ? KEY_when : 0); + } + + goto unknown; + + default: + goto unknown; + } default: goto unknown; } - case 5: /* 41 tokens of length 5 */ + case 5: /* 43 tokens of length 5 */ switch (name[0]) { case 'B': @@ -1037,15 +1048,31 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) } case 'b': - if (name[1] == 'l' && - name[2] == 'e' && - name[3] == 's' && - name[4] == 's') - { /* bless */ - return -KEY_bless; - } + switch (name[1]) + { + case 'l': + if (name[2] == 'e' && + name[3] == 's' && + name[4] == 's') + { /* bless */ + return -KEY_bless; + } - goto unknown; + goto unknown; + + case 'r': + if (name[2] == 'e' && + name[3] == 'a' && + name[4] == 'k') + { /* break */ + return (all_keywords || FEATURE_SWITCH_IS_ENABLED ? -KEY_break : 0); + } + + goto unknown; + + default: + goto unknown; + } case 'c': switch (name[1]) @@ -1206,6 +1233,17 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) goto unknown; } + case 'g': + if (name[1] == 'i' && + name[2] == 'v' && + name[3] == 'e' && + name[4] == 'n') + { /* given */ + return (all_keywords || FEATURE_SWITCH_IS_ENABLED ? KEY_given : 0); + } + + goto unknown; + case 'i': switch (name[1]) { @@ -1985,7 +2023,7 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) goto unknown; } - case 7: /* 30 tokens of length 7 */ + case 7: /* 31 tokens of length 7 */ switch (name[0]) { case 'D': @@ -2077,13 +2115,33 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) goto unknown; case 'e': - if (name[2] == 'f' && - name[3] == 'i' && - name[4] == 'n' && - name[5] == 'e' && - name[6] == 'd') - { /* defined */ - return KEY_defined; + if (name[2] == 'f') + { + switch (name[3]) + { + case 'a': + if (name[4] == 'u' && + name[5] == 'l' && + name[6] == 't') + { /* default */ + return (all_keywords || FEATURE_SWITCH_IS_ENABLED ? KEY_default : 0); + } + + goto unknown; + + case 'i': + if (name[4] == 'n' && + name[5] == 'e' && + name[6] == 'd') + { /* defined */ + return KEY_defined; + } + + goto unknown; + + default: + goto unknown; + } } goto unknown; @@ -3532,5 +3590,5 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) } /* Generated from: - * 86050f368b9e57b4a97be585340ba2fb90e67ad48b8f44878e15020c52a47d8c regen/keywords.pl + * c98bc3e43d3c015df56352665f8ae920fbfb3e2a035f4ce63dcc242190d25c9a regen/keywords.pl * ex: set ro ft=c: */ diff --git a/keywords.h b/keywords.h index 675b0d4be4df..8ac9b3d97d39 100644 --- a/keywords.h +++ b/keywords.h @@ -39,244 +39,248 @@ #define KEY_bind 23 #define KEY_binmode 24 #define KEY_bless 25 -#define KEY_caller 26 -#define KEY_catch 27 -#define KEY_chdir 28 -#define KEY_chmod 29 -#define KEY_chomp 30 -#define KEY_chop 31 -#define KEY_chown 32 -#define KEY_chr 33 -#define KEY_chroot 34 -#define KEY_class 35 -#define KEY_close 36 -#define KEY_closedir 37 -#define KEY_cmp 38 -#define KEY_connect 39 -#define KEY_continue 40 -#define KEY_cos 41 -#define KEY_crypt 42 -#define KEY_dbmclose 43 -#define KEY_dbmopen 44 -#define KEY_defer 45 -#define KEY_defined 46 -#define KEY_delete 47 -#define KEY_die 48 -#define KEY_do 49 -#define KEY_dump 50 -#define KEY_each 51 -#define KEY_else 52 -#define KEY_elsif 53 -#define KEY_endgrent 54 -#define KEY_endhostent 55 -#define KEY_endnetent 56 -#define KEY_endprotoent 57 -#define KEY_endpwent 58 -#define KEY_endservent 59 -#define KEY_eof 60 -#define KEY_eq 61 -#define KEY_eval 62 -#define KEY_evalbytes 63 -#define KEY_exec 64 -#define KEY_exists 65 -#define KEY_exit 66 -#define KEY_exp 67 -#define KEY_fc 68 -#define KEY_fcntl 69 -#define KEY_field 70 -#define KEY_fileno 71 -#define KEY_finally 72 -#define KEY_flock 73 -#define KEY_for 74 -#define KEY_foreach 75 -#define KEY_fork 76 -#define KEY_format 77 -#define KEY_formline 78 -#define KEY_ge 79 -#define KEY_getc 80 -#define KEY_getgrent 81 -#define KEY_getgrgid 82 -#define KEY_getgrnam 83 -#define KEY_gethostbyaddr 84 -#define KEY_gethostbyname 85 -#define KEY_gethostent 86 -#define KEY_getlogin 87 -#define KEY_getnetbyaddr 88 -#define KEY_getnetbyname 89 -#define KEY_getnetent 90 -#define KEY_getpeername 91 -#define KEY_getpgrp 92 -#define KEY_getppid 93 -#define KEY_getpriority 94 -#define KEY_getprotobyname 95 -#define KEY_getprotobynumber 96 -#define KEY_getprotoent 97 -#define KEY_getpwent 98 -#define KEY_getpwnam 99 -#define KEY_getpwuid 100 -#define KEY_getservbyname 101 -#define KEY_getservbyport 102 -#define KEY_getservent 103 -#define KEY_getsockname 104 -#define KEY_getsockopt 105 -#define KEY_glob 106 -#define KEY_gmtime 107 -#define KEY_goto 108 -#define KEY_grep 109 -#define KEY_gt 110 -#define KEY_hex 111 -#define KEY_if 112 -#define KEY_index 113 -#define KEY_int 114 -#define KEY_ioctl 115 -#define KEY_isa 116 -#define KEY_join 117 -#define KEY_keys 118 -#define KEY_kill 119 -#define KEY_last 120 -#define KEY_lc 121 -#define KEY_lcfirst 122 -#define KEY_le 123 -#define KEY_length 124 -#define KEY_link 125 -#define KEY_listen 126 -#define KEY_local 127 -#define KEY_localtime 128 -#define KEY_lock 129 -#define KEY_log 130 -#define KEY_lstat 131 -#define KEY_lt 132 -#define KEY_m 133 -#define KEY_map 134 -#define KEY_method 135 -#define KEY_mkdir 136 -#define KEY_msgctl 137 -#define KEY_msgget 138 -#define KEY_msgrcv 139 -#define KEY_msgsnd 140 -#define KEY_my 141 -#define KEY_ne 142 -#define KEY_next 143 -#define KEY_no 144 -#define KEY_not 145 -#define KEY_oct 146 -#define KEY_open 147 -#define KEY_opendir 148 -#define KEY_or 149 -#define KEY_ord 150 -#define KEY_our 151 -#define KEY_pack 152 -#define KEY_package 153 -#define KEY_pipe 154 -#define KEY_pop 155 -#define KEY_pos 156 -#define KEY_print 157 -#define KEY_printf 158 -#define KEY_prototype 159 -#define KEY_push 160 -#define KEY_q 161 -#define KEY_qq 162 -#define KEY_qr 163 -#define KEY_quotemeta 164 -#define KEY_qw 165 -#define KEY_qx 166 -#define KEY_rand 167 -#define KEY_read 168 -#define KEY_readdir 169 -#define KEY_readline 170 -#define KEY_readlink 171 -#define KEY_readpipe 172 -#define KEY_recv 173 -#define KEY_redo 174 -#define KEY_ref 175 -#define KEY_rename 176 -#define KEY_require 177 -#define KEY_reset 178 -#define KEY_return 179 -#define KEY_reverse 180 -#define KEY_rewinddir 181 -#define KEY_rindex 182 -#define KEY_rmdir 183 -#define KEY_s 184 -#define KEY_say 185 -#define KEY_scalar 186 -#define KEY_seek 187 -#define KEY_seekdir 188 -#define KEY_select 189 -#define KEY_semctl 190 -#define KEY_semget 191 -#define KEY_semop 192 -#define KEY_send 193 -#define KEY_setgrent 194 -#define KEY_sethostent 195 -#define KEY_setnetent 196 -#define KEY_setpgrp 197 -#define KEY_setpriority 198 -#define KEY_setprotoent 199 -#define KEY_setpwent 200 -#define KEY_setservent 201 -#define KEY_setsockopt 202 -#define KEY_shift 203 -#define KEY_shmctl 204 -#define KEY_shmget 205 -#define KEY_shmread 206 -#define KEY_shmwrite 207 -#define KEY_shutdown 208 -#define KEY_sin 209 -#define KEY_sleep 210 -#define KEY_socket 211 -#define KEY_socketpair 212 -#define KEY_sort 213 -#define KEY_splice 214 -#define KEY_split 215 -#define KEY_sprintf 216 -#define KEY_sqrt 217 -#define KEY_srand 218 -#define KEY_stat 219 -#define KEY_state 220 -#define KEY_study 221 -#define KEY_sub 222 -#define KEY_substr 223 -#define KEY_symlink 224 -#define KEY_syscall 225 -#define KEY_sysopen 226 -#define KEY_sysread 227 -#define KEY_sysseek 228 -#define KEY_system 229 -#define KEY_syswrite 230 -#define KEY_tell 231 -#define KEY_telldir 232 -#define KEY_tie 233 -#define KEY_tied 234 -#define KEY_time 235 -#define KEY_times 236 -#define KEY_tr 237 -#define KEY_try 238 -#define KEY_truncate 239 -#define KEY_uc 240 -#define KEY_ucfirst 241 -#define KEY_umask 242 -#define KEY_undef 243 -#define KEY_unless 244 -#define KEY_unlink 245 -#define KEY_unpack 246 -#define KEY_unshift 247 -#define KEY_untie 248 -#define KEY_until 249 -#define KEY_use 250 -#define KEY_utime 251 -#define KEY_values 252 -#define KEY_vec 253 -#define KEY_wait 254 -#define KEY_waitpid 255 -#define KEY_wantarray 256 -#define KEY_warn 257 -#define KEY_while 258 -#define KEY_write 259 -#define KEY_x 260 -#define KEY_xor 261 -#define KEY_y 262 +#define KEY_break 26 +#define KEY_caller 27 +#define KEY_catch 28 +#define KEY_chdir 29 +#define KEY_chmod 30 +#define KEY_chomp 31 +#define KEY_chop 32 +#define KEY_chown 33 +#define KEY_chr 34 +#define KEY_chroot 35 +#define KEY_class 36 +#define KEY_close 37 +#define KEY_closedir 38 +#define KEY_cmp 39 +#define KEY_connect 40 +#define KEY_continue 41 +#define KEY_cos 42 +#define KEY_crypt 43 +#define KEY_dbmclose 44 +#define KEY_dbmopen 45 +#define KEY_default 46 +#define KEY_defer 47 +#define KEY_defined 48 +#define KEY_delete 49 +#define KEY_die 50 +#define KEY_do 51 +#define KEY_dump 52 +#define KEY_each 53 +#define KEY_else 54 +#define KEY_elsif 55 +#define KEY_endgrent 56 +#define KEY_endhostent 57 +#define KEY_endnetent 58 +#define KEY_endprotoent 59 +#define KEY_endpwent 60 +#define KEY_endservent 61 +#define KEY_eof 62 +#define KEY_eq 63 +#define KEY_eval 64 +#define KEY_evalbytes 65 +#define KEY_exec 66 +#define KEY_exists 67 +#define KEY_exit 68 +#define KEY_exp 69 +#define KEY_fc 70 +#define KEY_fcntl 71 +#define KEY_field 72 +#define KEY_fileno 73 +#define KEY_finally 74 +#define KEY_flock 75 +#define KEY_for 76 +#define KEY_foreach 77 +#define KEY_fork 78 +#define KEY_format 79 +#define KEY_formline 80 +#define KEY_ge 81 +#define KEY_getc 82 +#define KEY_getgrent 83 +#define KEY_getgrgid 84 +#define KEY_getgrnam 85 +#define KEY_gethostbyaddr 86 +#define KEY_gethostbyname 87 +#define KEY_gethostent 88 +#define KEY_getlogin 89 +#define KEY_getnetbyaddr 90 +#define KEY_getnetbyname 91 +#define KEY_getnetent 92 +#define KEY_getpeername 93 +#define KEY_getpgrp 94 +#define KEY_getppid 95 +#define KEY_getpriority 96 +#define KEY_getprotobyname 97 +#define KEY_getprotobynumber 98 +#define KEY_getprotoent 99 +#define KEY_getpwent 100 +#define KEY_getpwnam 101 +#define KEY_getpwuid 102 +#define KEY_getservbyname 103 +#define KEY_getservbyport 104 +#define KEY_getservent 105 +#define KEY_getsockname 106 +#define KEY_getsockopt 107 +#define KEY_given 108 +#define KEY_glob 109 +#define KEY_gmtime 110 +#define KEY_goto 111 +#define KEY_grep 112 +#define KEY_gt 113 +#define KEY_hex 114 +#define KEY_if 115 +#define KEY_index 116 +#define KEY_int 117 +#define KEY_ioctl 118 +#define KEY_isa 119 +#define KEY_join 120 +#define KEY_keys 121 +#define KEY_kill 122 +#define KEY_last 123 +#define KEY_lc 124 +#define KEY_lcfirst 125 +#define KEY_le 126 +#define KEY_length 127 +#define KEY_link 128 +#define KEY_listen 129 +#define KEY_local 130 +#define KEY_localtime 131 +#define KEY_lock 132 +#define KEY_log 133 +#define KEY_lstat 134 +#define KEY_lt 135 +#define KEY_m 136 +#define KEY_map 137 +#define KEY_method 138 +#define KEY_mkdir 139 +#define KEY_msgctl 140 +#define KEY_msgget 141 +#define KEY_msgrcv 142 +#define KEY_msgsnd 143 +#define KEY_my 144 +#define KEY_ne 145 +#define KEY_next 146 +#define KEY_no 147 +#define KEY_not 148 +#define KEY_oct 149 +#define KEY_open 150 +#define KEY_opendir 151 +#define KEY_or 152 +#define KEY_ord 153 +#define KEY_our 154 +#define KEY_pack 155 +#define KEY_package 156 +#define KEY_pipe 157 +#define KEY_pop 158 +#define KEY_pos 159 +#define KEY_print 160 +#define KEY_printf 161 +#define KEY_prototype 162 +#define KEY_push 163 +#define KEY_q 164 +#define KEY_qq 165 +#define KEY_qr 166 +#define KEY_quotemeta 167 +#define KEY_qw 168 +#define KEY_qx 169 +#define KEY_rand 170 +#define KEY_read 171 +#define KEY_readdir 172 +#define KEY_readline 173 +#define KEY_readlink 174 +#define KEY_readpipe 175 +#define KEY_recv 176 +#define KEY_redo 177 +#define KEY_ref 178 +#define KEY_rename 179 +#define KEY_require 180 +#define KEY_reset 181 +#define KEY_return 182 +#define KEY_reverse 183 +#define KEY_rewinddir 184 +#define KEY_rindex 185 +#define KEY_rmdir 186 +#define KEY_s 187 +#define KEY_say 188 +#define KEY_scalar 189 +#define KEY_seek 190 +#define KEY_seekdir 191 +#define KEY_select 192 +#define KEY_semctl 193 +#define KEY_semget 194 +#define KEY_semop 195 +#define KEY_send 196 +#define KEY_setgrent 197 +#define KEY_sethostent 198 +#define KEY_setnetent 199 +#define KEY_setpgrp 200 +#define KEY_setpriority 201 +#define KEY_setprotoent 202 +#define KEY_setpwent 203 +#define KEY_setservent 204 +#define KEY_setsockopt 205 +#define KEY_shift 206 +#define KEY_shmctl 207 +#define KEY_shmget 208 +#define KEY_shmread 209 +#define KEY_shmwrite 210 +#define KEY_shutdown 211 +#define KEY_sin 212 +#define KEY_sleep 213 +#define KEY_socket 214 +#define KEY_socketpair 215 +#define KEY_sort 216 +#define KEY_splice 217 +#define KEY_split 218 +#define KEY_sprintf 219 +#define KEY_sqrt 220 +#define KEY_srand 221 +#define KEY_stat 222 +#define KEY_state 223 +#define KEY_study 224 +#define KEY_sub 225 +#define KEY_substr 226 +#define KEY_symlink 227 +#define KEY_syscall 228 +#define KEY_sysopen 229 +#define KEY_sysread 230 +#define KEY_sysseek 231 +#define KEY_system 232 +#define KEY_syswrite 233 +#define KEY_tell 234 +#define KEY_telldir 235 +#define KEY_tie 236 +#define KEY_tied 237 +#define KEY_time 238 +#define KEY_times 239 +#define KEY_tr 240 +#define KEY_try 241 +#define KEY_truncate 242 +#define KEY_uc 243 +#define KEY_ucfirst 244 +#define KEY_umask 245 +#define KEY_undef 246 +#define KEY_unless 247 +#define KEY_unlink 248 +#define KEY_unpack 249 +#define KEY_unshift 250 +#define KEY_untie 251 +#define KEY_until 252 +#define KEY_use 253 +#define KEY_utime 254 +#define KEY_values 255 +#define KEY_vec 256 +#define KEY_wait 257 +#define KEY_waitpid 258 +#define KEY_wantarray 259 +#define KEY_warn 260 +#define KEY_when 261 +#define KEY_while 262 +#define KEY_write 263 +#define KEY_x 264 +#define KEY_xor 265 +#define KEY_y 266 /* Generated from: - * 86050f368b9e57b4a97be585340ba2fb90e67ad48b8f44878e15020c52a47d8c regen/keywords.pl + * c98bc3e43d3c015df56352665f8ae920fbfb3e2a035f4ce63dcc242190d25c9a regen/keywords.pl * ex: set ro ft=c: */ diff --git a/lib/B/Deparse-core.t b/lib/B/Deparse-core.t index 2f8bedecc734..4b12aad921c6 100644 --- a/lib/B/Deparse-core.t +++ b/lib/B/Deparse-core.t @@ -86,6 +86,7 @@ sub testit { use feature 'lexical_subs'; $code = "no warnings 'syntax'; no strict 'vars'; sub { state sub $keyword; ${vars}() = $expr }"; $code = "use feature 'isa';\n$code" if $keyword eq "isa"; + $code = "use feature 'switch';\n$code" if $keyword eq "break"; $code_ref = eval $code or die "$@ in $expr"; } else { @@ -95,6 +96,7 @@ sub testit { import subs $keyword; $code = "no warnings 'syntax'; no strict 'vars'; sub { ${vars}() = $expr }"; $code = "use feature 'isa';\n$code" if $keyword eq "isa"; + $code = "use feature 'switch';\n$code" if $keyword eq "break"; $code_ref = eval $code or die "$@ in $expr"; } @@ -366,7 +368,7 @@ my %not_tested = map { $_ => 1} qw( UNITCHECK catch class - continue + default defer else elsif @@ -375,6 +377,7 @@ my %not_tested = map { $_ => 1} qw( for foreach format + given if m method @@ -392,6 +395,7 @@ my %not_tested = map { $_ => 1} qw( unless until use + when while y ); @@ -472,6 +476,7 @@ atan2 2 p bind 2 p binmode 12 p bless 1 p +break 0 - caller 0 - chdir 01 - chmod @ p1 @@ -484,6 +489,7 @@ close 01 - closedir 1 - cmp B - connect 2 p +continue 0 - cos 01 $ crypt 2 p # dbmopen handled specially @@ -541,6 +547,7 @@ getservbyport 2 p getservent 0 - getsockname 1 - getsockopt 3 p +# given handled specially grep 123 p+ # also tested specially # glob handled specially # goto handled specially diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm index 3a24fda168e7..8fc1b14dd0c0 100644 --- a/lib/B/Deparse.pm +++ b/lib/B/Deparse.pm @@ -7,7 +7,7 @@ # This is based on the module of the same name by Malcolm Beattie, # but essentially none of his code remains. -package B::Deparse 1.82; +package B::Deparse 1.83; use strict; use Carp; use B qw(class main_root main_start main_cv svref_2object opnumber perlstring @@ -2340,6 +2340,10 @@ my %feature_keywords = ( # keyword => 'feature', state => 'state', say => 'say', + given => 'switch', + when => 'switch', + default => 'switch', + break => 'switch', evalbytes=>'evalbytes', __SUB__ => '__SUB__', fc => 'fc', @@ -2651,6 +2655,34 @@ sub pp_ggrgid { unop(@_, "getgrgid") } sub pp_lock { unop(@_, "lock") } +sub pp_continue { unop(@_, "continue"); } +sub pp_break { unop(@_, "break"); } + +sub givwhen { + my $self = shift; + my($op, $cx, $givwhen) = @_; + + my $enterop = $op->first; + my ($head, $block); + if ($enterop->flags & OPf_SPECIAL) { + $head = $self->keyword("default"); + $block = $self->deparse($enterop->first, 0); + } + else { + my $cond = $enterop->first; + my $cond_str = $self->deparse($cond, 1); + $head = "$givwhen ($cond_str)"; + $block = $self->deparse($cond->sibling, 0); + } + + return "$head {\n". + "\t$block\n". + "\b}\cK"; +} + +sub pp_leavegiven { givwhen(@_, $_[0]->keyword("given")); } +sub pp_leavewhen { givwhen(@_, $_[0]->keyword("when")); } + sub pp_exists { my $self = shift; my($op, $cx) = @_; diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index cc52ee501616..aa29b404c974 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -1081,6 +1081,15 @@ my $b = \{}; my $c = []; my $d = \[]; #### +# SKIP ?$] < 5.010 && "smartmatch and given/when not implemented on this Perl version" +# CONTEXT use feature ':5.10'; no warnings 'deprecated'; +# implicit smartmatch in given/when +given ('foo') { + when ('bar') { continue; } + when ($_ ~~ 'quux') { continue; } + default { 0; } +} +#### # conditions in elsifs (regression in change #33710 which fixed bug #37302) if ($a) { x(); } elsif ($b) { x(); } @@ -1639,6 +1648,14 @@ $a[0] = 1; # CONTEXT no warnings 'deprecated'; CORE::state $x; CORE::say $x; +CORE::given ($x) { + CORE::when (3) { + continue; + } + CORE::default { + CORE::break; + } +} CORE::evalbytes ''; () = CORE::__SUB__; () = CORE::fc $x; @@ -1649,11 +1666,27 @@ use feature (sprintf(":%vd", $^V)); use 1; CORE::say $_; CORE::state $x; +CORE::given ($x) { + CORE::when (3) { + continue; + } + CORE::default { + CORE::break; + } +} CORE::evalbytes ''; () = CORE::__SUB__; >>>> CORE::say $_; CORE::state $x; +CORE::given ($x) { + CORE::when (3) { + continue; + } + CORE::default { + CORE::break; + } +} CORE::evalbytes ''; () = CORE::__SUB__; #### @@ -1664,6 +1697,14 @@ use feature (sprintf(":%vd", $^V)); use 1; CORE::say $_; CORE::state $x; +CORE::given ($x) { + CORE::when (3) { + continue; + } + CORE::default { + CORE::break; + } +} CORE::evalbytes ''; () = CORE::__SUB__; >>>> @@ -1671,16 +1712,26 @@ no feature ':all'; use feature ':default'; CORE::say $_; CORE::state $x; +CORE::given ($x) { + CORE::when (3) { + continue; + } + CORE::default { + CORE::break; + } +} CORE::evalbytes ''; () = CORE::__SUB__; #### # SKIP ?$] < 5.017004 && "lexical subs not implemented on this Perl version" # lexical subroutines and keywords of the same name -# CONTEXT use feature 'lexical_subs'; no warnings 'experimental'; no warnings 'deprecated'; +# CONTEXT use feature 'lexical_subs', 'switch'; no warnings 'experimental'; no warnings 'deprecated'; +my sub default; my sub else; my sub elsif; my sub for; my sub foreach; +my sub given; my sub if; my sub m; my sub no; @@ -1696,7 +1747,9 @@ my sub tr; my sub unless; my sub until; my sub use; +my sub when; my sub while; +CORE::default { die; } CORE::if ($1) { die; } CORE::if ($1) { die; } CORE::elsif ($1) { die; } @@ -1704,6 +1757,7 @@ CORE::else { die; } CORE::for (die; $1; die) { die; } CORE::foreach $_ (1 .. 10) { die; } die CORE::foreach (1); +CORE::given ($1) { die; } CORE::m[/]; CORE::m?/?; CORE::package foo; @@ -1717,6 +1771,7 @@ CORE::unless ($1) { die; } CORE::until ($1) { die; } die CORE::until $1; CORE::use strict; +CORE::when ($1 ~~ $2) { die; } CORE::while ($1) { die; } die CORE::while $1; #### diff --git a/lib/B/Op_private.pm b/lib/B/Op_private.pm index 79f246d61b0a..9bca6171acc0 100644 --- a/lib/B/Op_private.pm +++ b/lib/B/Op_private.pm @@ -336,10 +336,12 @@ $bits{dump}{0} = $bf[0]; $bits{each}{0} = $bf[0]; @{$bits{emptyavhv}}{5,3,2,1,0} = ('OPpEMPTYAVHV_IS_HV', $bf[5], $bf[5], $bf[5], $bf[5]); @{$bits{entereval}}{6,5,4,3,2,1,0} = ('OPpEVAL_EVALSV', 'OPpEVAL_RE_REPARSING', 'OPpEVAL_COPHH', 'OPpEVAL_BYTES', 'OPpEVAL_UNICODE', 'OPpEVAL_HAS_HH', $bf[0]); +$bits{entergiven}{0} = $bf[0]; $bits{enteriter}{3} = 'OPpITER_DEF'; @{$bits{entersub}}{5,4,0} = ($bf[9], $bf[9], 'OPpENTERSUB_INARGS'); $bits{entertry}{0} = $bf[0]; $bits{entertrycatch}{0} = $bf[0]; +$bits{enterwhen}{0} = $bf[0]; @{$bits{enterwrite}}{3,2,1,0} = ($bf[5], $bf[5], $bf[5], $bf[5]); @{$bits{eof}}{3,2,1,0} = ($bf[5], $bf[5], $bf[5], $bf[5]); @{$bits{eq}}{1,0} = ($bf[1], $bf[1]); @@ -446,9 +448,11 @@ $bits{lc}{0} = $bf[0]; $bits{lcfirst}{0} = $bf[0]; @{$bits{le}}{1,0} = ($bf[1], $bf[1]); $bits{leaveeval}{0} = $bf[0]; +$bits{leavegiven}{0} = $bf[0]; @{$bits{leaveloop}}{1,0} = ($bf[1], $bf[1]); $bits{leavesub}{0} = $bf[0]; $bits{leavesublv}{0} = $bf[0]; +$bits{leavewhen}{0} = $bf[0]; $bits{leavewrite}{0} = $bf[0]; $bits{length}{0} = $bf[0]; @{$bits{link}}{3,2,1,0} = ($bf[5], $bf[5], $bf[5], $bf[5]); diff --git a/op.c b/op.c index 0716e9d0f8c0..a26d1b84d079 100644 --- a/op.c +++ b/op.c @@ -2058,6 +2058,8 @@ Perl_scalar(pTHX_ OP *o) next_kid = kid; goto do_next; } + else if (kid->op_type == OP_LEAVEWHEN) + scalar(kid); else scalarvoid(kid); kid = sib; @@ -2145,7 +2147,7 @@ Perl_scalarvoid(pTHX_ OP *arg) want = o->op_flags & OPf_WANT; if ((want && want != OPf_WANT_SCALAR) || (PL_parser && PL_parser->error_count) - || o->op_type == OP_RETURN || o->op_type == OP_REQUIRE) + || o->op_type == OP_RETURN || o->op_type == OP_REQUIRE || o->op_type == OP_LEAVEWHEN) { goto get_next_op; } @@ -2424,6 +2426,8 @@ Perl_scalarvoid(pTHX_ OP *arg) case OP_DOR: case OP_COND_EXPR: + case OP_ENTERGIVEN: + case OP_ENTERWHEN: next_kid = OpSIBLING(cUNOPo->op_first); break; @@ -2443,6 +2447,8 @@ Perl_scalarvoid(pTHX_ OP *arg) case OP_LEAVETRY: case OP_LEAVELOOP: case OP_LINESEQ: + case OP_LEAVEGIVEN: + case OP_LEAVEWHEN: case OP_ONCE: kids: next_kid = cLISTOPo->op_first; @@ -2629,6 +2635,8 @@ Perl_list(pTHX_ OP *o) next_kid = kid; goto do_next; } + else if (kid->op_type == OP_LEAVEWHEN) + list(kid); else scalarvoid(kid); kid = sib; @@ -10042,6 +10050,207 @@ S_ref_array_or_hash(pTHX_ OP *cond) return cond; } +/* These construct the optree fragments representing given() + and when() blocks. + + entergiven and enterwhen are LOGOPs; the op_other pointer + points up to the associated leave op. We need this so we + can put it in the context and make break/continue work. + (Also, of course, pp_enterwhen will jump straight to + op_other if the match fails.) + */ + +STATIC OP * +S_newGIVWHENOP(pTHX_ OP *cond, OP *block, + I32 enter_opcode, I32 leave_opcode, + PADOFFSET entertarg) +{ + LOGOP *enterop; + OP *o; + + PERL_ARGS_ASSERT_NEWGIVWHENOP; + PERL_UNUSED_ARG(entertarg); /* used to indicate targ of lexical $_ */ + + enterop = alloc_LOGOP(enter_opcode, block, NULL); + enterop->op_targ = 0; + enterop->op_private = 0; + + o = newUNOP(leave_opcode, 0, (OP *) enterop); + + if (cond) { + /* prepend cond if we have one */ + op_sibling_splice((OP*)enterop, NULL, 0, scalar(cond)); + + o->op_next = LINKLIST(cond); + cond->op_next = (OP *) enterop; + } + else { + /* This is a default {} block */ + enterop->op_flags |= OPf_SPECIAL; + o ->op_flags |= OPf_SPECIAL; + + o->op_next = (OP *) enterop; + } + + CHECKOP(enter_opcode, enterop); /* Currently does nothing, since + entergiven and enterwhen both + use ck_null() */ + + enterop->op_next = LINKLIST(block); + block->op_next = enterop->op_other = o; + + return o; +} + + +/* For the purposes of 'when(implied_smartmatch)' + * versus 'when(boolean_expression)', + * does this look like a boolean operation? For these purposes + a boolean operation is: + - a subroutine call [*] + - a logical connective + - a comparison operator + - a filetest operator, with the exception of -s -M -A -C + - defined(), exists() or eof() + - /$re/ or $foo =~ /$re/ + + [*] possibly surprising + */ +STATIC bool +S_looks_like_bool(pTHX_ const OP *o) +{ + PERL_ARGS_ASSERT_LOOKS_LIKE_BOOL; + + switch(o->op_type) { + case OP_OR: + case OP_DOR: + return looks_like_bool(cLOGOPo->op_first); + + case OP_AND: + { + OP* sibl = OpSIBLING(cLOGOPo->op_first); + ASSUME(sibl); + return ( + looks_like_bool(cLOGOPo->op_first) + && looks_like_bool(sibl)); + } + + case OP_NULL: + case OP_SCALAR: + return ( + o->op_flags & OPf_KIDS + && looks_like_bool(cUNOPo->op_first)); + + case OP_ENTERSUB: + + case OP_NOT: case OP_XOR: + + case OP_EQ: case OP_NE: case OP_LT: + case OP_GT: case OP_LE: case OP_GE: + + case OP_I_EQ: case OP_I_NE: case OP_I_LT: + case OP_I_GT: case OP_I_LE: case OP_I_GE: + + case OP_SEQ: case OP_SNE: case OP_SLT: + case OP_SGT: case OP_SLE: case OP_SGE: + + case OP_SMARTMATCH: + + case OP_FTRREAD: case OP_FTRWRITE: case OP_FTREXEC: + case OP_FTEREAD: case OP_FTEWRITE: case OP_FTEEXEC: + case OP_FTIS: case OP_FTEOWNED: case OP_FTROWNED: + case OP_FTZERO: case OP_FTSOCK: case OP_FTCHR: + case OP_FTBLK: case OP_FTFILE: case OP_FTDIR: + case OP_FTPIPE: case OP_FTLINK: case OP_FTSUID: + case OP_FTSGID: case OP_FTSVTX: case OP_FTTTY: + case OP_FTTEXT: case OP_FTBINARY: + + case OP_DEFINED: case OP_EXISTS: + case OP_MATCH: case OP_EOF: + + case OP_FLOP: + + return TRUE; + + case OP_INDEX: + case OP_RINDEX: + /* optimised-away (index() != -1) or similar comparison */ + if (o->op_private & OPpTRUEBOOL) + return TRUE; + return FALSE; + + case OP_CONST: + /* Detect comparisons that have been optimized away */ + if (cSVOPo->op_sv == &PL_sv_yes + || cSVOPo->op_sv == &PL_sv_no) + + return TRUE; + else + return FALSE; + /* FALLTHROUGH */ + default: + return FALSE; + } +} + + +/* +=for apidoc newGIVENOP + +Constructs, checks, and returns an op tree expressing a C block. +C supplies the expression to whose value C<$_> will be locally +aliased, and C supplies the body of the C construct; they +are consumed by this function and become part of the constructed op tree. +C must be zero (it used to identity the pad slot of lexical $_). + +=cut +*/ + +OP * +Perl_newGIVENOP(pTHX_ OP *cond, OP *block, PADOFFSET defsv_off) +{ + PERL_ARGS_ASSERT_NEWGIVENOP; + PERL_UNUSED_ARG(defsv_off); + + assert(!defsv_off); + return newGIVWHENOP( + ref_array_or_hash(cond), + block, + OP_ENTERGIVEN, OP_LEAVEGIVEN, + 0); +} + +/* +=for apidoc newWHENOP + +Constructs, checks, and returns an op tree expressing a C block. +C supplies the test expression, and C supplies the block +that will be executed if the test evaluates to true; they are consumed +by this function and become part of the constructed op tree. C +will be interpreted DWIMically, often as a comparison against C<$_>, +and may be null to generate a C block. + +=cut +*/ + +OP * +Perl_newWHENOP(pTHX_ OP *cond, OP *block) +{ + const bool cond_llb = (!cond || looks_like_bool(cond)); + OP *cond_op; + + PERL_ARGS_ASSERT_NEWWHENOP; + + if (cond_llb) + cond_op = cond; + else { + cond_op = newBINOP(OP_SMARTMATCH, OPf_SPECIAL, + newDEFSVOP(), + scalar(ref_array_or_hash(cond))); + } + + return newGIVWHENOP(cond_op, block, OP_ENTERWHEN, OP_LEAVEWHEN, 0); +} /* =for apidoc newDEFEROP @@ -15764,8 +15973,8 @@ Perl_core_prototype(pTHX_ SV *sv, const char *name, const int code, #define retsetpvs(x,y) sv_setpvs(sv, x); if(opnum) *opnum=(y); return sv switch (code < 0 ? -code : code) { - case KEY_and : case KEY_chop: case KEY_chomp : case KEY_cmp : - case KEY_continue: case KEY_defined: case KEY_delete: case KEY_exec : + case KEY_and : case KEY_chop: case KEY_chomp: + case KEY_cmp : case KEY_defined: case KEY_delete: case KEY_exec : case KEY_exists: case KEY_eq : case KEY_ge : case KEY_goto : case KEY_grep : case KEY_gt : case KEY_last : case KEY_le : case KEY_lt : case KEY_map : case KEY_ne : case KEY_next : diff --git a/opcode.h b/opcode.h index 6aa0c4a6e98b..8f040e1813c9 100644 --- a/opcode.h +++ b/opcode.h @@ -372,6 +372,12 @@ EXTCONST char* const PL_op_name[] INIT({ "method_super", "method_redir", "method_redir_super", + "entergiven", + "leavegiven", + "enterwhen", + "leavewhen", + "break", + "continue", "open", "close", "pipe_op", @@ -796,6 +802,12 @@ EXTCONST char* const PL_op_desc[] INIT({ "super with known name", "redirect method with known name", "redirect super method with known name", + "given()", + "leave given block", + "when()", + "leave when block", + "break", + "continue", "open", "close", "pipe", @@ -1225,6 +1237,12 @@ INIT({ Perl_pp_method_super, Perl_pp_method_redir, Perl_pp_method_redir_super, + Perl_pp_entergiven, + Perl_pp_leavegiven, + Perl_pp_enterwhen, + Perl_pp_leavewhen, + Perl_pp_break, + Perl_pp_continue, Perl_pp_open, Perl_pp_close, Perl_pp_pipe_op, @@ -1649,6 +1667,12 @@ INIT({ Perl_ck_null, /* method_super */ Perl_ck_null, /* method_redir */ Perl_ck_null, /* method_redir_super */ + Perl_ck_null, /* entergiven */ + Perl_ck_null, /* leavegiven */ + Perl_ck_null, /* enterwhen */ + Perl_ck_null, /* leavewhen */ + Perl_ck_null, /* break */ + Perl_ck_null, /* continue */ Perl_ck_open, /* open */ Perl_ck_fun, /* close */ Perl_ck_fun, /* pipe_op */ @@ -2072,6 +2096,12 @@ EXTCONST U32 PL_opargs[] INIT({ 0x00000e40, /* method_super */ 0x00000e40, /* method_redir */ 0x00000e40, /* method_redir_super */ + 0x00000340, /* entergiven */ + 0x00000100, /* leavegiven */ + 0x00000340, /* enterwhen */ + 0x00000100, /* leavewhen */ + 0x00000000, /* break */ + 0x00000000, /* continue */ 0x0029640d, /* open */ 0x0000eb04, /* close */ 0x00066404, /* pipe_op */ @@ -2797,6 +2827,12 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = { 215, /* method_super */ 215, /* method_redir */ 215, /* method_redir_super */ + 0, /* entergiven */ + 0, /* leavegiven */ + 0, /* enterwhen */ + 0, /* leavewhen */ + -1, /* break */ + -1, /* continue */ 217, /* open */ 56, /* close */ 56, /* pipe_op */ @@ -3011,7 +3047,7 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = { */ EXTCONST U16 PL_op_private_bitdefs[] = { - 0x0003, /* scalar, prototype, refgen, srefgen, readline, regcmaybe, regcreset, regcomp, substcont, chop, schop, defined, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, not, ucfirst, lcfirst, uc, lc, quotemeta, aeach, avalues, each, pop, shift, grepstart, anywhile, mapstart, mapwhile, range, and, or, dor, andassign, orassign, dorassign, argcheck, untie, tied, dbmclose, getsockname, getpeername, lstat, stat, readlink, readdir, telldir, rewinddir, closedir, localtime, alarm, require, dofile, entertry, ghbyname, gnbyname, gpbyname, shostent, snetent, sprotoent, sservent, gpwnam, gpwuid, ggrnam, ggrgid, lock, once, fc, anonconst, cmpchain_and, cmpchain_dup, entertrycatch, catch, is_bool, is_weak, weaken, unweaken, is_tainted */ + 0x0003, /* scalar, prototype, refgen, srefgen, readline, regcmaybe, regcreset, regcomp, substcont, chop, schop, defined, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, not, ucfirst, lcfirst, uc, lc, quotemeta, aeach, avalues, each, pop, shift, grepstart, anywhile, mapstart, mapwhile, range, and, or, dor, andassign, orassign, dorassign, argcheck, entergiven, leavegiven, enterwhen, leavewhen, untie, tied, dbmclose, getsockname, getpeername, lstat, stat, readlink, readdir, telldir, rewinddir, closedir, localtime, alarm, require, dofile, entertry, ghbyname, gnbyname, gpbyname, shostent, snetent, sprotoent, sservent, gpwnam, gpwuid, ggrnam, ggrgid, lock, once, fc, anonconst, cmpchain_and, cmpchain_dup, entertrycatch, catch, is_bool, is_weak, weaken, unweaken, is_tainted */ 0x3cfc, 0x5379, /* pushmark */ 0x00bd, /* wantarray, runcv */ 0x077e, 0x0554, 0x1b70, 0x542c, 0x4fc8, 0x4225, /* const */ @@ -3326,6 +3362,12 @@ EXTCONST U8 PL_op_private_valid[] = { /* METHOD_SUPER */ (OPpARG1_MASK|OPpMETH_NO_BAREWORD_IO), /* METHOD_REDIR */ (OPpARG1_MASK|OPpMETH_NO_BAREWORD_IO), /* METHOD_REDIR_SUPER */ (OPpARG1_MASK|OPpMETH_NO_BAREWORD_IO), + /* ENTERGIVEN */ (OPpARG1_MASK), + /* LEAVEGIVEN */ (OPpARG1_MASK), + /* ENTERWHEN */ (OPpARG1_MASK), + /* LEAVEWHEN */ (OPpARG1_MASK), + /* BREAK */ (0), + /* CONTINUE */ (0), /* OPEN */ (OPpARG4_MASK|OPpOPEN_IN_RAW|OPpOPEN_IN_CRLF|OPpOPEN_OUT_RAW|OPpOPEN_OUT_CRLF), /* CLOSE */ (OPpARG4_MASK), /* PIPE_OP */ (OPpARG4_MASK), diff --git a/opnames.h b/opnames.h index eaf342c0e45e..53040e6ceb7a 100644 --- a/opnames.h +++ b/opnames.h @@ -238,202 +238,208 @@ typedef enum opcode { OP_METHOD_SUPER = 221, OP_METHOD_REDIR = 222, OP_METHOD_REDIR_SUPER = 223, - OP_OPEN = 224, - OP_CLOSE = 225, - OP_PIPE_OP = 226, - OP_FILENO = 227, - OP_UMASK = 228, - OP_BINMODE = 229, - OP_TIE = 230, - OP_UNTIE = 231, - OP_TIED = 232, - OP_DBMOPEN = 233, - OP_DBMCLOSE = 234, - OP_SSELECT = 235, - OP_SELECT = 236, - OP_GETC = 237, - OP_READ = 238, - OP_ENTERWRITE = 239, - OP_LEAVEWRITE = 240, - OP_PRTF = 241, - OP_PRINT = 242, - OP_SAY = 243, - OP_SYSOPEN = 244, - OP_SYSSEEK = 245, - OP_SYSREAD = 246, - OP_SYSWRITE = 247, - OP_EOF = 248, - OP_TELL = 249, - OP_SEEK = 250, - OP_TRUNCATE = 251, - OP_FCNTL = 252, - OP_IOCTL = 253, - OP_FLOCK = 254, - OP_SEND = 255, - OP_RECV = 256, - OP_SOCKET = 257, - OP_SOCKPAIR = 258, - OP_BIND = 259, - OP_CONNECT = 260, - OP_LISTEN = 261, - OP_ACCEPT = 262, - OP_SHUTDOWN = 263, - OP_GSOCKOPT = 264, - OP_SSOCKOPT = 265, - OP_GETSOCKNAME = 266, - OP_GETPEERNAME = 267, - OP_LSTAT = 268, - OP_STAT = 269, - OP_FTRREAD = 270, - OP_FTRWRITE = 271, - OP_FTREXEC = 272, - OP_FTEREAD = 273, - OP_FTEWRITE = 274, - OP_FTEEXEC = 275, - OP_FTIS = 276, - OP_FTSIZE = 277, - OP_FTMTIME = 278, - OP_FTATIME = 279, - OP_FTCTIME = 280, - OP_FTROWNED = 281, - OP_FTEOWNED = 282, - OP_FTZERO = 283, - OP_FTSOCK = 284, - OP_FTCHR = 285, - OP_FTBLK = 286, - OP_FTFILE = 287, - OP_FTDIR = 288, - OP_FTPIPE = 289, - OP_FTSUID = 290, - OP_FTSGID = 291, - OP_FTSVTX = 292, - OP_FTLINK = 293, - OP_FTTTY = 294, - OP_FTTEXT = 295, - OP_FTBINARY = 296, - OP_CHDIR = 297, - OP_CHOWN = 298, - OP_CHROOT = 299, - OP_UNLINK = 300, - OP_CHMOD = 301, - OP_UTIME = 302, - OP_RENAME = 303, - OP_LINK = 304, - OP_SYMLINK = 305, - OP_READLINK = 306, - OP_MKDIR = 307, - OP_RMDIR = 308, - OP_OPEN_DIR = 309, - OP_READDIR = 310, - OP_TELLDIR = 311, - OP_SEEKDIR = 312, - OP_REWINDDIR = 313, - OP_CLOSEDIR = 314, - OP_FORK = 315, - OP_WAIT = 316, - OP_WAITPID = 317, - OP_SYSTEM = 318, - OP_EXEC = 319, - OP_KILL = 320, - OP_GETPPID = 321, - OP_GETPGRP = 322, - OP_SETPGRP = 323, - OP_GETPRIORITY = 324, - OP_SETPRIORITY = 325, - OP_TIME = 326, - OP_TMS = 327, - OP_LOCALTIME = 328, - OP_GMTIME = 329, - OP_ALARM = 330, - OP_SLEEP = 331, - OP_SHMGET = 332, - OP_SHMCTL = 333, - OP_SHMREAD = 334, - OP_SHMWRITE = 335, - OP_MSGGET = 336, - OP_MSGCTL = 337, - OP_MSGSND = 338, - OP_MSGRCV = 339, - OP_SEMOP = 340, - OP_SEMGET = 341, - OP_SEMCTL = 342, - OP_REQUIRE = 343, - OP_DOFILE = 344, - OP_HINTSEVAL = 345, - OP_ENTEREVAL = 346, - OP_LEAVEEVAL = 347, - OP_ENTERTRY = 348, - OP_LEAVETRY = 349, - OP_GHBYNAME = 350, - OP_GHBYADDR = 351, - OP_GHOSTENT = 352, - OP_GNBYNAME = 353, - OP_GNBYADDR = 354, - OP_GNETENT = 355, - OP_GPBYNAME = 356, - OP_GPBYNUMBER = 357, - OP_GPROTOENT = 358, - OP_GSBYNAME = 359, - OP_GSBYPORT = 360, - OP_GSERVENT = 361, - OP_SHOSTENT = 362, - OP_SNETENT = 363, - OP_SPROTOENT = 364, - OP_SSERVENT = 365, - OP_EHOSTENT = 366, - OP_ENETENT = 367, - OP_EPROTOENT = 368, - OP_ESERVENT = 369, - OP_GPWNAM = 370, - OP_GPWUID = 371, - OP_GPWENT = 372, - OP_SPWENT = 373, - OP_EPWENT = 374, - OP_GGRNAM = 375, - OP_GGRGID = 376, - OP_GGRENT = 377, - OP_SGRENT = 378, - OP_EGRENT = 379, - OP_GETLOGIN = 380, - OP_SYSCALL = 381, - OP_LOCK = 382, - OP_ONCE = 383, - OP_CUSTOM = 384, - OP_COREARGS = 385, - OP_AVHVSWITCH = 386, - OP_RUNCV = 387, - OP_FC = 388, - OP_PADCV = 389, - OP_INTROCV = 390, - OP_CLONECV = 391, - OP_PADRANGE = 392, - OP_REFASSIGN = 393, - OP_LVREF = 394, - OP_LVREFSLICE = 395, - OP_LVAVREF = 396, - OP_ANONCONST = 397, - OP_ISA = 398, - OP_CMPCHAIN_AND = 399, - OP_CMPCHAIN_DUP = 400, - OP_ENTERTRYCATCH = 401, - OP_LEAVETRYCATCH = 402, - OP_POPTRY = 403, - OP_CATCH = 404, - OP_PUSHDEFER = 405, - OP_IS_BOOL = 406, - OP_IS_WEAK = 407, - OP_WEAKEN = 408, - OP_UNWEAKEN = 409, - OP_BLESSED = 410, - OP_REFADDR = 411, - OP_REFTYPE = 412, - OP_CEIL = 413, - OP_FLOOR = 414, - OP_IS_TAINTED = 415, - OP_HELEMEXISTSOR = 416, - OP_METHSTART = 417, - OP_INITFIELD = 418, - OP_CLASSNAME = 419, + OP_ENTERGIVEN = 224, + OP_LEAVEGIVEN = 225, + OP_ENTERWHEN = 226, + OP_LEAVEWHEN = 227, + OP_BREAK = 228, + OP_CONTINUE = 229, + OP_OPEN = 230, + OP_CLOSE = 231, + OP_PIPE_OP = 232, + OP_FILENO = 233, + OP_UMASK = 234, + OP_BINMODE = 235, + OP_TIE = 236, + OP_UNTIE = 237, + OP_TIED = 238, + OP_DBMOPEN = 239, + OP_DBMCLOSE = 240, + OP_SSELECT = 241, + OP_SELECT = 242, + OP_GETC = 243, + OP_READ = 244, + OP_ENTERWRITE = 245, + OP_LEAVEWRITE = 246, + OP_PRTF = 247, + OP_PRINT = 248, + OP_SAY = 249, + OP_SYSOPEN = 250, + OP_SYSSEEK = 251, + OP_SYSREAD = 252, + OP_SYSWRITE = 253, + OP_EOF = 254, + OP_TELL = 255, + OP_SEEK = 256, + OP_TRUNCATE = 257, + OP_FCNTL = 258, + OP_IOCTL = 259, + OP_FLOCK = 260, + OP_SEND = 261, + OP_RECV = 262, + OP_SOCKET = 263, + OP_SOCKPAIR = 264, + OP_BIND = 265, + OP_CONNECT = 266, + OP_LISTEN = 267, + OP_ACCEPT = 268, + OP_SHUTDOWN = 269, + OP_GSOCKOPT = 270, + OP_SSOCKOPT = 271, + OP_GETSOCKNAME = 272, + OP_GETPEERNAME = 273, + OP_LSTAT = 274, + OP_STAT = 275, + OP_FTRREAD = 276, + OP_FTRWRITE = 277, + OP_FTREXEC = 278, + OP_FTEREAD = 279, + OP_FTEWRITE = 280, + OP_FTEEXEC = 281, + OP_FTIS = 282, + OP_FTSIZE = 283, + OP_FTMTIME = 284, + OP_FTATIME = 285, + OP_FTCTIME = 286, + OP_FTROWNED = 287, + OP_FTEOWNED = 288, + OP_FTZERO = 289, + OP_FTSOCK = 290, + OP_FTCHR = 291, + OP_FTBLK = 292, + OP_FTFILE = 293, + OP_FTDIR = 294, + OP_FTPIPE = 295, + OP_FTSUID = 296, + OP_FTSGID = 297, + OP_FTSVTX = 298, + OP_FTLINK = 299, + OP_FTTTY = 300, + OP_FTTEXT = 301, + OP_FTBINARY = 302, + OP_CHDIR = 303, + OP_CHOWN = 304, + OP_CHROOT = 305, + OP_UNLINK = 306, + OP_CHMOD = 307, + OP_UTIME = 308, + OP_RENAME = 309, + OP_LINK = 310, + OP_SYMLINK = 311, + OP_READLINK = 312, + OP_MKDIR = 313, + OP_RMDIR = 314, + OP_OPEN_DIR = 315, + OP_READDIR = 316, + OP_TELLDIR = 317, + OP_SEEKDIR = 318, + OP_REWINDDIR = 319, + OP_CLOSEDIR = 320, + OP_FORK = 321, + OP_WAIT = 322, + OP_WAITPID = 323, + OP_SYSTEM = 324, + OP_EXEC = 325, + OP_KILL = 326, + OP_GETPPID = 327, + OP_GETPGRP = 328, + OP_SETPGRP = 329, + OP_GETPRIORITY = 330, + OP_SETPRIORITY = 331, + OP_TIME = 332, + OP_TMS = 333, + OP_LOCALTIME = 334, + OP_GMTIME = 335, + OP_ALARM = 336, + OP_SLEEP = 337, + OP_SHMGET = 338, + OP_SHMCTL = 339, + OP_SHMREAD = 340, + OP_SHMWRITE = 341, + OP_MSGGET = 342, + OP_MSGCTL = 343, + OP_MSGSND = 344, + OP_MSGRCV = 345, + OP_SEMOP = 346, + OP_SEMGET = 347, + OP_SEMCTL = 348, + OP_REQUIRE = 349, + OP_DOFILE = 350, + OP_HINTSEVAL = 351, + OP_ENTEREVAL = 352, + OP_LEAVEEVAL = 353, + OP_ENTERTRY = 354, + OP_LEAVETRY = 355, + OP_GHBYNAME = 356, + OP_GHBYADDR = 357, + OP_GHOSTENT = 358, + OP_GNBYNAME = 359, + OP_GNBYADDR = 360, + OP_GNETENT = 361, + OP_GPBYNAME = 362, + OP_GPBYNUMBER = 363, + OP_GPROTOENT = 364, + OP_GSBYNAME = 365, + OP_GSBYPORT = 366, + OP_GSERVENT = 367, + OP_SHOSTENT = 368, + OP_SNETENT = 369, + OP_SPROTOENT = 370, + OP_SSERVENT = 371, + OP_EHOSTENT = 372, + OP_ENETENT = 373, + OP_EPROTOENT = 374, + OP_ESERVENT = 375, + OP_GPWNAM = 376, + OP_GPWUID = 377, + OP_GPWENT = 378, + OP_SPWENT = 379, + OP_EPWENT = 380, + OP_GGRNAM = 381, + OP_GGRGID = 382, + OP_GGRENT = 383, + OP_SGRENT = 384, + OP_EGRENT = 385, + OP_GETLOGIN = 386, + OP_SYSCALL = 387, + OP_LOCK = 388, + OP_ONCE = 389, + OP_CUSTOM = 390, + OP_COREARGS = 391, + OP_AVHVSWITCH = 392, + OP_RUNCV = 393, + OP_FC = 394, + OP_PADCV = 395, + OP_INTROCV = 396, + OP_CLONECV = 397, + OP_PADRANGE = 398, + OP_REFASSIGN = 399, + OP_LVREF = 400, + OP_LVREFSLICE = 401, + OP_LVAVREF = 402, + OP_ANONCONST = 403, + OP_ISA = 404, + OP_CMPCHAIN_AND = 405, + OP_CMPCHAIN_DUP = 406, + OP_ENTERTRYCATCH = 407, + OP_LEAVETRYCATCH = 408, + OP_POPTRY = 409, + OP_CATCH = 410, + OP_PUSHDEFER = 411, + OP_IS_BOOL = 412, + OP_IS_WEAK = 413, + OP_WEAKEN = 414, + OP_UNWEAKEN = 415, + OP_BLESSED = 416, + OP_REFADDR = 417, + OP_REFTYPE = 418, + OP_CEIL = 419, + OP_FLOOR = 420, + OP_IS_TAINTED = 421, + OP_HELEMEXISTSOR = 422, + OP_METHSTART = 423, + OP_INITFIELD = 424, + OP_CLASSNAME = 425, OP_max } opcode; @@ -444,7 +450,7 @@ An enum of all the legal Perl opcodes, defined in F =cut */ -#define MAXO 420 +#define MAXO 426 #define OP_FREED MAXO /* the OP_IS_* macros are optimized to a simple range check because diff --git a/perl.h b/perl.h index bd2cff628782..fd12a5e62d35 100644 --- a/perl.h +++ b/perl.h @@ -5679,7 +5679,9 @@ EXTCONST unsigned char PL_latin1_lc[]; #ifdef DOINIT EXTCONST char* const PL_block_type[] = { "NULL", + "WHEN", "BLOCK", + "GIVEN", "LOOP_ARY", "LOOP_LAZYSV", "LOOP_LAZYIV", diff --git a/perly.act b/perly.act index 957e0e15e643..f24a95340306 100644 --- a/perly.act +++ b/perly.act @@ -5,7 +5,7 @@ */ case 2: /* @1: %empty */ -#line 160 "perly.y" +#line 161 "perly.y" { parser->expect = XSTATE; (yyval.ival) = 0; @@ -14,7 +14,7 @@ case 2: /* @1: %empty */ break; case 3: /* grammar: GRAMPROG @1 remember stmtseq */ -#line 165 "perly.y" +#line 166 "perly.y" { newPROG(block_end((ps[-1].val.ival),(ps[0].val.opval))); PL_compiling.cop_seq = 0; @@ -24,7 +24,7 @@ case 2: /* @1: %empty */ break; case 4: /* @2: %empty */ -#line 171 "perly.y" +#line 172 "perly.y" { parser->expect = XTERM; (yyval.ival) = 0; @@ -33,7 +33,7 @@ case 2: /* @1: %empty */ break; case 5: /* grammar: GRAMEXPR @2 optexpr */ -#line 176 "perly.y" +#line 177 "perly.y" { PL_eval_root = (ps[0].val.opval); (yyval.ival) = 0; @@ -42,7 +42,7 @@ case 2: /* @1: %empty */ break; case 6: /* @3: %empty */ -#line 181 "perly.y" +#line 182 "perly.y" { parser->expect = XBLOCK; (yyval.ival) = 0; @@ -51,7 +51,7 @@ case 2: /* @1: %empty */ break; case 7: /* grammar: GRAMBLOCK @3 block */ -#line 186 "perly.y" +#line 187 "perly.y" { PL_pad_reset_pending = TRUE; PL_eval_root = (ps[0].val.opval); @@ -63,7 +63,7 @@ case 2: /* @1: %empty */ break; case 8: /* @4: %empty */ -#line 194 "perly.y" +#line 195 "perly.y" { parser->expect = XSTATE; (yyval.ival) = 0; @@ -72,7 +72,7 @@ case 2: /* @1: %empty */ break; case 9: /* grammar: GRAMBARESTMT @4 barestmt */ -#line 199 "perly.y" +#line 200 "perly.y" { PL_pad_reset_pending = TRUE; PL_eval_root = (ps[0].val.opval); @@ -84,7 +84,7 @@ case 2: /* @1: %empty */ break; case 10: /* @5: %empty */ -#line 207 "perly.y" +#line 208 "perly.y" { parser->expect = XSTATE; (yyval.ival) = 0; @@ -93,7 +93,7 @@ case 2: /* @1: %empty */ break; case 11: /* grammar: GRAMFULLSTMT @5 fullstmt */ -#line 212 "perly.y" +#line 213 "perly.y" { PL_pad_reset_pending = TRUE; PL_eval_root = (ps[0].val.opval); @@ -105,7 +105,7 @@ case 2: /* @1: %empty */ break; case 12: /* @6: %empty */ -#line 220 "perly.y" +#line 221 "perly.y" { parser->expect = XSTATE; (yyval.ival) = 0; @@ -114,7 +114,7 @@ case 2: /* @1: %empty */ break; case 13: /* grammar: GRAMSTMTSEQ @6 stmtseq */ -#line 225 "perly.y" +#line 226 "perly.y" { PL_eval_root = (ps[0].val.opval); (yyval.ival) = 0; @@ -123,7 +123,7 @@ case 2: /* @1: %empty */ break; case 14: /* @7: %empty */ -#line 230 "perly.y" +#line 231 "perly.y" { parser->expect = XSTATE; (yyval.ival) = 0; @@ -132,7 +132,7 @@ case 2: /* @1: %empty */ break; case 15: /* grammar: GRAMSUBSIGNATURE @7 subsigguts */ -#line 235 "perly.y" +#line 236 "perly.y" { PL_eval_root = (ps[0].val.opval); (yyval.ival) = 0; @@ -141,19 +141,19 @@ case 2: /* @1: %empty */ break; case 16: /* sigsub_or_method_named: KW_SUB_named_sig */ -#line 244 "perly.y" +#line 245 "perly.y" { (yyval.ival) = KW_SUB_named_sig; } break; case 17: /* sigsub_or_method_named: KW_METHOD_named */ -#line 246 "perly.y" +#line 247 "perly.y" { (yyval.ival) = KW_METHOD_named; } break; case 18: /* block: PERLY_BRACE_OPEN remember stmtseq PERLY_BRACE_CLOSE */ -#line 251 "perly.y" +#line 252 "perly.y" { if (parser->copline > (line_t)(ps[-3].val.ival)) parser->copline = (line_t)(ps[-3].val.ival); (yyval.opval) = block_end((ps[-2].val.ival), (ps[-1].val.opval)); @@ -162,13 +162,13 @@ case 2: /* @1: %empty */ break; case 19: /* empty: %empty */ -#line 258 "perly.y" +#line 259 "perly.y" { (yyval.opval) = NULL; } break; case 20: /* formblock: PERLY_EQUAL_SIGN remember PERLY_SEMICOLON FORMRBRACK formstmtseq PERLY_SEMICOLON PERLY_DOT */ -#line 263 "perly.y" +#line 264 "perly.y" { if (parser->copline > (line_t)(ps[-6].val.ival)) parser->copline = (line_t)(ps[-6].val.ival); (yyval.opval) = block_end((ps[-5].val.ival), (ps[-2].val.opval)); @@ -177,14 +177,14 @@ case 2: /* @1: %empty */ break; case 21: /* remember: %empty */ -#line 270 "perly.y" +#line 271 "perly.y" { (yyval.ival) = block_start(TRUE); parser->parsed_sub = 0; } break; case 22: /* mblock: PERLY_BRACE_OPEN mremember stmtseq PERLY_BRACE_CLOSE */ -#line 275 "perly.y" +#line 276 "perly.y" { if (parser->copline > (line_t)(ps[-3].val.ival)) parser->copline = (line_t)(ps[-3].val.ival); (yyval.opval) = block_end((ps[-2].val.ival), (ps[-1].val.opval)); @@ -193,32 +193,32 @@ case 2: /* @1: %empty */ break; case 23: /* mremember: %empty */ -#line 282 "perly.y" +#line 283 "perly.y" { (yyval.ival) = block_start(FALSE); parser->parsed_sub = 0; } break; case 25: /* $@8: %empty */ -#line 291 "perly.y" +#line 292 "perly.y" { parser->in_my = 1; } break; case 26: /* $@9: %empty */ -#line 293 "perly.y" +#line 294 "perly.y" { parser->in_my = 0; intro_my(); } break; case 27: /* catch_paren: PERLY_PAREN_OPEN $@8 scalar $@9 PERLY_PAREN_CLOSE */ -#line 295 "perly.y" +#line 296 "perly.y" { (yyval.opval) = (ps[-2].val.opval); } break; case 29: /* stmtseq: stmtseq fullstmt */ -#line 302 "perly.y" +#line 303 "perly.y" { (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-1].val.opval), (ps[0].val.opval)); PL_pad_reset_pending = TRUE; if ((ps[-1].val.opval) && (ps[0].val.opval)) @@ -228,7 +228,7 @@ case 2: /* @1: %empty */ break; case 31: /* formstmtseq: formstmtseq formline */ -#line 313 "perly.y" +#line 314 "perly.y" { (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-1].val.opval), (ps[0].val.opval)); PL_pad_reset_pending = TRUE; if ((ps[-1].val.opval) && (ps[0].val.opval)) @@ -238,7 +238,7 @@ case 2: /* @1: %empty */ break; case 32: /* fullstmt: barestmt */ -#line 322 "perly.y" +#line 323 "perly.y" { (yyval.opval) = (ps[0].val.opval) ? newSTATEOP(0, NULL, (ps[0].val.opval)) : NULL; } @@ -246,13 +246,13 @@ case 2: /* @1: %empty */ break; case 33: /* fullstmt: labfullstmt */ -#line 326 "perly.y" +#line 327 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; case 34: /* labfullstmt: LABEL barestmt */ -#line 330 "perly.y" +#line 331 "perly.y" { SV *label = cSVOPx_sv((ps[-1].val.opval)); (yyval.opval) = newSTATEOP(SvFLAGS(label) & SVf_UTF8, @@ -263,7 +263,7 @@ case 2: /* @1: %empty */ break; case 35: /* labfullstmt: LABEL labfullstmt */ -#line 337 "perly.y" +#line 338 "perly.y" { SV *label = cSVOPx_sv((ps[-1].val.opval)); (yyval.opval) = newSTATEOP(SvFLAGS(label) & SVf_UTF8, @@ -274,13 +274,13 @@ case 2: /* @1: %empty */ break; case 36: /* barestmt: PLUGSTMT */ -#line 347 "perly.y" +#line 348 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; case 37: /* barestmt: KW_FORMAT startformsub formname formblock */ -#line 349 "perly.y" +#line 350 "perly.y" { CV *fmtcv = PL_compcv; newFORM((ps[-2].val.ival), (ps[-1].val.opval), (ps[0].val.opval)); @@ -294,7 +294,7 @@ case 2: /* @1: %empty */ break; case 38: /* $@10: %empty */ -#line 361 "perly.y" +#line 362 "perly.y" { init_named_cv(PL_compcv, (ps[-1].val.opval)); parser->in_my = 0; @@ -304,7 +304,7 @@ case 2: /* @1: %empty */ break; case 39: /* barestmt: KW_SUB_named subname startsub $@10 proto subattrlist optsubbody */ -#line 367 "perly.y" +#line 368 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); (ps[-5].val.opval)->op_type == OP_CONST @@ -319,7 +319,7 @@ case 2: /* @1: %empty */ break; case 40: /* $@11: %empty */ -#line 382 "perly.y" +#line 383 "perly.y" { init_named_cv(PL_compcv, (ps[-1].val.opval)); if((ps[-2].val.ival) == KW_METHOD_named) { @@ -333,7 +333,7 @@ case 2: /* @1: %empty */ break; case 41: /* barestmt: sigsub_or_method_named subname startsub $@11 subattrlist optsigsubbody */ -#line 392 "perly.y" +#line 393 "perly.y" { OP *body = (ps[0].val.opval); @@ -350,7 +350,7 @@ case 2: /* @1: %empty */ break; case 42: /* $@12: %empty */ -#line 405 "perly.y" +#line 406 "perly.y" { switch((ps[-1].val.ival)) { case KEY_ADJUST: @@ -365,7 +365,7 @@ case 2: /* @1: %empty */ break; case 43: /* barestmt: PHASER startsub $@12 optsubbody */ -#line 416 "perly.y" +#line 417 "perly.y" { OP *body = (ps[0].val.opval); SvREFCNT_inc_simple_void(PL_compcv); @@ -384,7 +384,7 @@ case 2: /* @1: %empty */ break; case 44: /* barestmt: KW_PACKAGE BAREWORD BAREWORD PERLY_SEMICOLON */ -#line 435 "perly.y" +#line 436 "perly.y" { package((ps[-1].val.opval)); if ((ps[-2].val.opval)) @@ -395,7 +395,7 @@ case 2: /* @1: %empty */ break; case 45: /* barestmt: KW_CLASS BAREWORD BAREWORD subattrlist PERLY_SEMICOLON */ -#line 442 "perly.y" +#line 443 "perly.y" { package((ps[-2].val.opval)); if ((ps[-3].val.opval)) @@ -410,13 +410,13 @@ case 2: /* @1: %empty */ break; case 46: /* $@13: %empty */ -#line 453 "perly.y" +#line 454 "perly.y" { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ } break; case 47: /* barestmt: KW_USE_or_NO startsub $@13 BAREWORD BAREWORD optlistexpr PERLY_SEMICOLON */ -#line 457 "perly.y" +#line 458 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); utilize((ps[-6].val.ival), (ps[-5].val.ival), (ps[-3].val.opval), (ps[-2].val.opval), (ps[-1].val.opval)); @@ -427,7 +427,7 @@ case 2: /* @1: %empty */ break; case 48: /* barestmt: KW_IF PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock else */ -#line 464 "perly.y" +#line 465 "perly.y" { (yyval.opval) = block_end((ps[-4].val.ival), newCONDOP(0, (ps[-3].val.opval), op_scope((ps[-1].val.opval)), (ps[0].val.opval))); @@ -437,7 +437,7 @@ case 2: /* @1: %empty */ break; case 49: /* barestmt: KW_UNLESS PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock else */ -#line 470 "perly.y" +#line 471 "perly.y" { (yyval.opval) = block_end((ps[-4].val.ival), newCONDOP(0, (ps[-3].val.opval), (ps[0].val.opval), op_scope((ps[-1].val.opval)))); @@ -446,8 +446,29 @@ case 2: /* @1: %empty */ break; - case 50: /* barestmt: KW_WHILE PERLY_PAREN_OPEN remember texpr PERLY_PAREN_CLOSE mintro mblock cont */ -#line 476 "perly.y" + case 50: /* barestmt: KW_GIVEN PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock */ +#line 477 "perly.y" + { + (yyval.opval) = block_end((ps[-3].val.ival), newGIVENOP((ps[-2].val.opval), op_scope((ps[0].val.opval)), 0)); + parser->copline = (line_t)(ps[-5].val.ival); + } + + break; + + case 51: /* barestmt: KW_WHEN PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock */ +#line 482 "perly.y" + { (yyval.opval) = block_end((ps[-3].val.ival), newWHENOP((ps[-2].val.opval), op_scope((ps[0].val.opval)))); } + + break; + + case 52: /* barestmt: KW_DEFAULT block */ +#line 484 "perly.y" + { (yyval.opval) = newWHENOP(0, op_scope((ps[0].val.opval))); } + + break; + + case 53: /* barestmt: KW_WHILE PERLY_PAREN_OPEN remember texpr PERLY_PAREN_CLOSE mintro mblock cont */ +#line 486 "perly.y" { (yyval.opval) = block_end((ps[-5].val.ival), newWHILEOP(0, 1, NULL, @@ -457,8 +478,8 @@ case 2: /* @1: %empty */ break; - case 51: /* barestmt: KW_UNTIL PERLY_PAREN_OPEN remember iexpr PERLY_PAREN_CLOSE mintro mblock cont */ -#line 483 "perly.y" + case 54: /* barestmt: KW_UNTIL PERLY_PAREN_OPEN remember iexpr PERLY_PAREN_CLOSE mintro mblock cont */ +#line 493 "perly.y" { (yyval.opval) = block_end((ps[-5].val.ival), newWHILEOP(0, 1, NULL, @@ -468,20 +489,20 @@ case 2: /* @1: %empty */ break; - case 52: /* $@14: %empty */ -#line 490 "perly.y" + case 55: /* $@14: %empty */ +#line 500 "perly.y" { parser->expect = XTERM; } break; - case 53: /* $@15: %empty */ -#line 492 "perly.y" + case 56: /* $@15: %empty */ +#line 502 "perly.y" { parser->expect = XTERM; } break; - case 54: /* barestmt: KW_FOR PERLY_PAREN_OPEN remember mnexpr PERLY_SEMICOLON $@14 texpr PERLY_SEMICOLON $@15 mintro mnexpr PERLY_PAREN_CLOSE mblock */ -#line 495 "perly.y" + case 57: /* barestmt: KW_FOR PERLY_PAREN_OPEN remember mnexpr PERLY_SEMICOLON $@14 texpr PERLY_SEMICOLON $@15 mintro mnexpr PERLY_PAREN_CLOSE mblock */ +#line 505 "perly.y" { OP *initop = (ps[-9].val.opval); OP *forop = newWHILEOP(0, 1, NULL, @@ -499,8 +520,8 @@ case 2: /* @1: %empty */ break; - case 55: /* barestmt: KW_FOR KW_MY remember my_scalar PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont */ -#line 510 "perly.y" + case 58: /* barestmt: KW_FOR KW_MY remember my_scalar PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont */ +#line 520 "perly.y" { (yyval.opval) = block_end((ps[-6].val.ival), newFOROP(0, (ps[-5].val.opval), (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval))); parser->copline = (line_t)(ps[-8].val.ival); @@ -508,8 +529,8 @@ case 2: /* @1: %empty */ break; - case 56: /* barestmt: KW_FOR KW_MY remember PERLY_PAREN_OPEN my_list_of_scalars PERLY_PAREN_CLOSE PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont */ -#line 515 "perly.y" + case 59: /* barestmt: KW_FOR KW_MY remember PERLY_PAREN_OPEN my_list_of_scalars PERLY_PAREN_CLOSE PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont */ +#line 525 "perly.y" { if ((ps[-6].val.opval)->op_type == OP_PADSV) /* degenerate case of 1 var: for my ($x) .... @@ -521,8 +542,8 @@ case 2: /* @1: %empty */ break; - case 57: /* barestmt: KW_FOR scalar PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont */ -#line 524 "perly.y" + case 60: /* barestmt: KW_FOR scalar PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont */ +#line 534 "perly.y" { (yyval.opval) = block_end((ps[-4].val.ival), newFOROP(0, op_lvalue((ps[-6].val.opval), OP_ENTERLOOP), (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval))); @@ -531,14 +552,14 @@ case 2: /* @1: %empty */ break; - case 58: /* @16: %empty */ -#line 530 "perly.y" + case 61: /* @16: %empty */ +#line 540 "perly.y" { parser->in_my = 0; (yyval.opval) = my((ps[0].val.opval)); } break; - case 59: /* barestmt: KW_FOR my_refgen remember my_var @16 PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont */ -#line 532 "perly.y" + case 62: /* barestmt: KW_FOR my_refgen remember my_var @16 PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont */ +#line 542 "perly.y" { (yyval.opval) = block_end( (ps[-7].val.ival), @@ -554,8 +575,8 @@ case 2: /* @1: %empty */ break; - case 60: /* barestmt: KW_FOR REFGEN refgen_topic PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont */ -#line 545 "perly.y" + case 63: /* barestmt: KW_FOR REFGEN refgen_topic PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont */ +#line 555 "perly.y" { (yyval.opval) = block_end((ps[-4].val.ival), newFOROP( 0, op_lvalue(newUNOP(OP_REFGEN, 0, @@ -566,8 +587,8 @@ case 2: /* @1: %empty */ break; - case 61: /* barestmt: KW_FOR PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont */ -#line 553 "perly.y" + case 64: /* barestmt: KW_FOR PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont */ +#line 563 "perly.y" { (yyval.opval) = block_end((ps[-4].val.ival), newFOROP(0, NULL, (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval))); @@ -576,8 +597,8 @@ case 2: /* @1: %empty */ break; - case 62: /* $@17: %empty */ -#line 559 "perly.y" + case 65: /* $@17: %empty */ +#line 569 "perly.y" { if(!(ps[0].val.opval)) { yyerror("catch block requires a (VAR)"); @@ -587,8 +608,8 @@ case 2: /* @1: %empty */ break; - case 63: /* barestmt: KW_TRY mblock KW_CATCH remember catch_paren $@17 mblock finally */ -#line 566 "perly.y" + case 66: /* barestmt: KW_TRY mblock KW_CATCH remember catch_paren $@17 mblock finally */ +#line 576 "perly.y" { (yyval.opval) = newTRYCATCHOP(0, (ps[-6].val.opval), (ps[-3].val.opval), block_end((ps[-4].val.ival), op_scope((ps[-1].val.opval)))); @@ -599,8 +620,8 @@ case 2: /* @1: %empty */ break; - case 64: /* barestmt: block cont */ -#line 574 "perly.y" + case 67: /* barestmt: block cont */ +#line 584 "perly.y" { /* a block is a loop that happens once */ (yyval.opval) = newWHILEOP(0, 1, NULL, @@ -609,8 +630,8 @@ case 2: /* @1: %empty */ break; - case 65: /* $@18: %empty */ -#line 580 "perly.y" + case 68: /* $@18: %empty */ +#line 590 "perly.y" { package((ps[-2].val.opval)); if ((ps[-3].val.opval)) { @@ -620,8 +641,8 @@ case 2: /* @1: %empty */ break; - case 66: /* barestmt: KW_PACKAGE BAREWORD BAREWORD PERLY_BRACE_OPEN remember $@18 stmtseq PERLY_BRACE_CLOSE */ -#line 587 "perly.y" + case 69: /* barestmt: KW_PACKAGE BAREWORD BAREWORD PERLY_BRACE_OPEN remember $@18 stmtseq PERLY_BRACE_CLOSE */ +#line 597 "perly.y" { /* a block is a loop that happens once */ (yyval.opval) = newWHILEOP(0, 1, NULL, @@ -632,8 +653,8 @@ case 2: /* @1: %empty */ break; - case 67: /* $@19: %empty */ -#line 595 "perly.y" + case 70: /* $@19: %empty */ +#line 605 "perly.y" { package((ps[-3].val.opval)); @@ -648,8 +669,8 @@ case 2: /* @1: %empty */ break; - case 68: /* barestmt: KW_CLASS BAREWORD BAREWORD subattrlist PERLY_BRACE_OPEN remember $@19 stmtseq PERLY_BRACE_CLOSE */ -#line 607 "perly.y" + case 71: /* barestmt: KW_CLASS BAREWORD BAREWORD subattrlist PERLY_BRACE_OPEN remember $@19 stmtseq PERLY_BRACE_CLOSE */ +#line 617 "perly.y" { /* a block is a loop that happens once */ (yyval.opval) = newWHILEOP(0, 1, NULL, @@ -660,32 +681,32 @@ case 2: /* @1: %empty */ break; - case 69: /* barestmt: fielddecl PERLY_SEMICOLON */ -#line 615 "perly.y" + case 72: /* barestmt: fielddecl PERLY_SEMICOLON */ +#line 625 "perly.y" { (yyval.opval) = (ps[-1].val.opval); } break; - case 70: /* barestmt: sideff PERLY_SEMICOLON */ -#line 619 "perly.y" + case 73: /* barestmt: sideff PERLY_SEMICOLON */ +#line 629 "perly.y" { (yyval.opval) = (ps[-1].val.opval); } break; - case 71: /* barestmt: KW_DEFER mblock */ -#line 623 "perly.y" + case 74: /* barestmt: KW_DEFER mblock */ +#line 633 "perly.y" { (yyval.opval) = newDEFEROP(0, op_scope((ps[0].val.opval))); } break; - case 72: /* barestmt: YADAYADA PERLY_SEMICOLON */ -#line 627 "perly.y" + case 75: /* barestmt: YADAYADA PERLY_SEMICOLON */ +#line 637 "perly.y" { /* diag_listed_as: Unimplemented */ (yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0), @@ -694,8 +715,8 @@ case 2: /* @1: %empty */ break; - case 73: /* barestmt: PERLY_SEMICOLON */ -#line 633 "perly.y" + case 76: /* barestmt: PERLY_SEMICOLON */ +#line 643 "perly.y" { (yyval.opval) = NULL; parser->copline = NOLINE; @@ -703,8 +724,8 @@ case 2: /* @1: %empty */ break; - case 74: /* formline: THING formarg */ -#line 641 "perly.y" + case 77: /* formline: THING formarg */ +#line 651 "perly.y" { OP *list; if ((ps[0].val.opval)) { OP *term = (ps[0].val.opval); @@ -722,57 +743,63 @@ case 2: /* @1: %empty */ break; - case 76: /* formarg: FORMLBRACK stmtseq FORMRBRACK */ -#line 660 "perly.y" + case 79: /* formarg: FORMLBRACK stmtseq FORMRBRACK */ +#line 670 "perly.y" { (yyval.opval) = op_unscope((ps[-1].val.opval)); } break; - case 78: /* sideff: error */ -#line 668 "perly.y" + case 81: /* sideff: error */ +#line 678 "perly.y" { (yyval.opval) = NULL; } break; - case 79: /* sideff: expr */ -#line 670 "perly.y" + case 82: /* sideff: expr */ +#line 680 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 80: /* sideff: expr KW_IF condition */ -#line 672 "perly.y" + case 83: /* sideff: expr KW_IF condition */ +#line 682 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[0].val.opval), (ps[-2].val.opval)); } break; - case 81: /* sideff: expr KW_UNLESS condition */ -#line 674 "perly.y" + case 84: /* sideff: expr KW_UNLESS condition */ +#line 684 "perly.y" { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[0].val.opval), (ps[-2].val.opval)); } break; - case 82: /* sideff: expr KW_WHILE condition */ -#line 676 "perly.y" + case 85: /* sideff: expr KW_WHILE condition */ +#line 686 "perly.y" { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, scalar((ps[0].val.opval)), (ps[-2].val.opval)); } break; - case 83: /* sideff: expr KW_UNTIL iexpr */ -#line 678 "perly.y" + case 86: /* sideff: expr KW_UNTIL iexpr */ +#line 688 "perly.y" { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, (ps[0].val.opval), (ps[-2].val.opval)); } break; - case 84: /* sideff: expr KW_FOR condition */ -#line 680 "perly.y" + case 87: /* sideff: expr KW_FOR condition */ +#line 690 "perly.y" { (yyval.opval) = newFOROP(0, NULL, (ps[0].val.opval), (ps[-2].val.opval), NULL); parser->copline = (line_t)(ps[-1].val.ival); } break; - case 86: /* else: KW_ELSE mblock */ -#line 688 "perly.y" + case 88: /* sideff: expr KW_WHEN condition */ +#line 693 "perly.y" + { (yyval.opval) = newWHENOP((ps[0].val.opval), op_scope((ps[-2].val.opval))); } + + break; + + case 90: /* else: KW_ELSE mblock */ +#line 700 "perly.y" { ((ps[0].val.opval))->op_flags |= OPf_PARENS; (yyval.opval) = op_scope((ps[0].val.opval)); @@ -780,8 +807,8 @@ case 2: /* @1: %empty */ break; - case 87: /* else: KW_ELSIF PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock else */ -#line 693 "perly.y" + case 91: /* else: KW_ELSIF PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock else */ +#line 705 "perly.y" { parser->copline = (line_t)(ps[-5].val.ival); (yyval.opval) = newCONDOP(0, newSTATEOP(OPf_SPECIAL,NULL,(ps[-3].val.opval)), @@ -791,94 +818,94 @@ case 2: /* @1: %empty */ break; - case 89: /* cont: KW_CONTINUE block */ -#line 705 "perly.y" + case 93: /* cont: KW_CONTINUE block */ +#line 717 "perly.y" { (yyval.opval) = op_scope((ps[0].val.opval)); } break; - case 90: /* finally: %empty */ -#line 710 "perly.y" + case 94: /* finally: %empty */ +#line 722 "perly.y" { (yyval.opval) = NULL; } break; - case 91: /* finally: KW_FINALLY block */ -#line 712 "perly.y" + case 95: /* finally: KW_FINALLY block */ +#line 724 "perly.y" { (yyval.opval) = op_scope((ps[0].val.opval)); } break; - case 92: /* mintro: %empty */ -#line 717 "perly.y" + case 96: /* mintro: %empty */ +#line 729 "perly.y" { (yyval.ival) = (PL_min_intro_pending && PL_max_intro_pending >= PL_min_intro_pending); intro_my(); } break; - case 95: /* texpr: %empty */ -#line 729 "perly.y" + case 99: /* texpr: %empty */ +#line 741 "perly.y" { YYSTYPE tmplval; (void)scan_num("1", &tmplval); (yyval.opval) = tmplval.opval; } break; - case 97: /* iexpr: expr */ -#line 737 "perly.y" + case 101: /* iexpr: expr */ +#line 749 "perly.y" { (yyval.opval) = invert(scalar((ps[0].val.opval))); } break; - case 98: /* mexpr: expr */ -#line 742 "perly.y" + case 102: /* mexpr: expr */ +#line 754 "perly.y" { (yyval.opval) = (ps[0].val.opval); intro_my(); } break; - case 99: /* mnexpr: nexpr */ -#line 746 "perly.y" + case 103: /* mnexpr: nexpr */ +#line 758 "perly.y" { (yyval.opval) = (ps[0].val.opval); intro_my(); } break; - case 100: /* formname: BAREWORD */ -#line 749 "perly.y" + case 104: /* formname: BAREWORD */ +#line 761 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 102: /* startsub: %empty */ -#line 754 "perly.y" + case 106: /* startsub: %empty */ +#line 766 "perly.y" { (yyval.ival) = start_subparse(FALSE, 0); SAVEFREESV(PL_compcv); } break; - case 103: /* startanonsub: %empty */ -#line 760 "perly.y" + case 107: /* startanonsub: %empty */ +#line 772 "perly.y" { (yyval.ival) = start_subparse(FALSE, CVf_ANON); SAVEFREESV(PL_compcv); } break; - case 104: /* startanonmethod: %empty */ -#line 765 "perly.y" + case 108: /* startanonmethod: %empty */ +#line 777 "perly.y" { (yyval.ival) = start_subparse(FALSE, CVf_ANON|CVf_IsMETHOD); SAVEFREESV(PL_compcv); } break; - case 105: /* startformsub: %empty */ -#line 770 "perly.y" + case 109: /* startformsub: %empty */ +#line 782 "perly.y" { (yyval.ival) = start_subparse(TRUE, 0); SAVEFREESV(PL_compcv); } break; - case 111: /* subattrlist: COLONATTR THING */ -#line 789 "perly.y" + case 115: /* subattrlist: COLONATTR THING */ +#line 801 "perly.y" { OP *attrlist = (ps[0].val.opval); if(attrlist && !PL_parser->sig_seen) @@ -888,50 +915,50 @@ case 2: /* @1: %empty */ break; - case 112: /* subattrlist: COLONATTR */ -#line 796 "perly.y" + case 116: /* subattrlist: COLONATTR */ +#line 808 "perly.y" { (yyval.opval) = NULL; } break; - case 113: /* myattrlist: COLONATTR THING */ -#line 801 "perly.y" + case 117: /* myattrlist: COLONATTR THING */ +#line 813 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 114: /* myattrlist: COLONATTR */ -#line 803 "perly.y" + case 118: /* myattrlist: COLONATTR */ +#line 815 "perly.y" { (yyval.opval) = NULL; } break; - case 115: /* sigvarname: %empty */ -#line 814 "perly.y" + case 119: /* sigvarname: %empty */ +#line 826 "perly.y" { parser->in_my = 0; (yyval.opval) = NULL; } break; - case 116: /* sigvarname: PRIVATEREF */ -#line 816 "perly.y" + case 120: /* sigvarname: PRIVATEREF */ +#line 828 "perly.y" { parser->in_my = 0; (yyval.opval) = (ps[0].val.opval); } break; - case 117: /* sigslurpsigil: PERLY_SNAIL */ -#line 821 "perly.y" + case 121: /* sigslurpsigil: PERLY_SNAIL */ +#line 833 "perly.y" { (yyval.ival) = '@'; } break; - case 118: /* sigslurpsigil: PERLY_PERCENT_SIGN */ -#line 823 "perly.y" + case 122: /* sigslurpsigil: PERLY_PERCENT_SIGN */ +#line 835 "perly.y" { (yyval.ival) = '%'; } break; - case 119: /* sigslurpelem: sigslurpsigil sigvarname */ -#line 827 "perly.y" + case 123: /* sigslurpelem: sigslurpsigil sigvarname */ +#line 839 "perly.y" { subsignature_append_slurpy((ps[-1].val.ival), (ps[0].val.opval)); (yyval.opval) = NULL; @@ -939,24 +966,24 @@ case 2: /* @1: %empty */ break; - case 120: /* sigslurpelem: sigslurpsigil sigvarname ASSIGNOP */ -#line 832 "perly.y" + case 124: /* sigslurpelem: sigslurpsigil sigvarname ASSIGNOP */ +#line 844 "perly.y" { yyerror("A slurpy parameter may not have a default value"); } break; - case 121: /* sigslurpelem: sigslurpsigil sigvarname ASSIGNOP term */ -#line 836 "perly.y" + case 125: /* sigslurpelem: sigslurpsigil sigvarname ASSIGNOP term */ +#line 848 "perly.y" { yyerror("A slurpy parameter may not have a default value"); } break; - case 122: /* sigscalarelem: PERLY_DOLLAR sigvarname */ -#line 844 "perly.y" + case 126: /* sigscalarelem: PERLY_DOLLAR sigvarname */ +#line 856 "perly.y" { subsignature_append_positional((ps[0].val.opval), 0, NULL); (yyval.opval) = NULL; @@ -964,8 +991,8 @@ case 2: /* @1: %empty */ break; - case 123: /* sigscalarelem: PERLY_DOLLAR sigvarname ASSIGNOP */ -#line 849 "perly.y" + case 127: /* sigscalarelem: PERLY_DOLLAR sigvarname ASSIGNOP */ +#line 861 "perly.y" { subsignature_append_positional((ps[-1].val.opval), (ps[0].val.ival), newOP(OP_NULL, 0)); (yyval.opval) = NULL; @@ -973,8 +1000,8 @@ case 2: /* @1: %empty */ break; - case 124: /* sigscalarelem: PERLY_DOLLAR sigvarname ASSIGNOP term */ -#line 854 "perly.y" + case 128: /* sigscalarelem: PERLY_DOLLAR sigvarname ASSIGNOP term */ +#line 866 "perly.y" { subsignature_append_positional((ps[-2].val.opval), (ps[-1].val.ival), (ps[0].val.opval)); (yyval.opval) = NULL; @@ -982,26 +1009,26 @@ case 2: /* @1: %empty */ break; - case 125: /* sigelem: sigscalarelem */ -#line 863 "perly.y" + case 129: /* sigelem: sigscalarelem */ +#line 875 "perly.y" { parser->in_my = KEY_sigvar; (yyval.opval) = (ps[0].val.opval); } break; - case 126: /* sigelem: sigslurpelem */ -#line 865 "perly.y" + case 130: /* sigelem: sigslurpelem */ +#line 877 "perly.y" { parser->in_my = KEY_sigvar; (yyval.opval) = (ps[0].val.opval); } break; - case 134: /* subsignature: PERLY_PAREN_OPEN subsigguts PERLY_PAREN_CLOSE */ -#line 891 "perly.y" + case 138: /* subsignature: PERLY_PAREN_OPEN subsigguts PERLY_PAREN_CLOSE */ +#line 903 "perly.y" { (yyval.opval) = (ps[-1].val.opval); } break; - case 135: /* $@20: %empty */ -#line 894 "perly.y" + case 139: /* $@20: %empty */ +#line 906 "perly.y" { ENTER; subsignature_start(); @@ -1010,8 +1037,8 @@ case 2: /* @1: %empty */ break; - case 136: /* subsigguts: $@20 optsiglist */ -#line 900 "perly.y" + case 140: /* subsigguts: $@20 optsiglist */ +#line 912 "perly.y" { if (!FEATURE_SIGNATURES_IS_ENABLED && !CvIsMETHOD(PL_compcv)) Perl_croak(aTHX_ "Experimental " @@ -1038,14 +1065,14 @@ case 2: /* @1: %empty */ break; - case 138: /* optsubbody: PERLY_SEMICOLON */ -#line 928 "perly.y" + case 142: /* optsubbody: PERLY_SEMICOLON */ +#line 940 "perly.y" { (yyval.opval) = NULL; } break; - case 139: /* subbody: remember PERLY_BRACE_OPEN stmtseq PERLY_BRACE_CLOSE */ -#line 934 "perly.y" + case 143: /* subbody: remember PERLY_BRACE_OPEN stmtseq PERLY_BRACE_CLOSE */ +#line 946 "perly.y" { if (parser->copline > (line_t)(ps[-2].val.ival)) parser->copline = (line_t)(ps[-2].val.ival); @@ -1054,20 +1081,20 @@ case 2: /* @1: %empty */ break; - case 141: /* optsigsubbody: PERLY_SEMICOLON */ -#line 946 "perly.y" + case 145: /* optsigsubbody: PERLY_SEMICOLON */ +#line 958 "perly.y" { (yyval.opval) = NULL; } break; - case 142: /* $@21: %empty */ -#line 951 "perly.y" + case 146: /* $@21: %empty */ +#line 963 "perly.y" { PL_parser->sig_seen = FALSE; } break; - case 143: /* sigsubbody: remember optsubsignature PERLY_BRACE_OPEN $@21 stmtseq PERLY_BRACE_CLOSE */ -#line 953 "perly.y" + case 147: /* sigsubbody: remember optsubsignature PERLY_BRACE_OPEN $@21 stmtseq PERLY_BRACE_CLOSE */ +#line 965 "perly.y" { if (parser->copline > (line_t)(ps[-3].val.ival)) parser->copline = (line_t)(ps[-3].val.ival); @@ -1077,38 +1104,38 @@ case 2: /* @1: %empty */ break; - case 144: /* expr: expr ANDOP expr */ -#line 964 "perly.y" + case 148: /* expr: expr ANDOP expr */ +#line 976 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 145: /* expr: expr PLUGIN_LOGICAL_AND_LOW_OP expr */ -#line 966 "perly.y" + case 149: /* expr: expr PLUGIN_LOGICAL_AND_LOW_OP expr */ +#line 978 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 146: /* expr: expr OROP expr */ -#line 968 "perly.y" + case 150: /* expr: expr OROP expr */ +#line 980 "perly.y" { (yyval.opval) = newLOGOP((ps[-1].val.ival), 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 147: /* expr: expr PLUGIN_LOGICAL_OR_LOW_OP expr */ -#line 970 "perly.y" + case 151: /* expr: expr PLUGIN_LOGICAL_OR_LOW_OP expr */ +#line 982 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 149: /* listexpr: listexpr PERLY_COMMA */ -#line 976 "perly.y" + case 153: /* listexpr: listexpr PERLY_COMMA */ +#line 988 "perly.y" { (yyval.opval) = (ps[-1].val.opval); } break; - case 150: /* listexpr: listexpr PERLY_COMMA term */ -#line 978 "perly.y" + case 154: /* listexpr: listexpr PERLY_COMMA term */ +#line 990 "perly.y" { OP* term = (ps[0].val.opval); (yyval.opval) = op_append_elem(OP_LIST, (ps[-2].val.opval), term); @@ -1116,32 +1143,32 @@ case 2: /* @1: %empty */ break; - case 152: /* listop: LSTOP indirob listexpr */ -#line 987 "perly.y" + case 156: /* listop: LSTOP indirob listexpr */ +#line 999 "perly.y" { (yyval.opval) = op_convert_list((ps[-2].val.ival), OPf_STACKED, op_prepend_elem(OP_LIST, newGVREF((ps[-2].val.ival),(ps[-1].val.opval)), (ps[0].val.opval)) ); } break; - case 153: /* listop: BLKLSTOP block listexpr */ -#line 991 "perly.y" + case 157: /* listop: BLKLSTOP block listexpr */ +#line 1003 "perly.y" { (yyval.opval) = op_convert_list((ps[-2].val.ival), OPf_STACKED, op_prepend_elem(OP_LIST, newUNOP(OP_NULL, 0, op_scope((ps[-1].val.opval))), (ps[0].val.opval)) ); } break; - case 154: /* listop: FUNC PERLY_PAREN_OPEN indirob expr PERLY_PAREN_CLOSE */ -#line 995 "perly.y" + case 158: /* listop: FUNC PERLY_PAREN_OPEN indirob expr PERLY_PAREN_CLOSE */ +#line 1007 "perly.y" { (yyval.opval) = op_convert_list((ps[-4].val.ival), OPf_STACKED, op_prepend_elem(OP_LIST, newGVREF((ps[-4].val.ival),(ps[-2].val.opval)), (ps[-1].val.opval)) ); } break; - case 155: /* listop: term ARROW methodname PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ -#line 999 "perly.y" + case 159: /* listop: term ARROW methodname PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ +#line 1011 "perly.y" { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, scalar((ps[-5].val.opval)), (ps[-1].val.opval)), @@ -1150,8 +1177,8 @@ case 2: /* @1: %empty */ break; - case 156: /* listop: term ARROW methodname */ -#line 1005 "perly.y" + case 160: /* listop: term ARROW methodname */ +#line 1017 "perly.y" { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, scalar((ps[-2].val.opval)), newMETHOP(OP_METHOD, 0, (ps[0].val.opval)))); @@ -1159,8 +1186,8 @@ case 2: /* @1: %empty */ break; - case 157: /* listop: term ARROW PERLY_AMPERSAND subname PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ -#line 1010 "perly.y" + case 161: /* listop: term ARROW PERLY_AMPERSAND subname PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ +#line 1022 "perly.y" { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, scalar((ps[-6].val.opval)), (ps[-1].val.opval)), @@ -1169,8 +1196,8 @@ case 2: /* @1: %empty */ break; - case 158: /* listop: term ARROW PERLY_AMPERSAND subname */ -#line 1016 "perly.y" + case 162: /* listop: term ARROW PERLY_AMPERSAND subname */ +#line 1028 "perly.y" { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, scalar((ps[-3].val.opval)), @@ -1179,8 +1206,8 @@ case 2: /* @1: %empty */ break; - case 159: /* listop: METHCALL0 indirob optlistexpr */ -#line 1022 "perly.y" + case 163: /* listop: METHCALL0 indirob optlistexpr */ +#line 1034 "perly.y" { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[-1].val.opval), (ps[0].val.opval)), @@ -1189,8 +1216,8 @@ case 2: /* @1: %empty */ break; - case 160: /* listop: METHCALL indirob PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ -#line 1028 "perly.y" + case 164: /* listop: METHCALL indirob PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ +#line 1040 "perly.y" { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[-3].val.opval), (ps[-1].val.opval)), @@ -1199,26 +1226,26 @@ case 2: /* @1: %empty */ break; - case 161: /* listop: LSTOP optlistexpr */ -#line 1034 "perly.y" + case 165: /* listop: LSTOP optlistexpr */ +#line 1046 "perly.y" { (yyval.opval) = op_convert_list((ps[-1].val.ival), 0, (ps[0].val.opval)); } break; - case 162: /* listop: FUNC PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ -#line 1036 "perly.y" + case 166: /* listop: FUNC PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE */ +#line 1048 "perly.y" { (yyval.opval) = op_convert_list((ps[-3].val.ival), 0, (ps[-1].val.opval)); } break; - case 163: /* listop: FUNC SUBLEXSTART optexpr SUBLEXEND */ -#line 1038 "perly.y" + case 167: /* listop: FUNC SUBLEXSTART optexpr SUBLEXEND */ +#line 1050 "perly.y" { (yyval.opval) = op_convert_list((ps[-3].val.ival), 0, (ps[-1].val.opval)); } break; - case 164: /* @22: %empty */ -#line 1040 "perly.y" + case 168: /* @22: %empty */ +#line 1052 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); (yyval.opval) = newANONATTRSUB((ps[-1].val.ival), 0, NULL, (ps[0].val.opval)); /* prevent double op_free() if the following fails to parse */ @@ -1227,8 +1254,8 @@ case 2: /* @1: %empty */ break; - case 165: /* listop: LSTOPSUB startanonsub block @22 optlistexpr */ -#line 1046 "perly.y" + case 169: /* listop: LSTOPSUB startanonsub block @22 optlistexpr */ +#line 1058 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, op_prepend_elem(OP_LIST, (ps[-1].val.opval), (ps[0].val.opval)), (ps[-4].val.opval))); @@ -1236,21 +1263,21 @@ case 2: /* @1: %empty */ break; - case 168: /* subscripted: gelem PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ -#line 1061 "perly.y" + case 172: /* subscripted: gelem PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ +#line 1073 "perly.y" { (yyval.opval) = newBINOP(OP_GELEM, 0, (ps[-4].val.opval), scalar((ps[-2].val.opval))); } break; - case 169: /* subscripted: scalar PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1063 "perly.y" + case 173: /* subscripted: scalar PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1075 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, oopsAV((ps[-3].val.opval)), scalar((ps[-1].val.opval))); } break; - case 170: /* subscripted: term ARROW PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1066 "perly.y" + case 174: /* subscripted: term ARROW PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1078 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[-4].val.opval)),OP_RV2AV), scalar((ps[-1].val.opval))); @@ -1258,8 +1285,8 @@ case 2: /* @1: %empty */ break; - case 171: /* subscripted: subscripted PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1071 "perly.y" + case 175: /* subscripted: subscripted PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1083 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((ps[-3].val.opval)),OP_RV2AV), scalar((ps[-1].val.opval))); @@ -1267,31 +1294,31 @@ case 2: /* @1: %empty */ break; - case 172: /* subscripted: scalar PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ -#line 1076 "perly.y" + case 176: /* subscripted: scalar PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ +#line 1088 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((ps[-4].val.opval)), jmaybe((ps[-2].val.opval))); } break; - case 173: /* subscripted: term ARROW PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ -#line 1079 "perly.y" + case 177: /* subscripted: term ARROW PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ +#line 1091 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[-5].val.opval)),OP_RV2HV), jmaybe((ps[-2].val.opval))); } break; - case 174: /* subscripted: subscripted PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ -#line 1083 "perly.y" + case 178: /* subscripted: subscripted PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ +#line 1095 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((ps[-4].val.opval)),OP_RV2HV), jmaybe((ps[-2].val.opval))); } break; - case 175: /* subscripted: term ARROW PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1087 "perly.y" + case 179: /* subscripted: term ARROW PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1099 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((ps[-3].val.opval)))); if (parser->expect == XBLOCK) @@ -1300,8 +1327,8 @@ case 2: /* @1: %empty */ break; - case 176: /* subscripted: term ARROW PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ -#line 1093 "perly.y" + case 180: /* subscripted: term ARROW PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ +#line 1105 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[-1].val.opval), newCVREF(0, scalar((ps[-4].val.opval))))); @@ -1311,8 +1338,8 @@ case 2: /* @1: %empty */ break; - case 177: /* subscripted: subscripted PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ -#line 1101 "perly.y" + case 181: /* subscripted: subscripted PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ +#line 1113 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[-1].val.opval), newCVREF(0, scalar((ps[-3].val.opval))))); @@ -1322,8 +1349,8 @@ case 2: /* @1: %empty */ break; - case 178: /* subscripted: subscripted PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1108 "perly.y" + case 182: /* subscripted: subscripted PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1120 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((ps[-2].val.opval)))); if (parser->expect == XBLOCK) @@ -1332,56 +1359,56 @@ case 2: /* @1: %empty */ break; - case 179: /* subscripted: PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1114 "perly.y" + case 183: /* subscripted: PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1126 "perly.y" { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-4].val.opval)); } break; - case 180: /* subscripted: QWLIST PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1116 "perly.y" + case 184: /* subscripted: QWLIST PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1128 "perly.y" { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-3].val.opval)); } break; - case 181: /* subscripted: PERLY_PAREN_OPEN PERLY_PAREN_CLOSE PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1118 "perly.y" + case 185: /* subscripted: PERLY_PAREN_OPEN PERLY_PAREN_CLOSE PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1130 "perly.y" { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), NULL); } break; - case 182: /* termbinop: term PLUGIN_HIGH_OP term */ -#line 1123 "perly.y" + case 186: /* termbinop: term PLUGIN_HIGH_OP term */ +#line 1135 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 183: /* termbinop: term ASSIGNOP term */ -#line 1125 "perly.y" + case 187: /* termbinop: term ASSIGNOP term */ +#line 1137 "perly.y" { (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[-2].val.opval), (ps[-1].val.ival), (ps[0].val.opval)); } break; - case 184: /* termbinop: term PLUGIN_ASSIGN_OP term */ -#line 1127 "perly.y" + case 188: /* termbinop: term PLUGIN_ASSIGN_OP term */ +#line 1139 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 185: /* termbinop: term POWOP term */ -#line 1129 "perly.y" + case 189: /* termbinop: term POWOP term */ +#line 1141 "perly.y" { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 186: /* termbinop: term PLUGIN_POW_OP term */ -#line 1131 "perly.y" + case 190: /* termbinop: term PLUGIN_POW_OP term */ +#line 1143 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 187: /* termbinop: term MULOP term */ -#line 1133 "perly.y" + case 191: /* termbinop: term MULOP term */ +#line 1145 "perly.y" { if ((ps[-1].val.ival) != OP_REPEAT) scalar((ps[-2].val.opval)); (yyval.opval) = newBINOP((ps[-1].val.ival), 0, (ps[-2].val.opval), scalar((ps[0].val.opval))); @@ -1389,220 +1416,220 @@ case 2: /* @1: %empty */ break; - case 188: /* termbinop: term PLUGIN_MUL_OP term */ -#line 1138 "perly.y" + case 192: /* termbinop: term PLUGIN_MUL_OP term */ +#line 1150 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 189: /* termbinop: term ADDOP term */ -#line 1140 "perly.y" + case 193: /* termbinop: term ADDOP term */ +#line 1152 "perly.y" { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 190: /* termbinop: term PLUGIN_ADD_OP term */ -#line 1142 "perly.y" + case 194: /* termbinop: term PLUGIN_ADD_OP term */ +#line 1154 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 191: /* termbinop: term SHIFTOP term */ -#line 1144 "perly.y" + case 195: /* termbinop: term SHIFTOP term */ +#line 1156 "perly.y" { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 192: /* termbinop: termrelop */ -#line 1146 "perly.y" + case 196: /* termbinop: termrelop */ +#line 1158 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 193: /* termbinop: termeqop */ -#line 1148 "perly.y" + case 197: /* termbinop: termeqop */ +#line 1160 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 194: /* termbinop: term BITANDOP term */ -#line 1150 "perly.y" + case 198: /* termbinop: term BITANDOP term */ +#line 1162 "perly.y" { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 195: /* termbinop: term BITOROP term */ -#line 1152 "perly.y" + case 199: /* termbinop: term BITOROP term */ +#line 1164 "perly.y" { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 196: /* termbinop: term DOTDOT term */ -#line 1154 "perly.y" + case 200: /* termbinop: term DOTDOT term */ +#line 1166 "perly.y" { (yyval.opval) = newRANGE((ps[-1].val.ival), scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 197: /* termbinop: term ANDAND term */ -#line 1156 "perly.y" + case 201: /* termbinop: term ANDAND term */ +#line 1168 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 198: /* termbinop: term PLUGIN_LOGICAL_AND_OP term */ -#line 1158 "perly.y" + case 202: /* termbinop: term PLUGIN_LOGICAL_AND_OP term */ +#line 1170 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 199: /* termbinop: term OROR term */ -#line 1160 "perly.y" + case 203: /* termbinop: term OROR term */ +#line 1172 "perly.y" { (yyval.opval) = newLOGOP((ps[-1].val.ival), 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 200: /* termbinop: term PLUGIN_LOGICAL_OR_OP term */ -#line 1162 "perly.y" + case 204: /* termbinop: term PLUGIN_LOGICAL_OR_OP term */ +#line 1174 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 201: /* termbinop: term DORDOR term */ -#line 1164 "perly.y" + case 205: /* termbinop: term DORDOR term */ +#line 1176 "perly.y" { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 202: /* termbinop: term MATCHOP term */ -#line 1166 "perly.y" + case 206: /* termbinop: term MATCHOP term */ +#line 1178 "perly.y" { (yyval.opval) = bind_match((ps[-1].val.ival), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 203: /* termbinop: term PLUGIN_LOW_OP term */ -#line 1168 "perly.y" + case 207: /* termbinop: term PLUGIN_LOW_OP term */ +#line 1180 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 204: /* termrelop: relopchain */ -#line 1172 "perly.y" + case 208: /* termrelop: relopchain */ +#line 1184 "perly.y" { (yyval.opval) = cmpchain_finish((ps[0].val.opval)); } break; - case 205: /* termrelop: term NCRELOP term */ -#line 1174 "perly.y" + case 209: /* termrelop: term NCRELOP term */ +#line 1186 "perly.y" { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 206: /* termrelop: termrelop NCRELOP */ -#line 1176 "perly.y" + case 210: /* termrelop: termrelop NCRELOP */ +#line 1188 "perly.y" { yyerror("syntax error"); YYERROR; } break; - case 207: /* termrelop: termrelop CHRELOP */ -#line 1178 "perly.y" + case 211: /* termrelop: termrelop CHRELOP */ +#line 1190 "perly.y" { yyerror("syntax error"); YYERROR; } break; - case 208: /* termrelop: term PLUGIN_REL_OP term */ -#line 1180 "perly.y" + case 212: /* termrelop: term PLUGIN_REL_OP term */ +#line 1192 "perly.y" { (yyval.opval) = build_infix_plugin((ps[-2].val.opval), (ps[0].val.opval), (ps[-1].val.pval)); } break; - case 209: /* relopchain: term CHRELOP term */ -#line 1184 "perly.y" + case 213: /* relopchain: term CHRELOP term */ +#line 1196 "perly.y" { (yyval.opval) = cmpchain_start((ps[-1].val.ival), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 210: /* relopchain: relopchain CHRELOP term */ -#line 1186 "perly.y" + case 214: /* relopchain: relopchain CHRELOP term */ +#line 1198 "perly.y" { (yyval.opval) = cmpchain_extend((ps[-1].val.ival), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 211: /* termeqop: eqopchain */ -#line 1190 "perly.y" + case 215: /* termeqop: eqopchain */ +#line 1202 "perly.y" { (yyval.opval) = cmpchain_finish((ps[0].val.opval)); } break; - case 212: /* termeqop: term NCEQOP term */ -#line 1192 "perly.y" + case 216: /* termeqop: term NCEQOP term */ +#line 1204 "perly.y" { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); } break; - case 213: /* termeqop: termeqop NCEQOP */ -#line 1194 "perly.y" + case 217: /* termeqop: termeqop NCEQOP */ +#line 1206 "perly.y" { yyerror("syntax error"); YYERROR; } break; - case 214: /* termeqop: termeqop CHEQOP */ -#line 1196 "perly.y" + case 218: /* termeqop: termeqop CHEQOP */ +#line 1208 "perly.y" { yyerror("syntax error"); YYERROR; } break; - case 215: /* eqopchain: term CHEQOP term */ -#line 1200 "perly.y" + case 219: /* eqopchain: term CHEQOP term */ +#line 1212 "perly.y" { (yyval.opval) = cmpchain_start((ps[-1].val.ival), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 216: /* eqopchain: eqopchain CHEQOP term */ -#line 1202 "perly.y" + case 220: /* eqopchain: eqopchain CHEQOP term */ +#line 1214 "perly.y" { (yyval.opval) = cmpchain_extend((ps[-1].val.ival), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 217: /* termunop: PERLY_MINUS term */ -#line 1207 "perly.y" + case 221: /* termunop: PERLY_MINUS term */ +#line 1219 "perly.y" { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((ps[0].val.opval))); } break; - case 218: /* termunop: PERLY_PLUS term */ -#line 1209 "perly.y" + case 222: /* termunop: PERLY_PLUS term */ +#line 1221 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 219: /* termunop: PERLY_EXCLAMATION_MARK term */ -#line 1212 "perly.y" + case 223: /* termunop: PERLY_EXCLAMATION_MARK term */ +#line 1224 "perly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[0].val.opval))); } break; - case 220: /* termunop: PERLY_TILDE term */ -#line 1214 "perly.y" + case 224: /* termunop: PERLY_TILDE term */ +#line 1226 "perly.y" { (yyval.opval) = newUNOP((ps[-1].val.ival), 0, scalar((ps[0].val.opval))); } break; - case 221: /* termunop: term POSTINC */ -#line 1216 "perly.y" + case 225: /* termunop: term POSTINC */ +#line 1228 "perly.y" { (yyval.opval) = newUNOP(OP_POSTINC, 0, op_lvalue(scalar((ps[-1].val.opval)), OP_POSTINC)); } break; - case 222: /* termunop: term POSTDEC */ -#line 1219 "perly.y" + case 226: /* termunop: term POSTDEC */ +#line 1231 "perly.y" { (yyval.opval) = newUNOP(OP_POSTDEC, 0, op_lvalue(scalar((ps[-1].val.opval)), OP_POSTDEC));} break; - case 223: /* termunop: term POSTJOIN */ -#line 1222 "perly.y" + case 227: /* termunop: term POSTJOIN */ +#line 1234 "perly.y" { (yyval.opval) = op_convert_list(OP_JOIN, 0, op_append_elem( OP_LIST, @@ -1616,48 +1643,48 @@ case 2: /* @1: %empty */ break; - case 224: /* termunop: PREINC term */ -#line 1233 "perly.y" + case 228: /* termunop: PREINC term */ +#line 1245 "perly.y" { (yyval.opval) = newUNOP(OP_PREINC, 0, op_lvalue(scalar((ps[0].val.opval)), OP_PREINC)); } break; - case 225: /* termunop: PREDEC term */ -#line 1236 "perly.y" + case 229: /* termunop: PREDEC term */ +#line 1248 "perly.y" { (yyval.opval) = newUNOP(OP_PREDEC, 0, op_lvalue(scalar((ps[0].val.opval)), OP_PREDEC)); } break; - case 226: /* anonymous: PERLY_BRACKET_OPEN optexpr PERLY_BRACKET_CLOSE */ -#line 1244 "perly.y" + case 230: /* anonymous: PERLY_BRACKET_OPEN optexpr PERLY_BRACKET_CLOSE */ +#line 1256 "perly.y" { (yyval.opval) = newANONLIST((ps[-1].val.opval)); } break; - case 227: /* anonymous: HASHBRACK optexpr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ -#line 1246 "perly.y" + case 231: /* anonymous: HASHBRACK optexpr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ +#line 1258 "perly.y" { (yyval.opval) = newANONHASH((ps[-2].val.opval)); } break; - case 228: /* anonymous: KW_SUB_anon startanonsub proto subattrlist subbody */ -#line 1248 "perly.y" + case 232: /* anonymous: KW_SUB_anon startanonsub proto subattrlist subbody */ +#line 1260 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); (yyval.opval) = newANONATTRSUB((ps[-3].val.ival), (ps[-2].val.opval), (ps[-1].val.opval), (ps[0].val.opval)); } break; - case 229: /* anonymous: KW_SUB_anon_sig startanonsub subattrlist sigsubbody */ -#line 1251 "perly.y" + case 233: /* anonymous: KW_SUB_anon_sig startanonsub subattrlist sigsubbody */ +#line 1263 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); (yyval.opval) = newANONATTRSUB((ps[-2].val.ival), NULL, (ps[-1].val.opval), (ps[0].val.opval)); } break; - case 230: /* anonymous: KW_METHOD_anon startanonmethod subattrlist sigsubbody */ -#line 1254 "perly.y" + case 234: /* anonymous: KW_METHOD_anon startanonmethod subattrlist sigsubbody */ +#line 1266 "perly.y" { SvREFCNT_inc_simple_void(PL_compcv); (yyval.opval) = newANONATTRSUB((ps[-2].val.ival), NULL, (ps[-1].val.opval), (ps[0].val.opval)); @@ -1665,98 +1692,98 @@ case 2: /* @1: %empty */ break; - case 231: /* termdo: KW_DO term */ -#line 1262 "perly.y" + case 235: /* termdo: KW_DO term */ +#line 1274 "perly.y" { (yyval.opval) = dofile((ps[0].val.opval), (ps[-1].val.ival));} break; - case 232: /* termdo: KW_DO block */ -#line 1264 "perly.y" + case 236: /* termdo: KW_DO block */ +#line 1276 "perly.y" { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, op_scope((ps[0].val.opval)));} break; - case 237: /* term: term PERLY_QUESTION_MARK term PERLY_COLON term */ -#line 1272 "perly.y" + case 241: /* term: term PERLY_QUESTION_MARK term PERLY_COLON term */ +#line 1284 "perly.y" { (yyval.opval) = newCONDOP(0, (ps[-4].val.opval), (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 238: /* term: REFGEN term */ -#line 1274 "perly.y" + case 242: /* term: REFGEN term */ +#line 1286 "perly.y" { (yyval.opval) = newUNOP(OP_REFGEN, 0, (ps[0].val.opval)); } break; - case 239: /* term: myattrterm */ -#line 1276 "perly.y" + case 243: /* term: myattrterm */ +#line 1288 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 240: /* term: KW_LOCAL term */ -#line 1278 "perly.y" + case 244: /* term: KW_LOCAL term */ +#line 1290 "perly.y" { (yyval.opval) = localize((ps[0].val.opval),0); } break; - case 241: /* term: PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ -#line 1280 "perly.y" + case 245: /* term: PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ +#line 1292 "perly.y" { (yyval.opval) = sawparens((ps[-1].val.opval)); } break; - case 242: /* term: QWLIST */ -#line 1282 "perly.y" + case 246: /* term: QWLIST */ +#line 1294 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 243: /* term: PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1284 "perly.y" + case 247: /* term: PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1296 "perly.y" { (yyval.opval) = sawparens(newNULLLIST()); } break; - case 244: /* term: scalar */ -#line 1286 "perly.y" + case 248: /* term: scalar */ +#line 1298 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 245: /* term: star */ -#line 1288 "perly.y" + case 249: /* term: star */ +#line 1300 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 246: /* term: hsh */ -#line 1290 "perly.y" + case 250: /* term: hsh */ +#line 1302 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 247: /* term: ary */ -#line 1292 "perly.y" + case 251: /* term: ary */ +#line 1304 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 248: /* term: arylen */ -#line 1294 "perly.y" + case 252: /* term: arylen */ +#line 1306 "perly.y" { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[0].val.opval), OP_AV2ARYLEN));} break; - case 249: /* term: subscripted */ -#line 1296 "perly.y" + case 253: /* term: subscripted */ +#line 1308 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 250: /* term: sliceme PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1298 "perly.y" + case 254: /* term: sliceme PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1310 "perly.y" { (yyval.opval) = op_prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -1769,8 +1796,8 @@ case 2: /* @1: %empty */ break; - case 251: /* term: kvslice PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ -#line 1308 "perly.y" + case 255: /* term: kvslice PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE */ +#line 1320 "perly.y" { (yyval.opval) = op_prepend_elem(OP_KVASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVASLICE, 0, @@ -1783,8 +1810,8 @@ case 2: /* @1: %empty */ break; - case 252: /* term: sliceme PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ -#line 1318 "perly.y" + case 256: /* term: sliceme PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ +#line 1330 "perly.y" { (yyval.opval) = op_prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -1797,8 +1824,8 @@ case 2: /* @1: %empty */ break; - case 253: /* term: kvslice PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ -#line 1328 "perly.y" + case 257: /* term: kvslice PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE */ +#line 1340 "perly.y" { (yyval.opval) = op_prepend_elem(OP_KVHSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVHSLICE, 0, @@ -1811,27 +1838,27 @@ case 2: /* @1: %empty */ break; - case 254: /* term: THING */ -#line 1338 "perly.y" + case 258: /* term: THING */ +#line 1350 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 255: /* term: amper */ -#line 1340 "perly.y" + case 259: /* term: amper */ +#line 1352 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((ps[0].val.opval))); } break; - case 256: /* term: amper PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1342 "perly.y" + case 260: /* term: amper PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1354 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[-2].val.opval))); } break; - case 257: /* term: amper PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ -#line 1345 "perly.y" + case 261: /* term: amper PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ +#line 1357 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[-1].val.opval), scalar((ps[-3].val.opval)))); @@ -1839,153 +1866,153 @@ case 2: /* @1: %empty */ break; - case 258: /* term: NOAMP subname optlistexpr */ -#line 1350 "perly.y" + case 262: /* term: NOAMP subname optlistexpr */ +#line 1362 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[0].val.opval), scalar((ps[-1].val.opval)))); } break; - case 259: /* term: term ARROW PERLY_DOLLAR PERLY_STAR */ -#line 1354 "perly.y" + case 263: /* term: term ARROW PERLY_DOLLAR PERLY_STAR */ +#line 1366 "perly.y" { (yyval.opval) = newSVREF((ps[-3].val.opval)); } break; - case 260: /* term: term ARROW PERLY_SNAIL PERLY_STAR */ -#line 1356 "perly.y" + case 264: /* term: term ARROW PERLY_SNAIL PERLY_STAR */ +#line 1368 "perly.y" { (yyval.opval) = newAVREF((ps[-3].val.opval)); } break; - case 261: /* term: term ARROW PERLY_PERCENT_SIGN PERLY_STAR */ -#line 1358 "perly.y" + case 265: /* term: term ARROW PERLY_PERCENT_SIGN PERLY_STAR */ +#line 1370 "perly.y" { (yyval.opval) = newHVREF((ps[-3].val.opval)); } break; - case 262: /* term: term ARROW PERLY_AMPERSAND PERLY_STAR */ -#line 1360 "perly.y" + case 266: /* term: term ARROW PERLY_AMPERSAND PERLY_STAR */ +#line 1372 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar(newCVREF((ps[-1].val.ival),(ps[-3].val.opval)))); } break; - case 263: /* term: term ARROW PERLY_STAR PERLY_STAR */ -#line 1363 "perly.y" + case 267: /* term: term ARROW PERLY_STAR PERLY_STAR */ +#line 1375 "perly.y" { (yyval.opval) = newGVREF(0,(ps[-3].val.opval)); } break; - case 264: /* term: LOOPEX */ -#line 1365 "perly.y" + case 268: /* term: LOOPEX */ +#line 1377 "perly.y" { (yyval.opval) = newOP((ps[0].val.ival), OPf_SPECIAL); PL_hints |= HINT_BLOCK_SCOPE; } break; - case 265: /* term: LOOPEX term */ -#line 1368 "perly.y" + case 269: /* term: LOOPEX term */ +#line 1380 "perly.y" { (yyval.opval) = newLOOPEX((ps[-1].val.ival),(ps[0].val.opval)); } break; - case 266: /* term: NOTOP listexpr */ -#line 1370 "perly.y" + case 270: /* term: NOTOP listexpr */ +#line 1382 "perly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[0].val.opval))); } break; - case 267: /* term: UNIOP */ -#line 1372 "perly.y" + case 271: /* term: UNIOP */ +#line 1384 "perly.y" { (yyval.opval) = newOP((ps[0].val.ival), 0); } break; - case 268: /* term: UNIOP block */ -#line 1374 "perly.y" + case 272: /* term: UNIOP block */ +#line 1386 "perly.y" { (yyval.opval) = newUNOP((ps[-1].val.ival), 0, (ps[0].val.opval)); } break; - case 269: /* term: UNIOP term */ -#line 1376 "perly.y" + case 273: /* term: UNIOP term */ +#line 1388 "perly.y" { (yyval.opval) = newUNOP((ps[-1].val.ival), 0, (ps[0].val.opval)); } break; - case 270: /* term: KW_REQUIRE */ -#line 1378 "perly.y" + case 274: /* term: KW_REQUIRE */ +#line 1390 "perly.y" { (yyval.opval) = newOP(OP_REQUIRE, (ps[0].val.ival) ? OPf_SPECIAL : 0); } break; - case 271: /* term: KW_REQUIRE term */ -#line 1380 "perly.y" + case 275: /* term: KW_REQUIRE term */ +#line 1392 "perly.y" { (yyval.opval) = newUNOP(OP_REQUIRE, (ps[-1].val.ival) ? OPf_SPECIAL : 0, (ps[0].val.opval)); } break; - case 272: /* term: UNIOPSUB */ -#line 1382 "perly.y" + case 276: /* term: UNIOPSUB */ +#line 1394 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[0].val.opval))); } break; - case 273: /* term: UNIOPSUB term */ -#line 1384 "perly.y" + case 277: /* term: UNIOPSUB term */ +#line 1396 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, op_append_elem(OP_LIST, (ps[0].val.opval), scalar((ps[-1].val.opval)))); } break; - case 274: /* term: FUNC0 */ -#line 1387 "perly.y" + case 278: /* term: FUNC0 */ +#line 1399 "perly.y" { (yyval.opval) = newOP((ps[0].val.ival), 0); } break; - case 275: /* term: FUNC0 PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1389 "perly.y" + case 279: /* term: FUNC0 PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1401 "perly.y" { (yyval.opval) = newOP((ps[-2].val.ival), 0);} break; - case 276: /* term: FUNC0OP */ -#line 1391 "perly.y" + case 280: /* term: FUNC0OP */ +#line 1403 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 277: /* term: FUNC0OP PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1393 "perly.y" + case 281: /* term: FUNC0OP PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1405 "perly.y" { (yyval.opval) = (ps[-2].val.opval); } break; - case 278: /* term: FUNC0SUB */ -#line 1395 "perly.y" + case 282: /* term: FUNC0SUB */ +#line 1407 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((ps[0].val.opval))); } break; - case 279: /* term: FUNC1 PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1397 "perly.y" + case 283: /* term: FUNC1 PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1409 "perly.y" { (yyval.opval) = ((ps[-2].val.ival) == OP_NOT) ? newUNOP((ps[-2].val.ival), 0, newSVOP(OP_CONST, 0, newSViv(0))) : newOP((ps[-2].val.ival), OPf_SPECIAL); } break; - case 280: /* term: FUNC1 PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ -#line 1401 "perly.y" + case 284: /* term: FUNC1 PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ +#line 1413 "perly.y" { (yyval.opval) = newUNOP((ps[-3].val.ival), 0, (ps[-1].val.opval)); } break; - case 281: /* @23: %empty */ -#line 1403 "perly.y" + case 285: /* @23: %empty */ +#line 1415 "perly.y" { if ( (ps[0].val.opval)->op_type != OP_TRANS && (ps[0].val.opval)->op_type != OP_TRANSR @@ -1999,68 +2026,68 @@ case 2: /* @1: %empty */ break; - case 282: /* term: PMFUNC @23 SUBLEXSTART listexpr optrepl SUBLEXEND */ -#line 1414 "perly.y" + case 286: /* term: PMFUNC @23 SUBLEXSTART listexpr optrepl SUBLEXEND */ +#line 1426 "perly.y" { (yyval.opval) = pmruntime((ps[-5].val.opval), (ps[-2].val.opval), (ps[-1].val.opval), 1, (ps[-4].val.ival)); } break; - case 286: /* myattrterm: KW_MY myterm myattrlist */ -#line 1423 "perly.y" + case 290: /* myattrterm: KW_MY myterm myattrlist */ +#line 1435 "perly.y" { (yyval.opval) = my_attrs((ps[-1].val.opval),(ps[0].val.opval)); } break; - case 287: /* myattrterm: KW_MY myterm */ -#line 1425 "perly.y" + case 291: /* myattrterm: KW_MY myterm */ +#line 1437 "perly.y" { (yyval.opval) = localize((ps[0].val.opval),1); } break; - case 288: /* myattrterm: KW_MY REFGEN myterm myattrlist */ -#line 1427 "perly.y" + case 292: /* myattrterm: KW_MY REFGEN myterm myattrlist */ +#line 1439 "perly.y" { (yyval.opval) = newUNOP(OP_REFGEN, 0, my_attrs((ps[-1].val.opval),(ps[0].val.opval))); } break; - case 289: /* myattrterm: KW_MY REFGEN term */ -#line 1429 "perly.y" + case 293: /* myattrterm: KW_MY REFGEN term */ +#line 1441 "perly.y" { (yyval.opval) = newUNOP(OP_REFGEN, 0, localize((ps[0].val.opval),1)); } break; - case 290: /* myterm: PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ -#line 1434 "perly.y" + case 294: /* myterm: PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE */ +#line 1446 "perly.y" { (yyval.opval) = sawparens((ps[-1].val.opval)); } break; - case 291: /* myterm: PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ -#line 1436 "perly.y" + case 295: /* myterm: PERLY_PAREN_OPEN PERLY_PAREN_CLOSE */ +#line 1448 "perly.y" { (yyval.opval) = sawparens(newNULLLIST()); } break; - case 292: /* myterm: scalar */ -#line 1439 "perly.y" + case 296: /* myterm: scalar */ +#line 1451 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 293: /* myterm: hsh */ -#line 1441 "perly.y" + case 297: /* myterm: hsh */ +#line 1453 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 294: /* myterm: ary */ -#line 1443 "perly.y" + case 298: /* myterm: ary */ +#line 1455 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 295: /* fieldvar: scalar */ -#line 1448 "perly.y" + case 299: /* fieldvar: scalar */ +#line 1460 "perly.y" { (yyval.pval) = PadnamelistARRAY(PL_comppad_name)[(ps[0].val.opval)->op_targ]; op_free((ps[0].val.opval)); @@ -2068,8 +2095,8 @@ case 2: /* @1: %empty */ break; - case 296: /* fieldvar: hsh */ -#line 1453 "perly.y" + case 300: /* fieldvar: hsh */ +#line 1465 "perly.y" { (yyval.pval) = PadnamelistARRAY(PL_comppad_name)[(ps[0].val.opval)->op_targ]; op_free((ps[0].val.opval)); @@ -2077,8 +2104,8 @@ case 2: /* @1: %empty */ break; - case 297: /* fieldvar: ary */ -#line 1458 "perly.y" + case 301: /* fieldvar: ary */ +#line 1470 "perly.y" { (yyval.pval) = PadnamelistARRAY(PL_comppad_name)[(ps[0].val.opval)->op_targ]; op_free((ps[0].val.opval)); @@ -2086,20 +2113,20 @@ case 2: /* @1: %empty */ break; - case 298: /* optfieldattrlist: COLONATTR THING */ -#line 1466 "perly.y" + case 302: /* optfieldattrlist: COLONATTR THING */ +#line 1478 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 299: /* optfieldattrlist: COLONATTR */ -#line 1468 "perly.y" + case 303: /* optfieldattrlist: COLONATTR */ +#line 1480 "perly.y" { (yyval.opval) = NULL; } break; - case 301: /* fielddecl: KW_FIELD fieldvar optfieldattrlist */ -#line 1474 "perly.y" + case 305: /* fielddecl: KW_FIELD fieldvar optfieldattrlist */ +#line 1486 "perly.y" { parser->in_my = 0; if((ps[0].val.opval)) @@ -2109,8 +2136,8 @@ case 2: /* @1: %empty */ break; - case 302: /* $@24: %empty */ -#line 1481 "perly.y" + case 306: /* $@24: %empty */ +#line 1493 "perly.y" { parser->in_my = 0; if((ps[-1].val.opval)) @@ -2121,8 +2148,8 @@ case 2: /* @1: %empty */ break; - case 303: /* fielddecl: KW_FIELD fieldvar optfieldattrlist ASSIGNOP $@24 term */ -#line 1489 "perly.y" + case 307: /* fielddecl: KW_FIELD fieldvar optfieldattrlist ASSIGNOP $@24 term */ +#line 1501 "perly.y" { class_set_field_defop((PADNAME *)(ps[-4].val.pval), (ps[-2].val.ival), (ps[0].val.opval)); LEAVE; @@ -2131,122 +2158,122 @@ case 2: /* @1: %empty */ break; - case 309: /* optrepl: PERLY_SLASH expr */ -#line 1509 "perly.y" + case 313: /* optrepl: PERLY_SLASH expr */ +#line 1521 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; - case 310: /* my_scalar: scalar */ -#line 1515 "perly.y" + case 314: /* my_scalar: scalar */ +#line 1527 "perly.y" { parser->in_my = 0; (yyval.opval) = my((ps[0].val.opval)); } break; - case 311: /* list_of_scalars: list_of_scalars PERLY_COMMA */ -#line 1520 "perly.y" + case 315: /* list_of_scalars: list_of_scalars PERLY_COMMA */ +#line 1532 "perly.y" { (yyval.opval) = (ps[-1].val.opval); } break; - case 312: /* list_of_scalars: list_of_scalars PERLY_COMMA scalar */ -#line 1522 "perly.y" + case 316: /* list_of_scalars: list_of_scalars PERLY_COMMA scalar */ +#line 1534 "perly.y" { (yyval.opval) = op_append_elem(OP_LIST, (ps[-2].val.opval), (ps[0].val.opval)); } break; - case 314: /* my_list_of_scalars: list_of_scalars */ -#line 1529 "perly.y" + case 318: /* my_list_of_scalars: list_of_scalars */ +#line 1541 "perly.y" { parser->in_my = 0; (yyval.opval) = (ps[0].val.opval); } break; - case 322: /* amper: PERLY_AMPERSAND indirob */ -#line 1546 "perly.y" + case 326: /* amper: PERLY_AMPERSAND indirob */ +#line 1558 "perly.y" { (yyval.opval) = newCVREF((ps[-1].val.ival),(ps[0].val.opval)); } break; - case 323: /* scalar: PERLY_DOLLAR indirob */ -#line 1550 "perly.y" + case 327: /* scalar: PERLY_DOLLAR indirob */ +#line 1562 "perly.y" { (yyval.opval) = newSVREF((ps[0].val.opval)); } break; - case 324: /* ary: PERLY_SNAIL indirob */ -#line 1554 "perly.y" + case 328: /* ary: PERLY_SNAIL indirob */ +#line 1566 "perly.y" { (yyval.opval) = newAVREF((ps[0].val.opval)); if ((yyval.opval)) (yyval.opval)->op_private |= (ps[-1].val.ival); } break; - case 325: /* hsh: PERLY_PERCENT_SIGN indirob */ -#line 1560 "perly.y" + case 329: /* hsh: PERLY_PERCENT_SIGN indirob */ +#line 1572 "perly.y" { (yyval.opval) = newHVREF((ps[0].val.opval)); if ((yyval.opval)) (yyval.opval)->op_private |= (ps[-1].val.ival); } break; - case 326: /* arylen: DOLSHARP indirob */ -#line 1566 "perly.y" + case 330: /* arylen: DOLSHARP indirob */ +#line 1578 "perly.y" { (yyval.opval) = newAVREF((ps[0].val.opval)); } break; - case 327: /* arylen: term ARROW DOLSHARP PERLY_STAR */ -#line 1568 "perly.y" + case 331: /* arylen: term ARROW DOLSHARP PERLY_STAR */ +#line 1580 "perly.y" { (yyval.opval) = newAVREF((ps[-3].val.opval)); } break; - case 328: /* star: PERLY_STAR indirob */ -#line 1572 "perly.y" + case 332: /* star: PERLY_STAR indirob */ +#line 1584 "perly.y" { (yyval.opval) = newGVREF(0,(ps[0].val.opval)); } break; - case 330: /* sliceme: term ARROW PERLY_SNAIL */ -#line 1577 "perly.y" + case 334: /* sliceme: term ARROW PERLY_SNAIL */ +#line 1589 "perly.y" { (yyval.opval) = newAVREF((ps[-2].val.opval)); } break; - case 332: /* kvslice: term ARROW PERLY_PERCENT_SIGN */ -#line 1582 "perly.y" + case 336: /* kvslice: term ARROW PERLY_PERCENT_SIGN */ +#line 1594 "perly.y" { (yyval.opval) = newHVREF((ps[-2].val.opval)); } break; - case 334: /* gelem: term ARROW PERLY_STAR */ -#line 1587 "perly.y" + case 338: /* gelem: term ARROW PERLY_STAR */ +#line 1599 "perly.y" { (yyval.opval) = newGVREF(0,(ps[-2].val.opval)); } break; - case 335: /* indirob: BAREWORD */ -#line 1592 "perly.y" + case 339: /* indirob: BAREWORD */ +#line 1604 "perly.y" { (yyval.opval) = scalar((ps[0].val.opval)); } break; - case 336: /* indirob: scalar */ -#line 1594 "perly.y" + case 340: /* indirob: scalar */ +#line 1606 "perly.y" { (yyval.opval) = scalar((ps[0].val.opval)); } break; - case 337: /* indirob: block */ -#line 1596 "perly.y" + case 341: /* indirob: block */ +#line 1608 "perly.y" { (yyval.opval) = op_scope((ps[0].val.opval)); } break; - case 338: /* indirob: PRIVATEREF */ -#line 1599 "perly.y" + case 342: /* indirob: PRIVATEREF */ +#line 1611 "perly.y" { (yyval.opval) = (ps[0].val.opval); } break; @@ -2258,6 +2285,6 @@ case 2: /* @1: %empty */ /* Generated from: - * 0f40c00aa6e92910072b579304d07e319b034979bfaf4292495c7a23de0bd41a perly.y + * 453a810482a42d27feedcc7688cd6ced725b9dee5ec9d7dea0a8c789a368e038 perly.y * f13e9c08cea6302f0c1d1f467405bd0e0880d0ea92d0669901017a7f7e94ab28 regen_perly.pl * ex: set ro ft=c: */ diff --git a/perly.h b/perly.h index ad5130163a19..2b3905fa7f83 100644 --- a/perly.h +++ b/perly.h @@ -98,95 +98,98 @@ extern int yydebug; KW_UNTIL = 292, /* KW_UNTIL */ KW_WHILE = 293, /* KW_WHILE */ KW_CONTINUE = 294, /* KW_CONTINUE */ - KW_TRY = 295, /* KW_TRY */ - KW_CATCH = 296, /* KW_CATCH */ - KW_FINALLY = 297, /* KW_FINALLY */ - KW_DEFER = 298, /* KW_DEFER */ - KW_REQUIRE = 299, /* KW_REQUIRE */ - KW_DO = 300, /* KW_DO */ - KW_USE_or_NO = 301, /* KW_USE_or_NO */ - KW_SUB_named = 302, /* KW_SUB_named */ - KW_SUB_named_sig = 303, /* KW_SUB_named_sig */ - KW_SUB_anon = 304, /* KW_SUB_anon */ - KW_SUB_anon_sig = 305, /* KW_SUB_anon_sig */ - KW_METHOD_named = 306, /* KW_METHOD_named */ - KW_METHOD_anon = 307, /* KW_METHOD_anon */ - BAREWORD = 308, /* BAREWORD */ - METHCALL0 = 309, /* METHCALL0 */ - METHCALL = 310, /* METHCALL */ - THING = 311, /* THING */ - PMFUNC = 312, /* PMFUNC */ - PRIVATEREF = 313, /* PRIVATEREF */ - QWLIST = 314, /* QWLIST */ - FUNC0OP = 315, /* FUNC0OP */ - FUNC0SUB = 316, /* FUNC0SUB */ - UNIOPSUB = 317, /* UNIOPSUB */ - LSTOPSUB = 318, /* LSTOPSUB */ - PLUGEXPR = 319, /* PLUGEXPR */ - PLUGSTMT = 320, /* PLUGSTMT */ - LABEL = 321, /* LABEL */ - LOOPEX = 322, /* LOOPEX */ - DOTDOT = 323, /* DOTDOT */ - YADAYADA = 324, /* YADAYADA */ - FUNC0 = 325, /* FUNC0 */ - FUNC1 = 326, /* FUNC1 */ - FUNC = 327, /* FUNC */ - UNIOP = 328, /* UNIOP */ - LSTOP = 329, /* LSTOP */ - BLKLSTOP = 330, /* BLKLSTOP */ - POWOP = 331, /* POWOP */ - MULOP = 332, /* MULOP */ - ADDOP = 333, /* ADDOP */ - DOLSHARP = 334, /* DOLSHARP */ - HASHBRACK = 335, /* HASHBRACK */ - NOAMP = 336, /* NOAMP */ - COLONATTR = 337, /* COLONATTR */ - FORMLBRACK = 338, /* FORMLBRACK */ - FORMRBRACK = 339, /* FORMRBRACK */ - SUBLEXSTART = 340, /* SUBLEXSTART */ - SUBLEXEND = 341, /* SUBLEXEND */ - PHASER = 342, /* PHASER */ - PREC_LOW = 343, /* PREC_LOW */ - PLUGIN_LOW_OP = 344, /* PLUGIN_LOW_OP */ - OROP = 345, /* OROP */ - PLUGIN_LOGICAL_OR_LOW_OP = 346, /* PLUGIN_LOGICAL_OR_LOW_OP */ - ANDOP = 347, /* ANDOP */ - PLUGIN_LOGICAL_AND_LOW_OP = 348, /* PLUGIN_LOGICAL_AND_LOW_OP */ - NOTOP = 349, /* NOTOP */ - ASSIGNOP = 350, /* ASSIGNOP */ - PLUGIN_ASSIGN_OP = 351, /* PLUGIN_ASSIGN_OP */ - PERLY_QUESTION_MARK = 352, /* PERLY_QUESTION_MARK */ - PERLY_COLON = 353, /* PERLY_COLON */ - OROR = 354, /* OROR */ - DORDOR = 355, /* DORDOR */ - PLUGIN_LOGICAL_OR_OP = 356, /* PLUGIN_LOGICAL_OR_OP */ - ANDAND = 357, /* ANDAND */ - PLUGIN_LOGICAL_AND_OP = 358, /* PLUGIN_LOGICAL_AND_OP */ - BITOROP = 359, /* BITOROP */ - BITANDOP = 360, /* BITANDOP */ - CHEQOP = 361, /* CHEQOP */ - NCEQOP = 362, /* NCEQOP */ - CHRELOP = 363, /* CHRELOP */ - NCRELOP = 364, /* NCRELOP */ - PLUGIN_REL_OP = 365, /* PLUGIN_REL_OP */ - SHIFTOP = 366, /* SHIFTOP */ - PLUGIN_ADD_OP = 367, /* PLUGIN_ADD_OP */ - PLUGIN_MUL_OP = 368, /* PLUGIN_MUL_OP */ - MATCHOP = 369, /* MATCHOP */ - PERLY_EXCLAMATION_MARK = 370, /* PERLY_EXCLAMATION_MARK */ - PERLY_TILDE = 371, /* PERLY_TILDE */ - UMINUS = 372, /* UMINUS */ - REFGEN = 373, /* REFGEN */ - PLUGIN_POW_OP = 374, /* PLUGIN_POW_OP */ - PREINC = 375, /* PREINC */ - PREDEC = 376, /* PREDEC */ - POSTINC = 377, /* POSTINC */ - POSTDEC = 378, /* POSTDEC */ - POSTJOIN = 379, /* POSTJOIN */ - PLUGIN_HIGH_OP = 380, /* PLUGIN_HIGH_OP */ - ARROW = 381, /* ARROW */ - PERLY_PAREN_CLOSE = 382, /* PERLY_PAREN_CLOSE */ - PERLY_PAREN_OPEN = 383 /* PERLY_PAREN_OPEN */ + KW_GIVEN = 295, /* KW_GIVEN */ + KW_WHEN = 296, /* KW_WHEN */ + KW_DEFAULT = 297, /* KW_DEFAULT */ + KW_TRY = 298, /* KW_TRY */ + KW_CATCH = 299, /* KW_CATCH */ + KW_FINALLY = 300, /* KW_FINALLY */ + KW_DEFER = 301, /* KW_DEFER */ + KW_REQUIRE = 302, /* KW_REQUIRE */ + KW_DO = 303, /* KW_DO */ + KW_USE_or_NO = 304, /* KW_USE_or_NO */ + KW_SUB_named = 305, /* KW_SUB_named */ + KW_SUB_named_sig = 306, /* KW_SUB_named_sig */ + KW_SUB_anon = 307, /* KW_SUB_anon */ + KW_SUB_anon_sig = 308, /* KW_SUB_anon_sig */ + KW_METHOD_named = 309, /* KW_METHOD_named */ + KW_METHOD_anon = 310, /* KW_METHOD_anon */ + BAREWORD = 311, /* BAREWORD */ + METHCALL0 = 312, /* METHCALL0 */ + METHCALL = 313, /* METHCALL */ + THING = 314, /* THING */ + PMFUNC = 315, /* PMFUNC */ + PRIVATEREF = 316, /* PRIVATEREF */ + QWLIST = 317, /* QWLIST */ + FUNC0OP = 318, /* FUNC0OP */ + FUNC0SUB = 319, /* FUNC0SUB */ + UNIOPSUB = 320, /* UNIOPSUB */ + LSTOPSUB = 321, /* LSTOPSUB */ + PLUGEXPR = 322, /* PLUGEXPR */ + PLUGSTMT = 323, /* PLUGSTMT */ + LABEL = 324, /* LABEL */ + LOOPEX = 325, /* LOOPEX */ + DOTDOT = 326, /* DOTDOT */ + YADAYADA = 327, /* YADAYADA */ + FUNC0 = 328, /* FUNC0 */ + FUNC1 = 329, /* FUNC1 */ + FUNC = 330, /* FUNC */ + UNIOP = 331, /* UNIOP */ + LSTOP = 332, /* LSTOP */ + BLKLSTOP = 333, /* BLKLSTOP */ + POWOP = 334, /* POWOP */ + MULOP = 335, /* MULOP */ + ADDOP = 336, /* ADDOP */ + DOLSHARP = 337, /* DOLSHARP */ + HASHBRACK = 338, /* HASHBRACK */ + NOAMP = 339, /* NOAMP */ + COLONATTR = 340, /* COLONATTR */ + FORMLBRACK = 341, /* FORMLBRACK */ + FORMRBRACK = 342, /* FORMRBRACK */ + SUBLEXSTART = 343, /* SUBLEXSTART */ + SUBLEXEND = 344, /* SUBLEXEND */ + PHASER = 345, /* PHASER */ + PREC_LOW = 346, /* PREC_LOW */ + PLUGIN_LOW_OP = 347, /* PLUGIN_LOW_OP */ + OROP = 348, /* OROP */ + PLUGIN_LOGICAL_OR_LOW_OP = 349, /* PLUGIN_LOGICAL_OR_LOW_OP */ + ANDOP = 350, /* ANDOP */ + PLUGIN_LOGICAL_AND_LOW_OP = 351, /* PLUGIN_LOGICAL_AND_LOW_OP */ + NOTOP = 352, /* NOTOP */ + ASSIGNOP = 353, /* ASSIGNOP */ + PLUGIN_ASSIGN_OP = 354, /* PLUGIN_ASSIGN_OP */ + PERLY_QUESTION_MARK = 355, /* PERLY_QUESTION_MARK */ + PERLY_COLON = 356, /* PERLY_COLON */ + OROR = 357, /* OROR */ + DORDOR = 358, /* DORDOR */ + PLUGIN_LOGICAL_OR_OP = 359, /* PLUGIN_LOGICAL_OR_OP */ + ANDAND = 360, /* ANDAND */ + PLUGIN_LOGICAL_AND_OP = 361, /* PLUGIN_LOGICAL_AND_OP */ + BITOROP = 362, /* BITOROP */ + BITANDOP = 363, /* BITANDOP */ + CHEQOP = 364, /* CHEQOP */ + NCEQOP = 365, /* NCEQOP */ + CHRELOP = 366, /* CHRELOP */ + NCRELOP = 367, /* NCRELOP */ + PLUGIN_REL_OP = 368, /* PLUGIN_REL_OP */ + SHIFTOP = 369, /* SHIFTOP */ + PLUGIN_ADD_OP = 370, /* PLUGIN_ADD_OP */ + PLUGIN_MUL_OP = 371, /* PLUGIN_MUL_OP */ + MATCHOP = 372, /* MATCHOP */ + PERLY_EXCLAMATION_MARK = 373, /* PERLY_EXCLAMATION_MARK */ + PERLY_TILDE = 374, /* PERLY_TILDE */ + UMINUS = 375, /* UMINUS */ + REFGEN = 376, /* REFGEN */ + PLUGIN_POW_OP = 377, /* PLUGIN_POW_OP */ + PREINC = 378, /* PREINC */ + PREDEC = 379, /* PREDEC */ + POSTINC = 380, /* POSTINC */ + POSTDEC = 381, /* POSTDEC */ + POSTJOIN = 382, /* POSTJOIN */ + PLUGIN_HIGH_OP = 383, /* PLUGIN_HIGH_OP */ + ARROW = 384, /* ARROW */ + PERLY_PAREN_CLOSE = 385, /* PERLY_PAREN_CLOSE */ + PERLY_PAREN_OPEN = 386 /* PERLY_PAREN_OPEN */ }; typedef enum yytokentype yytoken_kind_t; #endif @@ -241,6 +244,6 @@ int yyparse (void); /* Generated from: - * 0f40c00aa6e92910072b579304d07e319b034979bfaf4292495c7a23de0bd41a perly.y + * 453a810482a42d27feedcc7688cd6ced725b9dee5ec9d7dea0a8c789a368e038 perly.y * f13e9c08cea6302f0c1d1f467405bd0e0880d0ea92d0669901017a7f7e94ab28 regen_perly.pl * ex: set ro ft=c: */ diff --git a/perly.tab b/perly.tab index a749fa3588b7..17a952b5351e 100644 --- a/perly.tab +++ b/perly.tab @@ -48,208 +48,211 @@ enum yysymbol_kind_t YYSYMBOL_KW_UNTIL = 37, /* KW_UNTIL */ YYSYMBOL_KW_WHILE = 38, /* KW_WHILE */ YYSYMBOL_KW_CONTINUE = 39, /* KW_CONTINUE */ - YYSYMBOL_KW_TRY = 40, /* KW_TRY */ - YYSYMBOL_KW_CATCH = 41, /* KW_CATCH */ - YYSYMBOL_KW_FINALLY = 42, /* KW_FINALLY */ - YYSYMBOL_KW_DEFER = 43, /* KW_DEFER */ - YYSYMBOL_KW_REQUIRE = 44, /* KW_REQUIRE */ - YYSYMBOL_KW_DO = 45, /* KW_DO */ - YYSYMBOL_KW_USE_or_NO = 46, /* KW_USE_or_NO */ - YYSYMBOL_KW_SUB_named = 47, /* KW_SUB_named */ - YYSYMBOL_KW_SUB_named_sig = 48, /* KW_SUB_named_sig */ - YYSYMBOL_KW_SUB_anon = 49, /* KW_SUB_anon */ - YYSYMBOL_KW_SUB_anon_sig = 50, /* KW_SUB_anon_sig */ - YYSYMBOL_KW_METHOD_named = 51, /* KW_METHOD_named */ - YYSYMBOL_KW_METHOD_anon = 52, /* KW_METHOD_anon */ - YYSYMBOL_BAREWORD = 53, /* BAREWORD */ - YYSYMBOL_METHCALL0 = 54, /* METHCALL0 */ - YYSYMBOL_METHCALL = 55, /* METHCALL */ - YYSYMBOL_THING = 56, /* THING */ - YYSYMBOL_PMFUNC = 57, /* PMFUNC */ - YYSYMBOL_PRIVATEREF = 58, /* PRIVATEREF */ - YYSYMBOL_QWLIST = 59, /* QWLIST */ - YYSYMBOL_FUNC0OP = 60, /* FUNC0OP */ - YYSYMBOL_FUNC0SUB = 61, /* FUNC0SUB */ - YYSYMBOL_UNIOPSUB = 62, /* UNIOPSUB */ - YYSYMBOL_LSTOPSUB = 63, /* LSTOPSUB */ - YYSYMBOL_PLUGEXPR = 64, /* PLUGEXPR */ - YYSYMBOL_PLUGSTMT = 65, /* PLUGSTMT */ - YYSYMBOL_LABEL = 66, /* LABEL */ - YYSYMBOL_LOOPEX = 67, /* LOOPEX */ - YYSYMBOL_DOTDOT = 68, /* DOTDOT */ - YYSYMBOL_YADAYADA = 69, /* YADAYADA */ - YYSYMBOL_FUNC0 = 70, /* FUNC0 */ - YYSYMBOL_FUNC1 = 71, /* FUNC1 */ - YYSYMBOL_FUNC = 72, /* FUNC */ - YYSYMBOL_UNIOP = 73, /* UNIOP */ - YYSYMBOL_LSTOP = 74, /* LSTOP */ - YYSYMBOL_BLKLSTOP = 75, /* BLKLSTOP */ - YYSYMBOL_POWOP = 76, /* POWOP */ - YYSYMBOL_MULOP = 77, /* MULOP */ - YYSYMBOL_ADDOP = 78, /* ADDOP */ - YYSYMBOL_DOLSHARP = 79, /* DOLSHARP */ - YYSYMBOL_HASHBRACK = 80, /* HASHBRACK */ - YYSYMBOL_NOAMP = 81, /* NOAMP */ - YYSYMBOL_COLONATTR = 82, /* COLONATTR */ - YYSYMBOL_FORMLBRACK = 83, /* FORMLBRACK */ - YYSYMBOL_FORMRBRACK = 84, /* FORMRBRACK */ - YYSYMBOL_SUBLEXSTART = 85, /* SUBLEXSTART */ - YYSYMBOL_SUBLEXEND = 86, /* SUBLEXEND */ - YYSYMBOL_PHASER = 87, /* PHASER */ - YYSYMBOL_PREC_LOW = 88, /* PREC_LOW */ - YYSYMBOL_PLUGIN_LOW_OP = 89, /* PLUGIN_LOW_OP */ - YYSYMBOL_OROP = 90, /* OROP */ - YYSYMBOL_PLUGIN_LOGICAL_OR_LOW_OP = 91, /* PLUGIN_LOGICAL_OR_LOW_OP */ - YYSYMBOL_ANDOP = 92, /* ANDOP */ - YYSYMBOL_PLUGIN_LOGICAL_AND_LOW_OP = 93, /* PLUGIN_LOGICAL_AND_LOW_OP */ - YYSYMBOL_NOTOP = 94, /* NOTOP */ - YYSYMBOL_ASSIGNOP = 95, /* ASSIGNOP */ - YYSYMBOL_PLUGIN_ASSIGN_OP = 96, /* PLUGIN_ASSIGN_OP */ - YYSYMBOL_PERLY_QUESTION_MARK = 97, /* PERLY_QUESTION_MARK */ - YYSYMBOL_PERLY_COLON = 98, /* PERLY_COLON */ - YYSYMBOL_OROR = 99, /* OROR */ - YYSYMBOL_DORDOR = 100, /* DORDOR */ - YYSYMBOL_PLUGIN_LOGICAL_OR_OP = 101, /* PLUGIN_LOGICAL_OR_OP */ - YYSYMBOL_ANDAND = 102, /* ANDAND */ - YYSYMBOL_PLUGIN_LOGICAL_AND_OP = 103, /* PLUGIN_LOGICAL_AND_OP */ - YYSYMBOL_BITOROP = 104, /* BITOROP */ - YYSYMBOL_BITANDOP = 105, /* BITANDOP */ - YYSYMBOL_CHEQOP = 106, /* CHEQOP */ - YYSYMBOL_NCEQOP = 107, /* NCEQOP */ - YYSYMBOL_CHRELOP = 108, /* CHRELOP */ - YYSYMBOL_NCRELOP = 109, /* NCRELOP */ - YYSYMBOL_PLUGIN_REL_OP = 110, /* PLUGIN_REL_OP */ - YYSYMBOL_SHIFTOP = 111, /* SHIFTOP */ - YYSYMBOL_PLUGIN_ADD_OP = 112, /* PLUGIN_ADD_OP */ - YYSYMBOL_PLUGIN_MUL_OP = 113, /* PLUGIN_MUL_OP */ - YYSYMBOL_MATCHOP = 114, /* MATCHOP */ - YYSYMBOL_PERLY_EXCLAMATION_MARK = 115, /* PERLY_EXCLAMATION_MARK */ - YYSYMBOL_PERLY_TILDE = 116, /* PERLY_TILDE */ - YYSYMBOL_UMINUS = 117, /* UMINUS */ - YYSYMBOL_REFGEN = 118, /* REFGEN */ - YYSYMBOL_PLUGIN_POW_OP = 119, /* PLUGIN_POW_OP */ - YYSYMBOL_PREINC = 120, /* PREINC */ - YYSYMBOL_PREDEC = 121, /* PREDEC */ - YYSYMBOL_POSTINC = 122, /* POSTINC */ - YYSYMBOL_POSTDEC = 123, /* POSTDEC */ - YYSYMBOL_POSTJOIN = 124, /* POSTJOIN */ - YYSYMBOL_PLUGIN_HIGH_OP = 125, /* PLUGIN_HIGH_OP */ - YYSYMBOL_ARROW = 126, /* ARROW */ - YYSYMBOL_PERLY_PAREN_CLOSE = 127, /* PERLY_PAREN_CLOSE */ - YYSYMBOL_PERLY_PAREN_OPEN = 128, /* PERLY_PAREN_OPEN */ - YYSYMBOL_YYACCEPT = 129, /* $accept */ - YYSYMBOL_grammar = 130, /* grammar */ - YYSYMBOL_131_1 = 131, /* @1 */ - YYSYMBOL_132_2 = 132, /* @2 */ - YYSYMBOL_133_3 = 133, /* @3 */ - YYSYMBOL_134_4 = 134, /* @4 */ - YYSYMBOL_135_5 = 135, /* @5 */ - YYSYMBOL_136_6 = 136, /* @6 */ - YYSYMBOL_137_7 = 137, /* @7 */ - YYSYMBOL_sigsub_or_method_named = 138, /* sigsub_or_method_named */ - YYSYMBOL_block = 139, /* block */ - YYSYMBOL_empty = 140, /* empty */ - YYSYMBOL_formblock = 141, /* formblock */ - YYSYMBOL_remember = 142, /* remember */ - YYSYMBOL_mblock = 143, /* mblock */ - YYSYMBOL_mremember = 144, /* mremember */ - YYSYMBOL_catch_paren = 145, /* catch_paren */ - YYSYMBOL_146_8 = 146, /* $@8 */ - YYSYMBOL_147_9 = 147, /* $@9 */ - YYSYMBOL_stmtseq = 148, /* stmtseq */ - YYSYMBOL_formstmtseq = 149, /* formstmtseq */ - YYSYMBOL_fullstmt = 150, /* fullstmt */ - YYSYMBOL_labfullstmt = 151, /* labfullstmt */ - YYSYMBOL_barestmt = 152, /* barestmt */ - YYSYMBOL_153_10 = 153, /* $@10 */ - YYSYMBOL_154_11 = 154, /* $@11 */ - YYSYMBOL_155_12 = 155, /* $@12 */ - YYSYMBOL_156_13 = 156, /* $@13 */ - YYSYMBOL_157_14 = 157, /* $@14 */ - YYSYMBOL_158_15 = 158, /* $@15 */ - YYSYMBOL_159_16 = 159, /* @16 */ - YYSYMBOL_160_17 = 160, /* $@17 */ - YYSYMBOL_161_18 = 161, /* $@18 */ - YYSYMBOL_162_19 = 162, /* $@19 */ - YYSYMBOL_formline = 163, /* formline */ - YYSYMBOL_formarg = 164, /* formarg */ - YYSYMBOL_condition = 165, /* condition */ - YYSYMBOL_sideff = 166, /* sideff */ - YYSYMBOL_else = 167, /* else */ - YYSYMBOL_cont = 168, /* cont */ - YYSYMBOL_finally = 169, /* finally */ - YYSYMBOL_mintro = 170, /* mintro */ - YYSYMBOL_nexpr = 171, /* nexpr */ - YYSYMBOL_texpr = 172, /* texpr */ - YYSYMBOL_iexpr = 173, /* iexpr */ - YYSYMBOL_mexpr = 174, /* mexpr */ - YYSYMBOL_mnexpr = 175, /* mnexpr */ - YYSYMBOL_formname = 176, /* formname */ - YYSYMBOL_startsub = 177, /* startsub */ - YYSYMBOL_startanonsub = 178, /* startanonsub */ - YYSYMBOL_startanonmethod = 179, /* startanonmethod */ - YYSYMBOL_startformsub = 180, /* startformsub */ - YYSYMBOL_subname = 181, /* subname */ - YYSYMBOL_proto = 182, /* proto */ - YYSYMBOL_subattrlist = 183, /* subattrlist */ - YYSYMBOL_myattrlist = 184, /* myattrlist */ - YYSYMBOL_sigvarname = 185, /* sigvarname */ - YYSYMBOL_sigslurpsigil = 186, /* sigslurpsigil */ - YYSYMBOL_sigslurpelem = 187, /* sigslurpelem */ - YYSYMBOL_sigscalarelem = 188, /* sigscalarelem */ - YYSYMBOL_sigelem = 189, /* sigelem */ - YYSYMBOL_siglist = 190, /* siglist */ - YYSYMBOL_optsiglist = 191, /* optsiglist */ - YYSYMBOL_optsubsignature = 192, /* optsubsignature */ - YYSYMBOL_subsignature = 193, /* subsignature */ - YYSYMBOL_subsigguts = 194, /* subsigguts */ - YYSYMBOL_195_20 = 195, /* $@20 */ - YYSYMBOL_optsubbody = 196, /* optsubbody */ - YYSYMBOL_subbody = 197, /* subbody */ - YYSYMBOL_optsigsubbody = 198, /* optsigsubbody */ - YYSYMBOL_sigsubbody = 199, /* sigsubbody */ - YYSYMBOL_200_21 = 200, /* $@21 */ - YYSYMBOL_expr = 201, /* expr */ - YYSYMBOL_listexpr = 202, /* listexpr */ - YYSYMBOL_listop = 203, /* listop */ - YYSYMBOL_204_22 = 204, /* @22 */ - YYSYMBOL_methodname = 205, /* methodname */ - YYSYMBOL_subscripted = 206, /* subscripted */ - YYSYMBOL_termbinop = 207, /* termbinop */ - YYSYMBOL_termrelop = 208, /* termrelop */ - YYSYMBOL_relopchain = 209, /* relopchain */ - YYSYMBOL_termeqop = 210, /* termeqop */ - YYSYMBOL_eqopchain = 211, /* eqopchain */ - YYSYMBOL_termunop = 212, /* termunop */ - YYSYMBOL_anonymous = 213, /* anonymous */ - YYSYMBOL_termdo = 214, /* termdo */ - YYSYMBOL_term = 215, /* term */ - YYSYMBOL_216_23 = 216, /* @23 */ - YYSYMBOL_myattrterm = 217, /* myattrterm */ - YYSYMBOL_myterm = 218, /* myterm */ - YYSYMBOL_fieldvar = 219, /* fieldvar */ - YYSYMBOL_optfieldattrlist = 220, /* optfieldattrlist */ - YYSYMBOL_fielddecl = 221, /* fielddecl */ - YYSYMBOL_222_24 = 222, /* $@24 */ - YYSYMBOL_optlistexpr = 223, /* optlistexpr */ - YYSYMBOL_optexpr = 224, /* optexpr */ - YYSYMBOL_optrepl = 225, /* optrepl */ - YYSYMBOL_my_scalar = 226, /* my_scalar */ - YYSYMBOL_list_of_scalars = 227, /* list_of_scalars */ - YYSYMBOL_my_list_of_scalars = 228, /* my_list_of_scalars */ - YYSYMBOL_my_var = 229, /* my_var */ - YYSYMBOL_refgen_topic = 230, /* refgen_topic */ - YYSYMBOL_my_refgen = 231, /* my_refgen */ - YYSYMBOL_amper = 232, /* amper */ - YYSYMBOL_scalar = 233, /* scalar */ - YYSYMBOL_ary = 234, /* ary */ - YYSYMBOL_hsh = 235, /* hsh */ - YYSYMBOL_arylen = 236, /* arylen */ - YYSYMBOL_star = 237, /* star */ - YYSYMBOL_sliceme = 238, /* sliceme */ - YYSYMBOL_kvslice = 239, /* kvslice */ - YYSYMBOL_gelem = 240, /* gelem */ - YYSYMBOL_indirob = 241 /* indirob */ + YYSYMBOL_KW_GIVEN = 40, /* KW_GIVEN */ + YYSYMBOL_KW_WHEN = 41, /* KW_WHEN */ + YYSYMBOL_KW_DEFAULT = 42, /* KW_DEFAULT */ + YYSYMBOL_KW_TRY = 43, /* KW_TRY */ + YYSYMBOL_KW_CATCH = 44, /* KW_CATCH */ + YYSYMBOL_KW_FINALLY = 45, /* KW_FINALLY */ + YYSYMBOL_KW_DEFER = 46, /* KW_DEFER */ + YYSYMBOL_KW_REQUIRE = 47, /* KW_REQUIRE */ + YYSYMBOL_KW_DO = 48, /* KW_DO */ + YYSYMBOL_KW_USE_or_NO = 49, /* KW_USE_or_NO */ + YYSYMBOL_KW_SUB_named = 50, /* KW_SUB_named */ + YYSYMBOL_KW_SUB_named_sig = 51, /* KW_SUB_named_sig */ + YYSYMBOL_KW_SUB_anon = 52, /* KW_SUB_anon */ + YYSYMBOL_KW_SUB_anon_sig = 53, /* KW_SUB_anon_sig */ + YYSYMBOL_KW_METHOD_named = 54, /* KW_METHOD_named */ + YYSYMBOL_KW_METHOD_anon = 55, /* KW_METHOD_anon */ + YYSYMBOL_BAREWORD = 56, /* BAREWORD */ + YYSYMBOL_METHCALL0 = 57, /* METHCALL0 */ + YYSYMBOL_METHCALL = 58, /* METHCALL */ + YYSYMBOL_THING = 59, /* THING */ + YYSYMBOL_PMFUNC = 60, /* PMFUNC */ + YYSYMBOL_PRIVATEREF = 61, /* PRIVATEREF */ + YYSYMBOL_QWLIST = 62, /* QWLIST */ + YYSYMBOL_FUNC0OP = 63, /* FUNC0OP */ + YYSYMBOL_FUNC0SUB = 64, /* FUNC0SUB */ + YYSYMBOL_UNIOPSUB = 65, /* UNIOPSUB */ + YYSYMBOL_LSTOPSUB = 66, /* LSTOPSUB */ + YYSYMBOL_PLUGEXPR = 67, /* PLUGEXPR */ + YYSYMBOL_PLUGSTMT = 68, /* PLUGSTMT */ + YYSYMBOL_LABEL = 69, /* LABEL */ + YYSYMBOL_LOOPEX = 70, /* LOOPEX */ + YYSYMBOL_DOTDOT = 71, /* DOTDOT */ + YYSYMBOL_YADAYADA = 72, /* YADAYADA */ + YYSYMBOL_FUNC0 = 73, /* FUNC0 */ + YYSYMBOL_FUNC1 = 74, /* FUNC1 */ + YYSYMBOL_FUNC = 75, /* FUNC */ + YYSYMBOL_UNIOP = 76, /* UNIOP */ + YYSYMBOL_LSTOP = 77, /* LSTOP */ + YYSYMBOL_BLKLSTOP = 78, /* BLKLSTOP */ + YYSYMBOL_POWOP = 79, /* POWOP */ + YYSYMBOL_MULOP = 80, /* MULOP */ + YYSYMBOL_ADDOP = 81, /* ADDOP */ + YYSYMBOL_DOLSHARP = 82, /* DOLSHARP */ + YYSYMBOL_HASHBRACK = 83, /* HASHBRACK */ + YYSYMBOL_NOAMP = 84, /* NOAMP */ + YYSYMBOL_COLONATTR = 85, /* COLONATTR */ + YYSYMBOL_FORMLBRACK = 86, /* FORMLBRACK */ + YYSYMBOL_FORMRBRACK = 87, /* FORMRBRACK */ + YYSYMBOL_SUBLEXSTART = 88, /* SUBLEXSTART */ + YYSYMBOL_SUBLEXEND = 89, /* SUBLEXEND */ + YYSYMBOL_PHASER = 90, /* PHASER */ + YYSYMBOL_PREC_LOW = 91, /* PREC_LOW */ + YYSYMBOL_PLUGIN_LOW_OP = 92, /* PLUGIN_LOW_OP */ + YYSYMBOL_OROP = 93, /* OROP */ + YYSYMBOL_PLUGIN_LOGICAL_OR_LOW_OP = 94, /* PLUGIN_LOGICAL_OR_LOW_OP */ + YYSYMBOL_ANDOP = 95, /* ANDOP */ + YYSYMBOL_PLUGIN_LOGICAL_AND_LOW_OP = 96, /* PLUGIN_LOGICAL_AND_LOW_OP */ + YYSYMBOL_NOTOP = 97, /* NOTOP */ + YYSYMBOL_ASSIGNOP = 98, /* ASSIGNOP */ + YYSYMBOL_PLUGIN_ASSIGN_OP = 99, /* PLUGIN_ASSIGN_OP */ + YYSYMBOL_PERLY_QUESTION_MARK = 100, /* PERLY_QUESTION_MARK */ + YYSYMBOL_PERLY_COLON = 101, /* PERLY_COLON */ + YYSYMBOL_OROR = 102, /* OROR */ + YYSYMBOL_DORDOR = 103, /* DORDOR */ + YYSYMBOL_PLUGIN_LOGICAL_OR_OP = 104, /* PLUGIN_LOGICAL_OR_OP */ + YYSYMBOL_ANDAND = 105, /* ANDAND */ + YYSYMBOL_PLUGIN_LOGICAL_AND_OP = 106, /* PLUGIN_LOGICAL_AND_OP */ + YYSYMBOL_BITOROP = 107, /* BITOROP */ + YYSYMBOL_BITANDOP = 108, /* BITANDOP */ + YYSYMBOL_CHEQOP = 109, /* CHEQOP */ + YYSYMBOL_NCEQOP = 110, /* NCEQOP */ + YYSYMBOL_CHRELOP = 111, /* CHRELOP */ + YYSYMBOL_NCRELOP = 112, /* NCRELOP */ + YYSYMBOL_PLUGIN_REL_OP = 113, /* PLUGIN_REL_OP */ + YYSYMBOL_SHIFTOP = 114, /* SHIFTOP */ + YYSYMBOL_PLUGIN_ADD_OP = 115, /* PLUGIN_ADD_OP */ + YYSYMBOL_PLUGIN_MUL_OP = 116, /* PLUGIN_MUL_OP */ + YYSYMBOL_MATCHOP = 117, /* MATCHOP */ + YYSYMBOL_PERLY_EXCLAMATION_MARK = 118, /* PERLY_EXCLAMATION_MARK */ + YYSYMBOL_PERLY_TILDE = 119, /* PERLY_TILDE */ + YYSYMBOL_UMINUS = 120, /* UMINUS */ + YYSYMBOL_REFGEN = 121, /* REFGEN */ + YYSYMBOL_PLUGIN_POW_OP = 122, /* PLUGIN_POW_OP */ + YYSYMBOL_PREINC = 123, /* PREINC */ + YYSYMBOL_PREDEC = 124, /* PREDEC */ + YYSYMBOL_POSTINC = 125, /* POSTINC */ + YYSYMBOL_POSTDEC = 126, /* POSTDEC */ + YYSYMBOL_POSTJOIN = 127, /* POSTJOIN */ + YYSYMBOL_PLUGIN_HIGH_OP = 128, /* PLUGIN_HIGH_OP */ + YYSYMBOL_ARROW = 129, /* ARROW */ + YYSYMBOL_PERLY_PAREN_CLOSE = 130, /* PERLY_PAREN_CLOSE */ + YYSYMBOL_PERLY_PAREN_OPEN = 131, /* PERLY_PAREN_OPEN */ + YYSYMBOL_YYACCEPT = 132, /* $accept */ + YYSYMBOL_grammar = 133, /* grammar */ + YYSYMBOL_134_1 = 134, /* @1 */ + YYSYMBOL_135_2 = 135, /* @2 */ + YYSYMBOL_136_3 = 136, /* @3 */ + YYSYMBOL_137_4 = 137, /* @4 */ + YYSYMBOL_138_5 = 138, /* @5 */ + YYSYMBOL_139_6 = 139, /* @6 */ + YYSYMBOL_140_7 = 140, /* @7 */ + YYSYMBOL_sigsub_or_method_named = 141, /* sigsub_or_method_named */ + YYSYMBOL_block = 142, /* block */ + YYSYMBOL_empty = 143, /* empty */ + YYSYMBOL_formblock = 144, /* formblock */ + YYSYMBOL_remember = 145, /* remember */ + YYSYMBOL_mblock = 146, /* mblock */ + YYSYMBOL_mremember = 147, /* mremember */ + YYSYMBOL_catch_paren = 148, /* catch_paren */ + YYSYMBOL_149_8 = 149, /* $@8 */ + YYSYMBOL_150_9 = 150, /* $@9 */ + YYSYMBOL_stmtseq = 151, /* stmtseq */ + YYSYMBOL_formstmtseq = 152, /* formstmtseq */ + YYSYMBOL_fullstmt = 153, /* fullstmt */ + YYSYMBOL_labfullstmt = 154, /* labfullstmt */ + YYSYMBOL_barestmt = 155, /* barestmt */ + YYSYMBOL_156_10 = 156, /* $@10 */ + YYSYMBOL_157_11 = 157, /* $@11 */ + YYSYMBOL_158_12 = 158, /* $@12 */ + YYSYMBOL_159_13 = 159, /* $@13 */ + YYSYMBOL_160_14 = 160, /* $@14 */ + YYSYMBOL_161_15 = 161, /* $@15 */ + YYSYMBOL_162_16 = 162, /* @16 */ + YYSYMBOL_163_17 = 163, /* $@17 */ + YYSYMBOL_164_18 = 164, /* $@18 */ + YYSYMBOL_165_19 = 165, /* $@19 */ + YYSYMBOL_formline = 166, /* formline */ + YYSYMBOL_formarg = 167, /* formarg */ + YYSYMBOL_condition = 168, /* condition */ + YYSYMBOL_sideff = 169, /* sideff */ + YYSYMBOL_else = 170, /* else */ + YYSYMBOL_cont = 171, /* cont */ + YYSYMBOL_finally = 172, /* finally */ + YYSYMBOL_mintro = 173, /* mintro */ + YYSYMBOL_nexpr = 174, /* nexpr */ + YYSYMBOL_texpr = 175, /* texpr */ + YYSYMBOL_iexpr = 176, /* iexpr */ + YYSYMBOL_mexpr = 177, /* mexpr */ + YYSYMBOL_mnexpr = 178, /* mnexpr */ + YYSYMBOL_formname = 179, /* formname */ + YYSYMBOL_startsub = 180, /* startsub */ + YYSYMBOL_startanonsub = 181, /* startanonsub */ + YYSYMBOL_startanonmethod = 182, /* startanonmethod */ + YYSYMBOL_startformsub = 183, /* startformsub */ + YYSYMBOL_subname = 184, /* subname */ + YYSYMBOL_proto = 185, /* proto */ + YYSYMBOL_subattrlist = 186, /* subattrlist */ + YYSYMBOL_myattrlist = 187, /* myattrlist */ + YYSYMBOL_sigvarname = 188, /* sigvarname */ + YYSYMBOL_sigslurpsigil = 189, /* sigslurpsigil */ + YYSYMBOL_sigslurpelem = 190, /* sigslurpelem */ + YYSYMBOL_sigscalarelem = 191, /* sigscalarelem */ + YYSYMBOL_sigelem = 192, /* sigelem */ + YYSYMBOL_siglist = 193, /* siglist */ + YYSYMBOL_optsiglist = 194, /* optsiglist */ + YYSYMBOL_optsubsignature = 195, /* optsubsignature */ + YYSYMBOL_subsignature = 196, /* subsignature */ + YYSYMBOL_subsigguts = 197, /* subsigguts */ + YYSYMBOL_198_20 = 198, /* $@20 */ + YYSYMBOL_optsubbody = 199, /* optsubbody */ + YYSYMBOL_subbody = 200, /* subbody */ + YYSYMBOL_optsigsubbody = 201, /* optsigsubbody */ + YYSYMBOL_sigsubbody = 202, /* sigsubbody */ + YYSYMBOL_203_21 = 203, /* $@21 */ + YYSYMBOL_expr = 204, /* expr */ + YYSYMBOL_listexpr = 205, /* listexpr */ + YYSYMBOL_listop = 206, /* listop */ + YYSYMBOL_207_22 = 207, /* @22 */ + YYSYMBOL_methodname = 208, /* methodname */ + YYSYMBOL_subscripted = 209, /* subscripted */ + YYSYMBOL_termbinop = 210, /* termbinop */ + YYSYMBOL_termrelop = 211, /* termrelop */ + YYSYMBOL_relopchain = 212, /* relopchain */ + YYSYMBOL_termeqop = 213, /* termeqop */ + YYSYMBOL_eqopchain = 214, /* eqopchain */ + YYSYMBOL_termunop = 215, /* termunop */ + YYSYMBOL_anonymous = 216, /* anonymous */ + YYSYMBOL_termdo = 217, /* termdo */ + YYSYMBOL_term = 218, /* term */ + YYSYMBOL_219_23 = 219, /* @23 */ + YYSYMBOL_myattrterm = 220, /* myattrterm */ + YYSYMBOL_myterm = 221, /* myterm */ + YYSYMBOL_fieldvar = 222, /* fieldvar */ + YYSYMBOL_optfieldattrlist = 223, /* optfieldattrlist */ + YYSYMBOL_fielddecl = 224, /* fielddecl */ + YYSYMBOL_225_24 = 225, /* $@24 */ + YYSYMBOL_optlistexpr = 226, /* optlistexpr */ + YYSYMBOL_optexpr = 227, /* optexpr */ + YYSYMBOL_optrepl = 228, /* optrepl */ + YYSYMBOL_my_scalar = 229, /* my_scalar */ + YYSYMBOL_list_of_scalars = 230, /* list_of_scalars */ + YYSYMBOL_my_list_of_scalars = 231, /* my_list_of_scalars */ + YYSYMBOL_my_var = 232, /* my_var */ + YYSYMBOL_refgen_topic = 233, /* refgen_topic */ + YYSYMBOL_my_refgen = 234, /* my_refgen */ + YYSYMBOL_amper = 235, /* amper */ + YYSYMBOL_scalar = 236, /* scalar */ + YYSYMBOL_ary = 237, /* ary */ + YYSYMBOL_hsh = 238, /* hsh */ + YYSYMBOL_arylen = 239, /* arylen */ + YYSYMBOL_star = 240, /* star */ + YYSYMBOL_sliceme = 241, /* sliceme */ + YYSYMBOL_kvslice = 242, /* kvslice */ + YYSYMBOL_gelem = 243, /* gelem */ + YYSYMBOL_indirob = 244 /* indirob */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -258,19 +261,19 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; #define YYFINAL 16 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 3664 +#define YYLAST 3732 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 129 +#define YYNTOKENS 132 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 113 /* YYNRULES -- Number of rules. */ -#define YYNRULES 338 +#define YYNRULES 342 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 660 +#define YYNSTATES 676 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 383 +#define YYMAXUTOK 386 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM @@ -322,47 +325,48 @@ static const yytype_uint8 yytranslate[] = 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128 + 125, 126, 127, 128, 129, 130, 131 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 160, 160, 159, 171, 170, 181, 180, 194, 193, - 207, 206, 220, 219, 230, 229, 243, 245, 250, 258, - 262, 269, 274, 281, 287, 291, 293, 290, 300, 301, - 311, 312, 321, 325, 329, 336, 346, 348, 361, 358, - 382, 377, 405, 404, 430, 441, 453, 452, 463, 469, - 475, 482, 490, 492, 489, 509, 514, 523, 530, 529, - 544, 552, 559, 558, 573, 580, 579, 595, 594, 614, - 618, 622, 626, 632, 640, 658, 659, 663, 667, 669, - 671, 673, 675, 677, 679, 686, 687, 692, 703, 704, - 709, 711, 716, 723, 724, 728, 732, 736, 741, 745, - 749, 750, 753, 759, 764, 769, 775, 776, 781, 782, - 787, 788, 795, 800, 802, 813, 815, 820, 822, 826, - 831, 835, 843, 848, 853, 862, 864, 872, 873, 874, - 879, 880, 885, 886, 890, 894, 894, 927, 928, 933, - 945, 946, 951, 950, 963, 965, 967, 969, 971, 975, - 977, 982, 986, 990, 994, 998, 1004, 1009, 1015, 1021, - 1027, 1033, 1035, 1037, 1040, 1039, 1053, 1054, 1058, 1062, - 1065, 1070, 1075, 1078, 1082, 1086, 1092, 1100, 1107, 1113, - 1115, 1117, 1122, 1124, 1126, 1128, 1130, 1132, 1137, 1139, - 1141, 1143, 1145, 1147, 1149, 1151, 1153, 1155, 1157, 1159, - 1161, 1163, 1165, 1167, 1171, 1173, 1175, 1177, 1179, 1183, - 1185, 1189, 1191, 1193, 1195, 1199, 1201, 1206, 1208, 1211, - 1213, 1215, 1218, 1221, 1232, 1235, 1243, 1245, 1247, 1250, - 1253, 1261, 1263, 1267, 1268, 1269, 1270, 1271, 1273, 1275, - 1277, 1279, 1281, 1283, 1285, 1287, 1289, 1291, 1293, 1295, - 1297, 1307, 1317, 1327, 1337, 1339, 1341, 1344, 1349, 1353, - 1355, 1357, 1359, 1362, 1364, 1367, 1369, 1371, 1373, 1375, - 1377, 1379, 1381, 1383, 1386, 1388, 1390, 1392, 1394, 1396, - 1400, 1403, 1402, 1415, 1416, 1417, 1422, 1424, 1426, 1428, - 1433, 1435, 1438, 1440, 1442, 1447, 1452, 1457, 1465, 1467, - 1469, 1473, 1481, 1480, 1498, 1499, 1503, 1504, 1508, 1509, - 1514, 1519, 1521, 1525, 1528, 1532, 1533, 1534, 1537, 1538, - 1541, 1542, 1545, 1549, 1553, 1559, 1565, 1567, 1571, 1575, - 1576, 1580, 1581, 1585, 1586, 1591, 1593, 1595, 1598 + 0, 161, 161, 160, 172, 171, 182, 181, 195, 194, + 208, 207, 221, 220, 231, 230, 244, 246, 251, 259, + 263, 270, 275, 282, 288, 292, 294, 291, 301, 302, + 312, 313, 322, 326, 330, 337, 347, 349, 362, 359, + 383, 378, 406, 405, 431, 442, 454, 453, 464, 470, + 476, 481, 483, 485, 492, 500, 502, 499, 519, 524, + 533, 540, 539, 554, 562, 569, 568, 583, 590, 589, + 605, 604, 624, 628, 632, 636, 642, 650, 668, 669, + 673, 677, 679, 681, 683, 685, 687, 689, 692, 698, + 699, 704, 715, 716, 721, 723, 728, 735, 736, 740, + 744, 748, 753, 757, 761, 762, 765, 771, 776, 781, + 787, 788, 793, 794, 799, 800, 807, 812, 814, 825, + 827, 832, 834, 838, 843, 847, 855, 860, 865, 874, + 876, 884, 885, 886, 891, 892, 897, 898, 902, 906, + 906, 939, 940, 945, 957, 958, 963, 962, 975, 977, + 979, 981, 983, 987, 989, 994, 998, 1002, 1006, 1010, + 1016, 1021, 1027, 1033, 1039, 1045, 1047, 1049, 1052, 1051, + 1065, 1066, 1070, 1074, 1077, 1082, 1087, 1090, 1094, 1098, + 1104, 1112, 1119, 1125, 1127, 1129, 1134, 1136, 1138, 1140, + 1142, 1144, 1149, 1151, 1153, 1155, 1157, 1159, 1161, 1163, + 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1183, 1185, + 1187, 1189, 1191, 1195, 1197, 1201, 1203, 1205, 1207, 1211, + 1213, 1218, 1220, 1223, 1225, 1227, 1230, 1233, 1244, 1247, + 1255, 1257, 1259, 1262, 1265, 1273, 1275, 1279, 1280, 1281, + 1282, 1283, 1285, 1287, 1289, 1291, 1293, 1295, 1297, 1299, + 1301, 1303, 1305, 1307, 1309, 1319, 1329, 1339, 1349, 1351, + 1353, 1356, 1361, 1365, 1367, 1369, 1371, 1374, 1376, 1379, + 1381, 1383, 1385, 1387, 1389, 1391, 1393, 1395, 1398, 1400, + 1402, 1404, 1406, 1408, 1412, 1415, 1414, 1427, 1428, 1429, + 1434, 1436, 1438, 1440, 1445, 1447, 1450, 1452, 1454, 1459, + 1464, 1469, 1477, 1479, 1481, 1485, 1493, 1492, 1510, 1511, + 1515, 1516, 1520, 1521, 1526, 1531, 1533, 1537, 1540, 1544, + 1545, 1546, 1549, 1550, 1553, 1554, 1557, 1561, 1565, 1571, + 1577, 1579, 1583, 1587, 1588, 1592, 1593, 1597, 1598, 1603, + 1605, 1607, 1610 }; #endif @@ -387,28 +391,29 @@ static const char *const yytname[] = "PERLY_SLASH", "PERLY_SNAIL", "PERLY_STAR", "KW_FORMAT", "KW_PACKAGE", "KW_CLASS", "KW_LOCAL", "KW_MY", "KW_FIELD", "KW_IF", "KW_ELSE", "KW_ELSIF", "KW_UNLESS", "KW_FOR", "KW_UNTIL", "KW_WHILE", "KW_CONTINUE", - "KW_TRY", "KW_CATCH", "KW_FINALLY", "KW_DEFER", "KW_REQUIRE", "KW_DO", - "KW_USE_or_NO", "KW_SUB_named", "KW_SUB_named_sig", "KW_SUB_anon", - "KW_SUB_anon_sig", "KW_METHOD_named", "KW_METHOD_anon", "BAREWORD", - "METHCALL0", "METHCALL", "THING", "PMFUNC", "PRIVATEREF", "QWLIST", - "FUNC0OP", "FUNC0SUB", "UNIOPSUB", "LSTOPSUB", "PLUGEXPR", "PLUGSTMT", - "LABEL", "LOOPEX", "DOTDOT", "YADAYADA", "FUNC0", "FUNC1", "FUNC", - "UNIOP", "LSTOP", "BLKLSTOP", "POWOP", "MULOP", "ADDOP", "DOLSHARP", - "HASHBRACK", "NOAMP", "COLONATTR", "FORMLBRACK", "FORMRBRACK", - "SUBLEXSTART", "SUBLEXEND", "PHASER", "PREC_LOW", "PLUGIN_LOW_OP", - "OROP", "PLUGIN_LOGICAL_OR_LOW_OP", "ANDOP", "PLUGIN_LOGICAL_AND_LOW_OP", - "NOTOP", "ASSIGNOP", "PLUGIN_ASSIGN_OP", "PERLY_QUESTION_MARK", - "PERLY_COLON", "OROR", "DORDOR", "PLUGIN_LOGICAL_OR_OP", "ANDAND", - "PLUGIN_LOGICAL_AND_OP", "BITOROP", "BITANDOP", "CHEQOP", "NCEQOP", - "CHRELOP", "NCRELOP", "PLUGIN_REL_OP", "SHIFTOP", "PLUGIN_ADD_OP", - "PLUGIN_MUL_OP", "MATCHOP", "PERLY_EXCLAMATION_MARK", "PERLY_TILDE", - "UMINUS", "REFGEN", "PLUGIN_POW_OP", "PREINC", "PREDEC", "POSTINC", - "POSTDEC", "POSTJOIN", "PLUGIN_HIGH_OP", "ARROW", "PERLY_PAREN_CLOSE", - "PERLY_PAREN_OPEN", "$accept", "grammar", "@1", "@2", "@3", "@4", "@5", - "@6", "@7", "sigsub_or_method_named", "block", "empty", "formblock", - "remember", "mblock", "mremember", "catch_paren", "$@8", "$@9", - "stmtseq", "formstmtseq", "fullstmt", "labfullstmt", "barestmt", "$@10", - "$@11", "$@12", "$@13", "$@14", "$@15", "@16", "$@17", "$@18", "$@19", + "KW_GIVEN", "KW_WHEN", "KW_DEFAULT", "KW_TRY", "KW_CATCH", "KW_FINALLY", + "KW_DEFER", "KW_REQUIRE", "KW_DO", "KW_USE_or_NO", "KW_SUB_named", + "KW_SUB_named_sig", "KW_SUB_anon", "KW_SUB_anon_sig", "KW_METHOD_named", + "KW_METHOD_anon", "BAREWORD", "METHCALL0", "METHCALL", "THING", "PMFUNC", + "PRIVATEREF", "QWLIST", "FUNC0OP", "FUNC0SUB", "UNIOPSUB", "LSTOPSUB", + "PLUGEXPR", "PLUGSTMT", "LABEL", "LOOPEX", "DOTDOT", "YADAYADA", "FUNC0", + "FUNC1", "FUNC", "UNIOP", "LSTOP", "BLKLSTOP", "POWOP", "MULOP", "ADDOP", + "DOLSHARP", "HASHBRACK", "NOAMP", "COLONATTR", "FORMLBRACK", + "FORMRBRACK", "SUBLEXSTART", "SUBLEXEND", "PHASER", "PREC_LOW", + "PLUGIN_LOW_OP", "OROP", "PLUGIN_LOGICAL_OR_LOW_OP", "ANDOP", + "PLUGIN_LOGICAL_AND_LOW_OP", "NOTOP", "ASSIGNOP", "PLUGIN_ASSIGN_OP", + "PERLY_QUESTION_MARK", "PERLY_COLON", "OROR", "DORDOR", + "PLUGIN_LOGICAL_OR_OP", "ANDAND", "PLUGIN_LOGICAL_AND_OP", "BITOROP", + "BITANDOP", "CHEQOP", "NCEQOP", "CHRELOP", "NCRELOP", "PLUGIN_REL_OP", + "SHIFTOP", "PLUGIN_ADD_OP", "PLUGIN_MUL_OP", "MATCHOP", + "PERLY_EXCLAMATION_MARK", "PERLY_TILDE", "UMINUS", "REFGEN", + "PLUGIN_POW_OP", "PREINC", "PREDEC", "POSTINC", "POSTDEC", "POSTJOIN", + "PLUGIN_HIGH_OP", "ARROW", "PERLY_PAREN_CLOSE", "PERLY_PAREN_OPEN", + "$accept", "grammar", "@1", "@2", "@3", "@4", "@5", "@6", "@7", + "sigsub_or_method_named", "block", "empty", "formblock", "remember", + "mblock", "mremember", "catch_paren", "$@8", "$@9", "stmtseq", + "formstmtseq", "fullstmt", "labfullstmt", "barestmt", "$@10", "$@11", + "$@12", "$@13", "$@14", "$@15", "@16", "$@17", "$@18", "$@19", "formline", "formarg", "condition", "sideff", "else", "cont", "finally", "mintro", "nexpr", "texpr", "iexpr", "mexpr", "mnexpr", "formname", "startsub", "startanonsub", "startanonmethod", "startformsub", "subname", @@ -432,12 +437,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-536) +#define YYPACT_NINF (-571) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-337) +#define YYTABLE_NINF (-341) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) @@ -446,72 +451,74 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 652, -536, -536, -536, -536, -536, -536, -536, 79, -536, - 2973, 75, 1929, 1816, -536, -536, -536, -536, 42, 2973, - 42, 2973, 42, 2973, 42, 42, 2973, 47, 2973, 2253, - -536, -536, -536, -536, 42, 42, -536, -536, 88, -36, - -536, 2973, -536, -536, 2973, -12, 2, -34, 2253, 2173, - 75, 42, 2973, -1, 2973, 2973, 2973, 2973, 2973, 2973, - 2333, -536, 351, 98, -536, 4, -536, -49, 54, 45, - 15, -536, -536, -536, 897, -536, -536, 12, 177, 253, - 283, -536, 161, 296, 310, 184, -536, -536, -536, -536, - -536, 132, 136, 203, 74, 92, 13, 93, 105, 223, - 223, -536, -1, -536, -536, -536, 222, -536, -1, 215, - -536, 255, 399, 256, 1816, -536, -536, -536, -536, 754, - -536, 277, 867, -536, -536, -536, -536, -536, 270, -536, - 374, -536, 374, -536, -536, 3519, 3053, 2413, 208, -536, - -536, -536, 3519, -536, 3519, 248, 242, 242, 2973, 206, - 254, 2973, 217, 3519, 75, 897, 218, 2493, 2973, 2173, - -536, 3519, 3133, -536, 98, -536, 2573, 2973, 2973, -536, - 327, -536, -536, 2973, 98, 374, 374, 374, 480, 480, - 342, 250, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2653, - -536, -536, 2973, -536, -536, 2973, 2973, 2973, 2973, 2973, - 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, - 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, - 2973, -536, -536, -536, 2973, 302, 2733, 2973, 2973, 2973, - 2973, 2973, 2973, 2973, -536, 308, 314, 315, 282, -536, - -536, -536, -536, -536, 252, 359, -536, -536, 244, -536, - -536, -536, 339, -536, -536, -536, -536, -536, -536, 75, - -536, -536, -536, 2973, 2973, 2973, 2973, 2973, -536, -536, - -536, -536, 326, -536, -536, -536, 326, -536, -536, -536, - 376, -536, -536, 2813, 374, 208, 37, 57, 65, -536, - 260, 336, -536, -536, -536, 242, 337, -536, -536, -536, - -536, 2973, 2973, 119, -536, -536, -536, -536, 377, 320, - 273, 2973, 98, 98, 395, -536, 2973, 397, 86, 86, - -536, -536, 3215, 16, 139, -536, 424, 3480, 3460, 3319, - 374, 387, 352, 3163, 3215, 3215, 576, 3358, 3358, 3358, - 3381, 3381, 3420, 3441, 3460, 3460, 3480, 3480, 3499, 3538, - 352, 387, 374, 374, 32, 31, 2973, 2973, 24, 386, - 388, 389, -536, 390, 2893, 289, -536, -536, 438, 123, - 155, 178, 159, 267, 170, 306, 1025, -536, -536, 400, - 44, 242, 363, -536, 328, 2973, 2973, -536, 6, -536, - -536, 297, -536, -536, -536, -536, 2011, 203, -536, 2973, - 2973, -536, -536, 371, -536, 405, -536, -536, -536, 351, - -536, -536, -536, 351, -536, -536, 338, 343, 277, 14, - 451, -536, -536, -536, -536, -536, 304, -536, -536, 312, - 87, -536, 2973, -536, -536, -536, 508, -536, 190, 2973, - 434, -536, -536, 2973, -536, 319, 311, 239, -536, -536, - -536, -536, -536, -536, 523, 2973, -536, 437, -536, 440, - -536, 441, -536, 443, -536, -536, -536, -536, -536, 51, - -536, -536, 329, 351, 330, 446, 331, -536, -536, -536, - -536, -536, 345, 457, 90, -536, 2973, 346, 355, 351, - 1138, 356, 432, 248, -536, 475, -536, -536, 242, 2973, - 2973, -536, 21, -536, -536, -536, 476, -536, -536, 2973, - -536, 408, -536, -536, -536, 245, -536, 3267, 2973, 490, - -536, -536, 380, -536, -536, -536, -536, 497, -536, -536, - -536, 2973, 223, 223, 505, 406, -536, 2973, 2973, 223, - -536, 394, 409, -536, -536, -536, -536, -536, -536, 2973, - 242, -536, 502, 897, 897, 410, -536, 351, -536, -536, - 418, -536, -536, 465, -536, -536, 897, 174, 174, 446, - 422, 425, 426, 215, 2973, 2973, 223, 223, 223, 446, - 223, 538, 405, 1251, -536, -536, -536, -536, -536, -536, - -536, 1364, -536, 223, 427, -536, -536, -536, -536, 2973, - 223, 223, -536, 542, 439, 215, 215, 215, -536, 525, - -536, -536, -536, 1477, -536, 19, -536, 1590, -536, 2973, - 448, 215, 215, -536, 223, -536, -536, -536, 452, 75, - -536, -536, 551, 499, -536, -536, 460, 223, -536, -536, - -536, 215, -536, -536, -536, -536, -536, -536, 223, 215, - 2093, -536, 1703, 174, -536, 482, -536, -536, 223, -536 + 611, -571, -571, -571, -571, -571, -571, -571, 66, -571, + 2986, 32, 1941, 1825, -571, -571, -571, -571, 116, 2986, + 116, 2986, 116, 2986, 116, 116, 2986, 16, 2986, 2266, + -571, -571, -571, -571, 116, 116, -571, -571, 63, -39, + -571, 2986, -571, -571, 2986, -31, 11, -59, 2266, 2186, + 32, 116, 2986, 87, 2986, 2986, 2986, 2986, 2986, 2986, + 2346, -571, 396, 135, -571, 4, -571, 48, 44, 58, + 71, -571, -571, -571, 3176, -571, -571, 67, 209, 274, + 308, -571, 164, 323, 420, 197, -571, -571, -571, -571, + -571, 156, 160, 141, 88, 121, 25, 122, 131, 139, + 142, 32, 266, 266, -571, 87, -571, -571, -571, 202, + -571, 87, 247, -571, 267, 447, 268, 1825, -571, -571, + -571, -571, 675, -571, 191, 849, -571, -571, -571, -571, + -571, 283, -571, 334, -571, 334, -571, -571, 3584, 3066, + 2426, 217, -571, -571, -571, 3584, -571, 3584, 246, 226, + 226, 2986, 179, 230, 2986, 192, 3584, 32, 3176, 195, + 2506, 2986, 2186, -571, 3584, 3146, -571, 135, -571, 2586, + 2986, 2986, -571, 301, -571, -571, 2986, 135, 334, 334, + 334, 237, 237, 327, -43, 2986, 2986, 2986, 2986, 2986, + 2986, 2986, 2666, -571, -571, 2986, -571, -571, 2986, 2986, + 2986, 2986, 2986, 2986, 2986, 2986, 2986, 2986, 2986, 2986, + 2986, 2986, 2986, 2986, 2986, 2986, 2986, 2986, 2986, 2986, + 2986, 2986, 2986, 2986, -571, -571, -571, 2986, 193, 2746, + 2986, 2986, 2986, 2986, 2986, 2986, 2986, -571, 287, 303, + 315, 265, -571, -571, -571, -571, -571, 239, 456, -571, + -571, 248, -571, -571, -571, -571, -571, -571, 341, -571, + -571, -571, -571, -571, -571, 32, -571, -571, -571, 2986, + 2986, 2986, 2986, 2986, 2986, -571, -571, -571, -571, 349, + -571, -571, -571, 349, -571, -571, -571, 371, -571, -571, + 2826, 334, 217, 43, 46, 69, -571, 171, 336, -571, + -571, -571, 226, 355, -571, -571, -571, -571, 2986, 2986, + 89, -571, -571, -571, -571, 374, 338, 293, 2986, 135, + 135, 424, -571, 2986, 430, 151, 151, -571, -571, 3280, + 26, 93, -571, 438, 3545, 3525, 3384, 334, 325, 312, + 3228, 3280, 3280, 1000, 3423, 3423, 3423, 3446, 3446, 3485, + 3506, 3525, 3525, 3545, 3545, 3564, 3603, 312, 325, 334, + 334, 108, 149, 2986, 2986, 52, 421, 432, 448, -571, + 450, 2906, 314, -571, -571, 451, 281, 97, 294, 200, + 304, 213, 313, 965, -571, -571, 431, 62, 226, 422, + -571, 389, 2986, 2986, -571, 33, -571, -571, 363, -571, + -571, -571, -571, 2026, 141, -571, 2986, 2986, 2986, 2986, + -571, -571, 440, -571, 476, -571, -571, -571, 396, -571, + -571, -571, 396, -571, -571, -571, 401, 403, 191, 21, + 470, -571, -571, -571, -571, -571, 376, -571, -571, 372, + 75, -571, 2986, -571, -571, -571, 508, -571, 235, 2986, + 496, -571, -571, 2986, -571, 378, 326, 258, -571, -571, + -571, -571, -571, -571, 512, 2986, -571, 502, -571, 503, + -571, 506, -571, 507, -571, -571, -571, -571, -571, 112, + -571, -571, 391, 396, 392, 511, 393, -571, -571, -571, + -571, -571, 398, 501, 219, -571, 2986, 405, 408, 396, + 418, 425, 1129, 419, 495, 246, -571, 541, -571, -571, + 226, 2986, 2986, -571, 24, -571, -571, -571, 545, -571, + -571, 2986, -571, 468, -571, -571, -571, 262, -571, 3332, + 2986, 549, -571, -571, 444, -571, -571, -571, -571, 548, + -571, -571, -571, 2986, 266, 266, 560, 446, -571, 2986, + 2986, 266, -571, 452, 449, -571, -571, 266, 266, -571, + -571, -571, -571, 2986, 226, -571, 556, 3176, 3176, 455, + -571, 396, -571, -571, 457, -571, -571, 499, -571, -571, + 3176, 225, 225, 511, 458, 460, 461, 247, 2986, 2986, + 266, 266, 266, -571, -571, 511, 266, 571, 476, 1245, + -571, -571, -571, -571, -571, -571, -571, 1361, -571, 266, + 464, -571, -571, -571, -571, 2986, 266, 266, -571, 577, + 479, 247, 247, 247, -571, 537, -571, -571, -571, 1477, + -571, 59, -571, 1593, -571, 2986, 480, 247, 247, -571, + 266, -571, -571, -571, 491, 32, -571, -571, 605, 539, + -571, -571, 500, 266, -571, -571, -571, 247, -571, -571, + -571, -571, -571, -571, 266, 247, 2106, -571, 1709, 225, + -571, 504, -571, -571, 266, -571 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -520,105 +527,107 @@ static const yytype_int16 yypact[] = static const yytype_int16 yydefact[] = { 0, 2, 4, 6, 8, 10, 12, 14, 0, 21, - 19, 0, 0, 0, 19, 135, 1, 19, 0, 19, - 0, 0, 0, 0, 0, 0, 0, 0, 270, 0, - 103, 103, 104, 283, 0, 0, 254, 281, 242, 276, - 278, 272, 103, 285, 264, 274, 0, 0, 267, 19, + 19, 0, 0, 0, 19, 139, 1, 19, 0, 19, + 0, 0, 0, 0, 0, 0, 0, 0, 274, 0, + 107, 107, 108, 287, 0, 0, 258, 285, 246, 280, + 282, 276, 107, 289, 268, 278, 0, 0, 271, 19, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 306, 307, 148, 284, 249, 233, 192, 204, 193, - 211, 234, 235, 236, 151, 239, 5, 255, 244, 247, - 246, 248, 245, 0, 0, 0, 21, 7, 78, 73, - 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 102, 0, 16, 17, 36, 0, 102, 0, 19, - 9, 0, 79, 0, 0, 11, 33, 32, 28, 0, - 15, 19, 0, 335, 338, 337, 336, 322, 0, 323, - 217, 325, 218, 324, 328, 240, 0, 0, 287, 292, - 294, 293, 271, 232, 231, 19, 19, 19, 19, 0, - 0, 0, 0, 273, 0, 265, 0, 0, 19, 19, - 268, 269, 283, 304, 305, 161, 244, 0, 0, 326, - 0, 106, 107, 19, 266, 219, 220, 238, 224, 225, - 243, 0, 0, 0, 0, 0, 149, 0, 0, 0, - 207, 206, 0, 214, 213, 0, 0, 0, 0, 0, + 0, 310, 311, 152, 288, 253, 237, 196, 208, 197, + 215, 238, 239, 240, 155, 243, 5, 259, 248, 251, + 250, 252, 249, 0, 0, 0, 21, 7, 81, 76, + 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 106, 0, 16, 17, 36, 0, + 106, 0, 19, 9, 0, 82, 0, 0, 11, 33, + 32, 28, 0, 15, 19, 0, 339, 342, 341, 340, + 326, 0, 327, 221, 329, 222, 328, 332, 244, 0, + 0, 291, 296, 298, 297, 275, 236, 235, 19, 19, + 19, 19, 0, 0, 0, 0, 277, 0, 269, 0, + 0, 19, 19, 272, 273, 287, 308, 309, 165, 248, + 0, 0, 330, 0, 110, 111, 19, 270, 223, 224, + 242, 228, 229, 247, 0, 0, 0, 0, 0, 153, + 0, 0, 0, 211, 210, 0, 218, 217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 221, 222, 223, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 19, 19, 0, 0, 19, 295, - 297, 296, 21, 21, 21, 0, 21, 21, 0, 21, - 21, 23, 0, 71, 46, 102, 72, 42, 102, 0, - 88, 64, 70, 0, 0, 0, 0, 0, 69, 35, - 34, 29, 115, 118, 117, 130, 115, 126, 125, 129, - 131, 136, 226, 0, 289, 0, 244, 247, 246, 291, - 0, 114, 286, 109, 108, 19, 112, 110, 21, 21, - 159, 19, 0, 0, 277, 164, 275, 279, 0, 0, - 0, 0, 152, 153, 0, 258, 0, 241, 146, 147, - 144, 145, 150, 0, 0, 178, 0, 210, 216, 196, - 185, 187, 189, 203, 183, 184, 0, 199, 201, 200, - 197, 198, 195, 194, 215, 212, 209, 205, 208, 191, - 190, 188, 202, 186, 182, 0, 0, 0, 0, 332, - 330, 334, 166, 0, 0, 156, 167, 256, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 100, 101, 0, - 0, 19, 299, 300, 301, 0, 0, 320, 0, 321, - 318, 0, 319, 315, 316, 317, 0, 0, 21, 0, - 95, 19, 21, 0, 38, 21, 40, 89, 80, 77, - 81, 84, 83, 97, 82, 116, 122, 119, 127, 243, - 0, 288, 290, 113, 21, 111, 19, 229, 230, 0, - 19, 180, 19, 280, 163, 162, 0, 227, 0, 0, - 0, 171, 177, 0, 262, 158, 0, 0, 259, 261, - 260, 263, 327, 175, 0, 19, 257, 0, 169, 0, - 250, 0, 251, 0, 18, 21, 37, 21, 44, 0, - 298, 302, 0, 98, 0, 0, 0, 310, 21, 93, - 94, 99, 0, 0, 79, 58, 0, 0, 0, 96, - 0, 19, 0, 19, 138, 0, 43, 137, 19, 123, - 120, 128, 241, 228, 135, 132, 0, 133, 160, 0, - 308, 0, 165, 154, 181, 0, 174, 237, 19, 0, - 170, 176, 0, 172, 252, 253, 168, 0, 65, 21, - 45, 0, 0, 0, 314, 0, 313, 0, 0, 0, - 52, 0, 0, 92, 92, 22, 25, 24, 62, 19, - 19, 19, 21, 124, 121, 0, 142, 309, 282, 179, - 0, 173, 155, 0, 19, 67, 303, 19, 19, 311, - 0, 0, 0, 19, 95, 0, 0, 0, 0, 0, - 0, 0, 21, 0, 141, 41, 140, 134, 19, 157, - 19, 0, 19, 0, 0, 85, 48, 49, 312, 0, - 0, 0, 61, 0, 0, 19, 19, 19, 26, 90, - 47, 39, 139, 0, 30, 0, 66, 0, 86, 0, - 0, 19, 19, 53, 0, 57, 51, 50, 0, 0, - 63, 143, 0, 19, 31, 68, 0, 0, 55, 60, - 92, 19, 27, 91, 20, 19, 75, 74, 0, 19, - 0, 59, 0, 19, 56, 0, 76, 87, 0, 54 + 0, 0, 0, 0, 225, 226, 227, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 19, 19, 0, + 0, 19, 299, 301, 300, 21, 21, 21, 0, 21, + 21, 0, 21, 21, 21, 21, 52, 23, 0, 74, + 46, 106, 75, 42, 106, 0, 92, 67, 73, 0, + 0, 0, 0, 0, 0, 72, 35, 34, 29, 119, + 122, 121, 134, 119, 130, 129, 133, 135, 140, 230, + 0, 293, 0, 248, 251, 250, 295, 0, 118, 290, + 113, 112, 19, 116, 114, 21, 21, 163, 19, 0, + 0, 281, 168, 279, 283, 0, 0, 0, 0, 156, + 157, 0, 262, 0, 245, 150, 151, 148, 149, 154, + 0, 0, 182, 0, 214, 220, 200, 189, 191, 193, + 207, 187, 188, 0, 203, 205, 204, 201, 202, 199, + 198, 219, 216, 213, 209, 212, 195, 194, 192, 206, + 190, 186, 0, 0, 0, 0, 336, 334, 338, 170, + 0, 0, 160, 171, 260, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 104, 105, 0, 0, 19, 303, + 304, 305, 0, 0, 324, 0, 325, 322, 0, 323, + 319, 320, 321, 0, 0, 21, 0, 99, 0, 0, + 19, 21, 0, 38, 21, 40, 93, 83, 80, 84, + 87, 86, 101, 85, 88, 120, 126, 123, 131, 247, + 0, 292, 294, 117, 21, 115, 19, 233, 234, 0, + 19, 184, 19, 284, 167, 166, 0, 231, 0, 0, + 0, 175, 181, 0, 266, 162, 0, 0, 263, 265, + 264, 267, 331, 179, 0, 19, 261, 0, 173, 0, + 254, 0, 255, 0, 18, 21, 37, 21, 44, 0, + 302, 306, 0, 102, 0, 0, 0, 314, 21, 97, + 98, 103, 0, 0, 82, 61, 0, 0, 0, 100, + 0, 0, 0, 19, 0, 19, 142, 0, 43, 141, + 19, 127, 124, 132, 245, 232, 139, 136, 0, 137, + 164, 0, 312, 0, 169, 158, 185, 0, 178, 241, + 19, 0, 174, 180, 0, 176, 256, 257, 172, 0, + 68, 21, 45, 0, 0, 0, 318, 0, 317, 0, + 0, 0, 55, 0, 0, 96, 96, 0, 0, 22, + 25, 24, 65, 19, 19, 19, 21, 128, 125, 0, + 146, 313, 286, 183, 0, 177, 159, 0, 19, 70, + 307, 19, 19, 315, 0, 0, 0, 19, 99, 0, + 0, 0, 0, 50, 51, 0, 0, 0, 21, 0, + 145, 41, 144, 138, 19, 161, 19, 0, 19, 0, + 0, 89, 48, 49, 316, 0, 0, 0, 64, 0, + 0, 19, 19, 19, 26, 94, 47, 39, 143, 0, + 30, 0, 69, 0, 90, 0, 0, 19, 19, 56, + 0, 60, 54, 53, 0, 0, 66, 147, 0, 19, + 31, 71, 0, 0, 58, 63, 96, 19, 27, 95, + 20, 19, 78, 77, 0, 19, 0, 62, 0, 19, + 59, 0, 79, 91, 0, 57 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, - -4, -10, -536, 56, -7, -536, -536, -536, -536, -16, - -536, 594, 496, -9, -536, -536, -536, -536, -536, -536, - -536, -536, -536, -536, -536, -536, 52, -394, -535, -259, - -536, -520, -536, 46, 219, -332, -31, -536, -94, 49, - -536, -536, -76, 128, -124, 341, 348, -536, -536, -536, - 204, -536, -536, -536, -536, 129, -536, 55, 210, -536, - -287, -536, 9, -44, -536, -536, -536, -536, -536, -536, - -536, -536, -536, -536, -536, -536, 533, -536, -536, 491, - -536, -536, -536, -536, -137, -15, -536, -536, -536, -536, - 249, -536, -536, 391, 63, -21, -19, -536, -536, -536, - -536, -536, 152 + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -4, -10, -571, 92, -80, -571, -571, -571, -571, -16, + -571, 613, 514, 12, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -41, -397, -570, -254, + -571, -530, -571, 41, 231, -315, -34, -571, -88, 73, + -571, -571, -78, 138, -140, 344, 357, -571, -571, -571, + 221, -571, -571, -571, -571, 134, -571, 54, 223, -571, + -295, -571, 9, -46, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, 625, -571, -571, 519, + -571, -571, -571, -571, -138, -17, -571, -571, -571, -571, + 256, -571, -571, 413, 40, -23, -22, -571, -571, -571, + -571, -571, 61 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 108, - 109, 118, 466, 426, 252, 401, 548, 579, 628, 119, - 615, 271, 116, 117, 493, 498, 405, 403, 574, 640, - 541, 580, 564, 592, 634, 647, 408, 111, 596, 261, - 630, 577, 481, 488, 412, 472, 483, 379, 254, 145, - 147, 235, 173, 295, 298, 292, 416, 276, 277, 278, - 279, 280, 281, 506, 507, 120, 121, 496, 497, 585, - 427, 588, 112, 63, 64, 432, 365, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 150, 75, 138, - 238, 384, 113, 531, 165, 76, 511, 476, 534, 535, - 390, 391, 247, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 129 + 0, 8, 9, 10, 11, 12, 13, 14, 15, 111, + 112, 121, 476, 436, 258, 410, 562, 595, 644, 122, + 631, 278, 119, 120, 505, 510, 414, 412, 588, 656, + 553, 596, 578, 608, 650, 663, 417, 114, 612, 267, + 646, 591, 491, 498, 421, 482, 493, 386, 260, 148, + 150, 238, 176, 302, 305, 299, 426, 283, 284, 285, + 286, 287, 288, 518, 519, 123, 124, 508, 509, 601, + 437, 604, 115, 63, 64, 442, 372, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 153, 75, 141, + 241, 391, 116, 543, 168, 76, 523, 486, 546, 547, + 397, 398, 250, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 132 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -626,855 +635,872 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 61, 122, 480, 110, 128, 164, 140, 87, 141, 61, - 174, 300, 428, 257, 125, 187, 125, 188, 125, 62, - 125, 125, 20, 299, 578, 143, 255, 316, 62, 20, - 125, 125, 258, 597, 439, 86, 315, 170, 440, 163, - 20, 632, 61, 244, 160, 125, 168, 125, 227, 448, - 228, 158, 171, 86, 474, 467, 444, 172, 20, 190, - 191, 62, 529, 20, 482, 17, 468, 22, -329, 181, - -329, 24, 240, 530, 241, 633, -331, 123, -331, 16, - 146, 126, 124, 126, 171, 126, 86, 126, 126, 172, - 139, 154, 152, 253, 159, 123, -291, 126, 126, 260, - 124, 151, 186, -290, 164, 270, 182, 183, 184, 185, - 509, 275, 166, 186, 126, 287, 156, 288, 657, -292, - 650, 195, 263, 312, 313, 264, 265, 266, 267, 164, - 157, 245, 189, 431, 475, 294, 297, 297, 163, -294, - 226, 246, 234, 309, 310, 457, 290, -293, 61, 61, - 305, 193, 194, 441, 542, 125, 239, -337, 225, 248, - 303, 404, 192, 163, 406, 136, 308, 62, 62, 458, - 127, 424, -333, 460, 131, 137, 133, 134, 184, 185, - 182, 183, 184, 185, 462, 236, 148, 149, 227, 237, - 228, 318, 319, 320, 321, 233, 323, 324, 326, 286, - 459, 167, 242, 169, 514, 571, 572, 593, 594, 182, - 183, 184, 185, 182, 183, 184, 185, -98, 376, 20, - 243, 249, 166, 22, 394, 378, 395, 24, 383, 182, - 183, 184, 185, 250, 251, 368, 369, 370, 371, 372, - 373, 374, 375, 604, 256, 182, 183, 184, 185, 182, - 183, 184, 185, 520, 259, 407, 480, 469, 430, 559, - 182, 183, 184, 185, -329, 586, -329, 620, 182, 183, - 184, 185, 409, 409, 409, 413, 409, 262, 268, 445, - 182, 183, 184, 185, 282, 297, 429, 636, 366, 461, - 291, 61, 420, 272, -331, 512, -331, 273, 385, 386, - 388, 274, 396, 397, 293, 399, 400, 229, 393, 230, - 62, 311, 355, 356, 602, 357, 410, 411, 358, 414, - 436, 231, 359, 232, 296, 438, 360, 361, 463, 182, - 183, 184, 185, 519, 301, 182, 183, 184, 185, 302, - 182, 183, 184, 185, 304, 306, 625, 626, 627, 314, - 182, 183, 184, 185, 125, 316, 362, 182, 183, 184, - 185, 377, 638, 639, 382, 446, 447, 380, 381, 18, - 387, 297, 398, 454, 552, 20, 394, 317, 395, 22, - 402, 363, 651, 24, 415, 490, 479, 422, 164, 389, - 654, 418, 423, 425, 473, 473, 182, 183, 184, 185, - 435, 182, 183, 184, 185, 484, 434, 437, 413, 489, - 439, 449, 581, 450, 451, 452, 505, 455, 465, 470, - 510, 126, 163, 471, 492, 478, 582, 494, 197, 198, - 364, 263, 504, 499, 264, 265, 266, 267, 500, 508, - 522, 182, 183, 184, 185, 61, 516, 518, 515, 523, - 197, 477, 524, 525, 486, 526, 532, 533, 491, 537, - 393, 495, 20, 197, 62, 218, 219, 182, 183, 184, - 185, 220, 539, 543, 221, 222, 223, 224, 225, 540, - 495, 547, 544, 294, 546, 549, 551, 556, 297, 182, - 183, 184, 185, 220, 558, 473, 221, 222, 223, 224, - 225, 219, 561, 560, 433, 164, 220, 562, 61, 221, - 222, 223, 224, 225, 182, 183, 184, 185, 557, 563, - 569, 527, 575, 528, 584, 567, 568, 62, 182, 183, - 184, 185, 573, 570, 538, 583, 576, 587, 536, 163, - 297, 182, 183, 184, 185, 589, 473, 473, 591, 590, - 599, 442, 600, 601, 130, 619, 132, 595, 595, 135, - 610, 142, 144, 260, 623, 456, 624, 629, 644, 605, - 606, 607, 613, 609, 153, 637, 617, 155, 502, 642, - 614, 161, 645, 489, 473, 565, 618, 648, 175, 176, - 177, 178, 179, 621, 622, 260, 260, 260, 182, 183, - 184, 185, -337, -337, -337, 224, 225, 115, 473, 658, - 269, 260, 260, 182, 183, 184, 185, 641, 487, 655, - 603, 550, 501, 646, 417, 643, 421, 285, 473, 652, - 649, 260, 598, 555, 503, 513, 392, 611, 495, 260, - 479, 653, 608, 595, 196, 0, 485, 0, 0, 0, - 521, 659, 197, 198, 199, 1, 2, 3, 4, 5, - 6, 7, 0, 0, 0, 200, 0, 0, 0, 284, - 0, 201, 202, 203, 443, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 0, 0, 0, 0, 220, 0, 0, 221, 222, - 223, 224, 225, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 322, - 0, 0, 0, 0, 0, 327, 0, 0, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, -13, 88, 0, 354, 0, 0, - 0, 0, 0, 0, 18, 86, 0, 19, 0, 0, - 20, 0, 0, 21, 22, 23, 89, 0, 24, 25, - 90, 91, 92, 26, 27, 93, 94, 0, 0, 95, - 96, 97, 98, 0, 99, 0, 0, 100, 28, 29, - 101, 102, 103, 30, 31, 104, 32, 33, 34, 35, - 36, 37, 0, 38, 39, 40, 41, 42, 43, 105, - 114, 44, 0, 106, 45, 46, 47, 48, 49, 50, - 0, 0, 0, 51, 52, 53, 0, 0, 0, 0, - 0, 107, 0, 0, 0, 0, 0, 0, 54, 0, + 61, 125, 131, 167, 143, 144, 490, 87, 177, 61, + 306, 438, 613, 307, 128, 190, 128, 191, 128, 62, + 128, 128, 263, 259, 113, 146, 592, 261, 62, 161, + 128, 128, 20, 264, 323, 173, 22, 449, 322, 166, + 24, 20, 61, 86, 163, 128, 171, 128, 450, 20, + 185, 186, 187, 188, 230, 247, 231, -333, 129, -333, + 129, 62, 129, 86, 129, 129, 16, 142, 20, 184, + 243, 244, 162, 477, 129, 129, 154, 458, 484, 130, + -335, 648, -335, 134, 478, 136, 137, 324, 492, 169, + 189, 129, 155, 500, 501, 151, 152, 256, 521, 673, + 159, 17, 266, 441, 149, 167, -295, 451, 126, -294, + 170, 468, 172, 127, 282, 157, 294, 295, 649, 185, + 186, 187, 188, 541, 319, 320, 666, 86, -296, 277, + 167, -298, 20, 242, 542, 192, 251, 139, 301, 304, + 304, 166, 160, 174, 316, 317, 248, 140, 175, 297, + 189, 61, 61, 312, -297, 195, 249, 20, 128, 193, + 194, 22, 434, 310, 485, 24, 166, 196, 197, 315, + 62, 62, 126, 413, 454, -337, 415, 127, 237, 293, + 198, 554, 185, 186, 187, 188, 185, 186, 187, 188, + 185, 186, 187, 188, 325, 326, 327, 328, 229, 330, + 331, 333, 169, 362, 363, 174, 364, 279, 236, 365, + 175, 280, 239, 366, 470, 281, 240, 367, 368, 245, + 230, 383, 231, 318, 262, 401, 402, 472, 385, 419, + 420, 390, 423, 424, 585, 586, -341, 228, 375, 376, + 377, 378, 379, 380, 381, 382, 187, 188, 479, 526, + 369, 269, 246, 252, 270, 271, 272, 273, 609, 610, + 274, 416, 253, 440, 185, 186, 187, 188, 373, 490, + 254, 602, 532, 255, 620, 370, 573, 257, 418, 418, + 418, 422, 418, 418, 455, -333, 265, -333, 400, 268, + 275, 439, 304, 185, 186, 187, 188, 289, 61, 430, + 636, 432, 298, 467, 524, 300, 185, 186, 187, 188, + 308, 303, 185, 186, 187, 188, 469, 62, 309, -335, + 652, -335, 311, 321, 371, 313, 471, 446, 185, 186, + 187, 188, 448, 618, 232, 473, 233, 392, 393, 395, + 323, 403, 404, 384, 406, 407, 408, 409, 531, -102, + 389, 185, 186, 187, 188, 185, 186, 187, 188, 387, + 394, 128, -341, -341, -341, 227, 228, 641, 642, 643, + 566, 388, 456, 457, 185, 186, 187, 188, 304, 405, + 464, 401, 402, 654, 655, 411, 428, 185, 186, 187, + 188, 200, 201, 489, 502, 433, 167, 185, 186, 187, + 188, 483, 483, 667, 200, 129, 185, 186, 187, 188, + 425, 670, 494, 200, 435, 422, 499, 483, 483, 185, + 186, 187, 188, 445, 598, 597, 517, 444, 221, 222, + 522, 234, 166, 235, 223, 487, 447, 224, 225, 226, + 227, 228, 222, 449, 400, 465, 459, 223, 534, 475, + 224, 225, 226, 227, 228, 61, 223, 460, 527, 224, + 225, 226, 227, 228, 581, 582, 18, 185, 186, 187, + 188, 587, 20, 461, 62, 462, 22, 593, 594, 269, + 24, 480, 270, 271, 272, 273, 396, 481, 274, 185, + 186, 187, 188, 561, 488, 301, 504, 496, 506, 511, + 304, 512, 520, 503, 443, 483, 507, 516, 528, 530, + 621, 622, 623, 574, 535, 536, 625, 167, 537, 538, + 61, 544, 545, 552, 549, 548, 507, 20, 551, 634, + 571, 185, 186, 187, 188, 555, 637, 638, 556, 62, + 185, 186, 187, 188, 185, 186, 187, 188, 557, 599, + 560, 563, 565, 166, 304, 558, 570, 572, 483, 483, + 657, 575, 607, 185, 186, 187, 188, 539, 452, 540, + 577, 611, 611, 665, 576, 583, 584, 266, 600, 590, + 550, 466, 645, 589, 669, 603, 606, 605, 629, 615, + 616, 617, 633, 626, 675, 635, 630, 499, 483, 639, + 514, 185, 186, 187, 188, 185, 186, 187, 188, 640, + 653, 266, 266, 266, 1, 2, 3, 4, 5, 6, + 7, 658, 660, 614, 483, 661, 118, 266, 266, 619, + 664, 276, 671, 579, 674, 624, 431, 497, 525, 662, + 427, 659, 533, 564, 483, 668, 133, 266, 135, 513, + 569, 138, 627, 145, 147, 266, 489, 515, 292, 611, + 495, 399, 0, 0, 0, 0, 156, 0, 0, 158, + 0, 0, 0, 164, 0, -13, 88, 0, 0, 0, + 178, 179, 180, 181, 182, 18, 86, 0, 19, 0, + 507, 20, 0, 0, 21, 22, 23, 89, 0, 24, + 25, 90, 91, 92, 26, 27, 93, 94, 0, 0, + 95, 96, 97, 98, 0, 99, 100, 101, 102, 0, + 0, 103, 28, 29, 104, 105, 106, 30, 31, 107, + 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, + 41, 42, 43, 108, 117, 44, 0, 109, 45, 46, + 47, 48, 49, 50, 0, 0, 0, 51, 52, 53, + 0, 0, 0, 0, 291, 110, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -3, 88, 55, - 56, 0, 57, 0, 58, 59, 0, 18, 86, 0, - 19, 0, 60, 20, 0, 0, 21, 22, 23, 89, - 0, 24, 25, 90, 91, 92, 26, 27, 93, 94, - 0, 0, 95, 96, 97, 98, 0, 99, 0, 0, - 100, 28, 29, 101, 102, 103, 30, 31, 104, 32, - 33, 34, 35, 36, 37, 0, 38, 39, 40, 41, - 42, 43, 105, 114, 44, 0, 106, 45, 46, 47, - 48, 49, 50, 0, 0, 0, 51, 52, 53, 0, - 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, - 0, 54, 0, 0, 0, 196, 0, 0, 0, 0, - 0, 0, 0, 197, 198, 199, 517, 0, 0, 0, - 0, 0, 55, 56, 0, 57, 200, 58, 59, 0, - 0, 0, 201, 202, 203, 60, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 0, 0, 0, 0, 220, 0, 0, 221, - 222, 223, 224, 225, 0, 0, 88, 0, 0, 0, - 0, 0, 553, 554, 0, 18, 86, 464, 19, 0, - 0, 20, 0, 0, 21, 22, 23, 89, 0, 24, + 0, 0, 0, 55, 56, 0, 57, 0, 58, 59, + 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, + 0, 0, 0, 0, 329, 0, 0, 0, 0, 0, + 334, 0, 0, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, -3, + 88, 0, 361, 0, 0, 0, 0, 0, 0, 18, + 86, 0, 19, 0, 0, 20, 0, 0, 21, 22, + 23, 89, 0, 24, 25, 90, 91, 92, 26, 27, + 93, 94, 0, 0, 95, 96, 97, 98, 0, 99, + 100, 101, 102, 0, 0, 103, 28, 29, 104, 105, + 106, 30, 31, 107, 32, 33, 34, 35, 36, 37, + 0, 38, 39, 40, 41, 42, 43, 108, 117, 44, + 0, 109, 45, 46, 47, 48, 49, 50, 0, 0, + 0, 51, 52, 53, 0, 0, 0, 0, 0, 110, + 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 88, 55, 56, 0, + 57, 0, 58, 59, 0, 18, 86, 474, 19, 0, + 60, 20, 0, 0, 21, 22, 23, 89, 0, 24, 25, 90, 91, 92, 26, 27, 93, 94, 0, 0, - 95, 96, 97, 98, 566, 99, 0, 0, 100, 28, - 29, 101, 102, 103, 30, 31, 104, 32, 33, 34, - 35, 36, 37, 0, 38, 39, 40, 41, 42, 43, - 105, 114, 44, 0, 106, 45, 46, 47, 48, 49, - 50, 0, 0, 0, 51, 52, 53, 0, 0, 0, - 0, 0, 107, 0, 0, 0, 0, 0, 0, 54, + 95, 96, 97, 98, 0, 99, 100, 101, 102, 0, + 0, 103, 28, 29, 104, 105, 106, 30, 31, 107, + 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, + 41, 42, 43, 108, 117, 44, 0, 109, 45, 46, + 47, 48, 49, 50, 0, 0, 0, 51, 52, 53, + 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, + 0, 199, 0, 0, 0, 0, 0, 0, 529, 200, + 201, 202, 0, 55, 56, 0, 57, 0, 58, 59, + 0, 0, 203, 0, 0, 0, 60, 0, 204, 205, + 206, 453, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 0, 0, + 0, 0, 223, 0, 0, 224, 225, 226, 227, 228, + 88, 0, 0, 0, 0, 0, 567, 568, 0, 18, + 86, 559, 19, 0, 0, 20, 0, 0, 21, 22, + 23, 89, 0, 24, 25, 90, 91, 92, 26, 27, + 93, 94, 0, 0, 95, 96, 97, 98, 580, 99, + 100, 101, 102, 0, 0, 103, 28, 29, 104, 105, + 106, 30, 31, 107, 32, 33, 34, 35, 36, 37, + 0, 38, 39, 40, 41, 42, 43, 108, 117, 44, + 0, 109, 45, 46, 47, 48, 49, 50, 0, 0, + 0, 51, 52, 53, 0, 0, 0, 0, 0, 110, + 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, - 55, 56, 0, 57, 0, 58, 59, 0, 18, 86, - 545, 19, 0, 60, 20, 0, 0, 21, 22, 23, - 89, 0, 24, 25, 90, 91, 92, 26, 27, 93, - 94, 0, 0, 95, 96, 97, 98, 0, 99, 0, - 0, 100, 28, 29, 101, 102, 103, 30, 31, 104, + 0, 0, 0, 0, 0, 0, 88, 55, 56, 0, + 57, 0, 58, 59, 0, 18, 86, 628, 19, 0, + 60, 20, 0, 0, 21, 22, 23, 89, 0, 24, + 25, 90, 91, 92, 26, 27, 93, 94, 0, 0, + 95, 96, 97, 98, 0, 99, 100, 101, 102, 0, + 0, 103, 28, 29, 104, 105, 106, 30, 31, 107, 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, - 41, 42, 43, 105, 114, 44, 0, 106, 45, 46, + 41, 42, 43, 108, 117, 44, 0, 109, 45, 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, 53, - 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 55, 56, 0, 57, 0, 58, 59, - 0, 18, 86, 612, 19, 0, 60, 20, 0, 0, + 0, 18, 86, 632, 19, 0, 60, 20, 0, 0, 21, 22, 23, 89, 0, 24, 25, 90, 91, 92, 26, 27, 93, 94, 0, 0, 95, 96, 97, 98, - 0, 99, 0, 0, 100, 28, 29, 101, 102, 103, - 30, 31, 104, 32, 33, 34, 35, 36, 37, 0, - 38, 39, 40, 41, 42, 43, 105, 114, 44, 0, - 106, 45, 46, 47, 48, 49, 50, 0, 0, 0, - 51, 52, 53, 0, 0, 0, 0, 0, 107, 0, - 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 88, 55, 56, 0, 57, - 0, 58, 59, 0, 18, 86, 616, 19, 0, 60, - 20, 0, 0, 21, 22, 23, 89, 0, 24, 25, - 90, 91, 92, 26, 27, 93, 94, 0, 0, 95, - 96, 97, 98, 0, 99, 0, 0, 100, 28, 29, - 101, 102, 103, 30, 31, 104, 32, 33, 34, 35, - 36, 37, 0, 38, 39, 40, 41, 42, 43, 105, - 114, 44, 0, 106, 45, 46, 47, 48, 49, 50, + 0, 99, 100, 101, 102, 0, 0, 103, 28, 29, + 104, 105, 106, 30, 31, 107, 32, 33, 34, 35, + 36, 37, 0, 38, 39, 40, 41, 42, 43, 108, + 117, 44, 0, 109, 45, 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, 53, 0, 0, 0, 0, - 0, 107, 0, 0, 0, 0, 0, 0, 54, 0, + 0, 110, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 55, - 56, 0, 57, 0, 58, 59, 0, 18, 86, 631, + 56, 0, 57, 0, 58, 59, 0, 18, 86, 647, 19, 0, 60, 20, 0, 0, 21, 22, 23, 89, 0, 24, 25, 90, 91, 92, 26, 27, 93, 94, - 0, 0, 95, 96, 97, 98, 0, 99, 0, 0, - 100, 28, 29, 101, 102, 103, 30, 31, 104, 32, - 33, 34, 35, 36, 37, 0, 38, 39, 40, 41, - 42, 43, 105, 114, 44, 0, 106, 45, 46, 47, - 48, 49, 50, 0, 0, 0, 51, 52, 53, 0, - 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, - 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 88, 55, 56, 0, 57, 0, 58, 59, 0, - 18, 86, 635, 19, 0, 60, 20, 0, 0, 21, - 22, 23, 89, 0, 24, 25, 90, 91, 92, 26, - 27, 93, 94, 0, 0, 95, 96, 97, 98, 0, - 99, 0, 0, 100, 28, 29, 101, 102, 103, 30, - 31, 104, 32, 33, 34, 35, 36, 37, 0, 38, - 39, 40, 41, 42, 43, 105, 114, 44, 0, 106, + 0, 0, 95, 96, 97, 98, 0, 99, 100, 101, + 102, 0, 0, 103, 28, 29, 104, 105, 106, 30, + 31, 107, 32, 33, 34, 35, 36, 37, 0, 38, + 39, 40, 41, 42, 43, 108, 117, 44, 0, 109, 45, 46, 47, 48, 49, 50, 0, 0, 0, 51, - 52, 53, 0, 0, 0, 0, 0, 107, 0, 0, + 52, 53, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 55, 56, 0, 57, 0, - 58, 59, 0, 18, 86, 0, 19, 0, 60, 20, + 58, 59, 0, 18, 86, 651, 19, 0, 60, 20, 0, 0, 21, 22, 23, 89, 0, 24, 25, 90, 91, 92, 26, 27, 93, 94, 0, 0, 95, 96, - 97, 98, 0, 99, 0, 0, 100, 28, 29, 101, - 102, 103, 30, 31, 104, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 105, 114, - 44, 0, 106, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 656, 0, 0, - 107, 0, 0, 0, 0, 0, 0, 54, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 88, 55, 56, - 0, 57, 0, 58, 59, 0, 18, 86, 0, 19, - 0, 60, 20, 0, 0, 21, 22, 23, 89, 0, - 24, 25, 90, 91, 92, 26, 27, 93, 94, 0, - 0, 95, 96, 97, 98, 0, 99, 0, 0, 100, - 28, 29, 101, 102, 103, 30, 31, 104, 32, 33, + 97, 98, 0, 99, 100, 101, 102, 0, 0, 103, + 28, 29, 104, 105, 106, 30, 31, 107, 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, 41, 42, - 43, 105, 114, 44, 0, 106, 45, 46, 47, 48, + 43, 108, 117, 44, 0, 109, 45, 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, 53, 0, 0, - 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 55, 56, 0, 57, 0, 58, 59, 0, 18, 86, 0, 19, 0, 60, 20, 0, 0, 21, 22, 23, 89, 0, 24, 25, 90, 91, 92, 26, 27, 93, 94, 0, 0, 95, 96, 97, 98, 0, 99, - 0, 0, 100, 28, 29, 101, 102, 103, 30, 31, - 104, 32, 33, 34, 35, 36, 37, 0, 38, 39, - 40, 41, 42, 43, 105, 0, 44, 0, 106, 45, - 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, - 53, 0, 88, 0, 0, 0, 107, 0, 0, 0, - 0, 18, 0, 54, 19, 0, 0, 20, 0, 0, - 21, 22, 23, -19, 0, 24, 25, 0, 0, 0, - 26, 27, 0, 0, 55, 56, 0, 57, 0, 58, - 59, 0, 0, 0, 0, 28, 29, 60, 0, 0, - 30, 31, 0, 32, 33, 34, 35, 36, 37, 0, - 38, 39, 40, 41, 42, 43, 0, 0, 44, 0, - 0, 45, 46, 47, 48, 49, 50, 0, 0, 0, - 51, 52, 53, 0, 88, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 54, 19, 0, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 55, 56, 0, 57, - 0, 58, 59, 0, 0, 0, 0, 28, 29, 60, - 0, 0, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 86, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - -19, 60, 30, 31, 0, 32, 162, 34, 35, 36, - 37, 124, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 86, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 0, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 0, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 180, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 289, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, -336, 227, 0, 228, 54, 0, -336, - 0, 0, -336, -336, -336, 0, 0, -336, -336, 0, - 0, 0, -336, -336, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, -336, -336, 0, - 307, 60, -336, -336, 0, -336, -336, -336, -336, -336, - -336, 0, -336, -336, -336, -336, -336, -336, 0, 0, - -336, 0, 0, -336, -336, -336, -336, -336, -336, 0, - 0, 0, -336, -336, -336, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, -336, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, -336, -336, - 0, -336, 0, -336, -336, 0, 0, 28, 29, 0, - 0, -336, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 325, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 367, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 419, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 453, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 19, 54, 0, 20, - 0, 0, 21, 22, 23, 0, 0, 24, 25, 0, - 0, 0, 26, 27, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, 28, 29, 0, - 0, 60, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 0, 0, - 44, 0, 0, 45, 46, 47, 48, 49, 50, 0, - 0, 0, 51, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, -335, 0, 0, -335, 54, 0, -335, - 0, 0, -335, -335, -335, 0, 0, -335, -335, 0, - 0, 0, -335, -335, 0, 0, 0, 0, 55, 56, - 0, 57, 0, 58, 59, 0, 0, -335, -335, 0, - 0, 283, -335, -335, 0, -335, -335, -335, -335, -335, - -335, 0, -335, -335, -335, -335, -335, -335, 0, 0, - -335, 0, 0, -335, -335, -335, -335, -335, -335, 0, - 0, 0, -335, -335, -335, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -335, 0, 0, - 0, 196, 0, 0, 0, 0, 0, 0, 0, 197, - 198, 199, 0, 0, 0, 0, 0, 0, -335, -335, - 0, -335, -337, -335, -335, 0, 0, 0, 201, 202, - 203, -335, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 0, 0, - 0, 0, 220, 196, 0, 221, 222, 223, 224, 225, - 0, 197, 198, 199, 0, 0, 0, 0, 0, 0, + 100, 101, 102, 0, 0, 103, 28, 29, 104, 105, + 106, 30, 31, 107, 32, 33, 34, 35, 36, 37, + 0, 38, 39, 40, 41, 42, 43, 108, 117, 44, + 0, 109, 45, 46, 47, 48, 49, 50, 0, 0, + 0, 51, 52, 53, 0, 0, 672, 0, 0, 110, + 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 201, 202, 203, 0, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 0, 0, 0, 0, 220, 196, 0, 221, 222, 223, - 224, 225, 0, 197, 198, 199, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 88, 55, 56, 0, + 57, 0, 58, 59, 0, 18, 86, 0, 19, 0, + 60, 20, 0, 0, 21, 22, 23, 89, 0, 24, + 25, 90, 91, 92, 26, 27, 93, 94, 0, 0, + 95, 96, 97, 98, 0, 99, 100, 101, 102, 0, + 0, 103, 28, 29, 104, 105, 106, 30, 31, 107, + 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, + 41, 42, 43, 108, 117, 44, 0, 109, 45, 46, + 47, 48, 49, 50, 0, 0, 0, 51, 52, 53, + 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 203, 0, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 0, 0, 0, 0, 220, -337, 0, 221, - 222, 223, 224, 225, 0, 197, 198, 199, 0, 0, + 0, 0, 88, 55, 56, 0, 57, 0, 58, 59, + 0, 18, 86, 0, 19, 0, 60, 20, 0, 0, + 21, 22, 23, 89, 0, 24, 25, 90, 91, 92, + 26, 27, 93, 94, 0, 0, 95, 96, 97, 98, + 0, 99, 100, 101, 102, 0, 0, 103, 28, 29, + 104, 105, 106, 30, 31, 107, 32, 33, 34, 35, + 36, 37, 0, 38, 39, 40, 41, 42, 43, 108, + 0, 44, 0, 109, 45, 46, 47, 48, 49, 50, + 0, 0, 0, 51, 52, 53, 0, 88, 0, 0, + 0, 110, 0, 0, 0, 0, 18, 0, 54, 19, + 0, 0, 20, 0, 0, 21, 22, 23, -19, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 55, + 56, 0, 57, 0, 58, 59, 0, 0, 0, 0, + 0, 0, 60, 28, 29, 0, 0, 0, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 88, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 0, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 86, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, -19, 60, 30, 31, + 0, 32, 165, 34, 35, 36, 37, 127, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 86, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 0, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 0, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 183, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 296, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, -340, 230, 0, 231, + 0, 0, -340, 54, 0, -340, -340, -340, 0, 0, + -340, -340, 0, 0, 0, -340, -340, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, -340, -340, 0, 314, 60, -340, -340, + 0, -340, -340, -340, -340, -340, -340, 0, -340, -340, + -340, -340, -340, -340, 0, 0, -340, 0, 0, -340, + -340, -340, -340, -340, -340, 0, 0, 0, -340, -340, + -340, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, -340, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, -340, -340, 0, -340, 0, -340, + -340, 0, 0, 28, 29, 0, 0, -340, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 332, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 374, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 429, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 463, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, 18, 0, 0, 19, + 0, 0, 20, 54, 0, 21, 22, 23, 0, 0, + 24, 25, 0, 0, 0, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, 28, 29, 0, 0, 60, 30, 31, + 0, 32, 33, 34, 35, 36, 37, 0, 38, 39, + 40, 41, 42, 43, 0, 0, 44, 0, 0, 45, + 46, 47, 48, 49, 50, 0, 0, 0, 51, 52, + 53, 0, 0, 0, 0, 0, -339, 0, 0, -339, + 0, 0, -339, 54, 0, -339, -339, -339, 0, 0, + -339, -339, 0, 0, 0, -339, -339, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 0, 57, 0, 58, + 59, 0, 0, -339, -339, 0, 0, 290, -339, -339, + 0, -339, -339, -339, -339, -339, -339, 0, -339, -339, + -339, -339, -339, -339, 0, 0, -339, 0, 0, -339, + -339, -339, -339, -339, -339, 0, 0, 0, -339, -339, + -339, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -339, 0, 0, 0, 199, 0, 0, + 0, 0, 0, 0, 0, 200, 201, 202, 0, 0, + 0, 0, 0, 0, -339, -339, 0, -339, 203, -339, + -339, 0, 0, 0, 204, 205, 206, -339, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 0, 0, 0, 0, 223, 199, + 0, 224, 225, 226, 227, 228, 0, 200, 201, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 197, 198, 199, 0, 220, 0, - 0, 221, 222, 223, 224, 225, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 197, 198, 199, + -341, 0, 0, 0, 0, 0, 204, 205, 206, 0, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 0, 0, 0, 0, 220, 0, 0, - 221, 222, 223, 224, 225, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 197, 198, 199, 0, - 220, 0, 0, 221, 222, 223, 224, 225, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 197, 198, 199, - 0, 0, 0, 0, 0, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 0, 197, 198, 199, 220, - 0, 0, 221, 222, 223, 224, 225, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 197, 198, 199, 0, - 220, 0, 0, 221, 222, 223, 224, 225, 213, 214, - 215, 216, 217, 218, 219, 197, 198, 199, 0, 220, - 0, 0, 221, 222, 223, 224, 225, 0, 0, 0, - 215, 216, 217, 218, 219, 197, 198, 199, 0, 220, - 0, 0, 221, 222, 223, 224, 225, 0, 0, -337, - 216, 217, 218, 219, 197, 198, 199, 0, 220, 0, - 0, 221, 222, 223, 224, 225, 0, 0, 0, 0, - 216, 217, 218, 219, 0, 0, 0, 0, 220, 0, - 0, 221, 222, 223, 224, 225, 0, 0, 0, 0, - 217, 218, 219, 0, 0, 0, 0, 220, 0, 0, - 221, 222, 223, 224, 225 + 217, 218, 219, 220, 221, 222, 0, 0, 0, 0, + 223, 199, 0, 224, 225, 226, 227, 228, 0, 200, + 201, 202, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, + 206, 0, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 0, 0, + 0, 0, 223, 199, 0, 224, 225, 226, 227, 228, + 0, 200, 201, 202, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 206, 0, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 0, 0, 0, 0, 223, -341, 0, 224, 225, 226, + 227, 228, 0, 200, 201, 202, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 200, 201, 202, 0, 223, 0, 0, 224, + 225, 226, 227, 228, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 200, 201, 202, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 0, 0, 0, 0, 223, 0, 0, 224, 225, + 226, 227, 228, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 200, 201, 202, 0, 223, 0, + 0, 224, 225, 226, 227, 228, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 200, 201, 202, 0, 0, + 0, 0, 0, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 0, 200, 201, 202, 223, 0, 0, + 224, 225, 226, 227, 228, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 200, 201, 202, 0, 223, 0, + 0, 224, 225, 226, 227, 228, 216, 217, 218, 219, + 220, 221, 222, 200, 201, 202, 0, 223, 0, 0, + 224, 225, 226, 227, 228, 0, 0, 0, 218, 219, + 220, 221, 222, 200, 201, 202, 0, 223, 0, 0, + 224, 225, 226, 227, 228, 0, 0, -341, 219, 220, + 221, 222, 200, 201, 202, 0, 223, 0, 0, 224, + 225, 226, 227, 228, 0, 0, 0, 0, 219, 220, + 221, 222, 0, 0, 0, 0, 223, 0, 0, 224, + 225, 226, 227, 228, 0, 0, 0, 0, 220, 221, + 222, 0, 0, 0, 0, 223, 0, 0, 224, 225, + 226, 227, 228 }; static const yytype_int16 yycheck[] = { - 10, 17, 396, 12, 19, 49, 27, 11, 27, 19, - 54, 148, 299, 107, 18, 11, 20, 13, 22, 10, - 24, 25, 16, 147, 544, 29, 102, 13, 19, 16, - 34, 35, 108, 568, 13, 11, 173, 52, 22, 49, - 16, 22, 52, 30, 48, 49, 50, 51, 11, 25, - 13, 85, 53, 11, 386, 11, 25, 58, 16, 108, - 109, 52, 11, 16, 396, 9, 22, 20, 11, 60, - 13, 24, 93, 22, 93, 56, 11, 53, 13, 0, - 31, 18, 58, 20, 53, 22, 11, 24, 25, 58, - 27, 42, 128, 100, 128, 53, 82, 34, 35, 109, - 58, 13, 15, 82, 148, 114, 90, 91, 92, 93, - 23, 121, 49, 15, 51, 136, 128, 136, 653, 82, - 640, 106, 32, 167, 168, 35, 36, 37, 38, 173, - 128, 118, 128, 14, 128, 145, 146, 147, 148, 82, - 128, 128, 86, 158, 159, 22, 137, 82, 158, 159, - 154, 106, 107, 14, 486, 159, 93, 125, 126, 96, - 151, 255, 108, 173, 258, 118, 157, 158, 159, 14, - 18, 295, 11, 14, 22, 128, 24, 25, 92, 93, - 90, 91, 92, 93, 14, 53, 34, 35, 11, 53, - 13, 182, 183, 184, 185, 11, 187, 188, 189, 136, - 22, 49, 128, 51, 14, 537, 538, 33, 34, 90, - 91, 92, 93, 90, 91, 92, 93, 127, 234, 16, - 128, 128, 159, 20, 245, 235, 245, 24, 238, 90, - 91, 92, 93, 128, 11, 226, 227, 228, 229, 230, - 231, 232, 233, 575, 22, 90, 91, 92, 93, 90, - 91, 92, 93, 14, 39, 259, 650, 381, 302, 14, - 90, 91, 92, 93, 11, 552, 13, 599, 90, 91, - 92, 93, 263, 264, 265, 266, 267, 22, 22, 355, - 90, 91, 92, 93, 14, 295, 301, 619, 225, 22, - 82, 301, 283, 16, 11, 432, 13, 20, 242, 243, - 244, 24, 246, 247, 56, 249, 250, 11, 245, 13, - 301, 159, 10, 11, 573, 13, 264, 265, 16, 267, - 311, 11, 20, 13, 82, 316, 24, 25, 22, 90, - 91, 92, 93, 22, 128, 90, 91, 92, 93, 85, - 90, 91, 92, 93, 127, 127, 605, 606, 607, 22, - 90, 91, 92, 93, 358, 13, 54, 90, 91, 92, - 93, 53, 621, 622, 82, 356, 357, 53, 53, 10, - 118, 381, 128, 364, 498, 16, 397, 127, 397, 20, - 41, 79, 641, 24, 58, 401, 396, 127, 432, 30, - 649, 15, 56, 56, 385, 386, 90, 91, 92, 93, - 127, 90, 91, 92, 93, 396, 86, 12, 399, 400, - 13, 25, 549, 25, 25, 25, 426, 128, 18, 56, - 430, 358, 432, 95, 53, 128, 550, 22, 76, 77, - 128, 32, 128, 95, 35, 36, 37, 38, 95, 127, - 455, 90, 91, 92, 93, 455, 12, 128, 439, 12, - 76, 388, 12, 12, 398, 12, 127, 127, 402, 128, - 397, 405, 16, 76, 455, 113, 114, 90, 91, 92, - 93, 119, 127, 127, 122, 123, 124, 125, 126, 22, - 424, 491, 127, 493, 128, 53, 11, 11, 498, 90, - 91, 92, 93, 119, 86, 486, 122, 123, 124, 125, - 126, 114, 12, 518, 127, 549, 119, 127, 518, 122, - 123, 124, 125, 126, 90, 91, 92, 93, 509, 22, - 15, 465, 128, 467, 22, 532, 533, 518, 90, 91, - 92, 93, 539, 127, 478, 551, 127, 127, 475, 549, - 550, 90, 91, 92, 93, 127, 537, 538, 564, 84, - 128, 127, 127, 127, 21, 128, 23, 567, 568, 26, - 22, 28, 29, 573, 22, 127, 127, 42, 17, 576, - 577, 578, 588, 580, 41, 127, 592, 44, 127, 127, - 590, 48, 83, 574, 575, 529, 593, 127, 55, 56, - 57, 58, 59, 600, 601, 605, 606, 607, 90, 91, - 92, 93, 122, 123, 124, 125, 126, 13, 599, 127, - 114, 621, 622, 90, 91, 92, 93, 624, 399, 650, - 574, 493, 418, 633, 276, 629, 285, 136, 619, 645, - 637, 641, 569, 504, 424, 127, 245, 582, 582, 649, - 650, 648, 579, 653, 68, -1, 397, -1, -1, -1, - 127, 658, 76, 77, 78, 3, 4, 5, 6, 7, - 8, 9, -1, -1, -1, 89, -1, -1, -1, 136, - -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, -1, -1, -1, -1, 119, -1, -1, 122, 123, - 124, 125, 126, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 186, - -1, -1, -1, -1, -1, 192, -1, -1, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 0, 1, -1, 224, -1, -1, - -1, -1, -1, -1, 10, 11, -1, 13, -1, -1, - 16, -1, -1, 19, 20, 21, 22, -1, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, - 36, 37, 38, -1, 40, -1, -1, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, 61, 62, 63, 64, 65, - 66, 67, -1, 69, 70, 71, 72, 73, 74, 75, - -1, -1, -1, 79, 80, 81, -1, -1, -1, -1, - -1, 87, -1, -1, -1, -1, -1, -1, 94, -1, + 10, 17, 19, 49, 27, 27, 403, 11, 54, 19, + 150, 306, 582, 151, 18, 11, 20, 13, 22, 10, + 24, 25, 110, 103, 12, 29, 556, 105, 19, 88, + 34, 35, 16, 111, 13, 52, 20, 13, 176, 49, + 24, 16, 52, 11, 48, 49, 50, 51, 22, 16, + 93, 94, 95, 96, 11, 30, 13, 11, 18, 13, + 20, 52, 22, 11, 24, 25, 0, 27, 16, 60, + 93, 93, 131, 11, 34, 35, 13, 25, 393, 18, + 11, 22, 13, 22, 22, 24, 25, 130, 403, 49, + 15, 51, 131, 408, 409, 34, 35, 101, 23, 669, + 131, 9, 112, 14, 31, 151, 85, 14, 56, 85, + 49, 14, 51, 61, 124, 42, 139, 139, 59, 93, + 94, 95, 96, 11, 170, 171, 656, 11, 85, 117, + 176, 85, 16, 93, 22, 131, 96, 121, 148, 149, + 150, 151, 131, 56, 161, 162, 121, 131, 61, 140, + 15, 161, 162, 157, 85, 111, 131, 16, 162, 111, + 112, 20, 302, 154, 131, 24, 176, 109, 110, 160, + 161, 162, 56, 261, 25, 11, 264, 61, 86, 139, + 109, 496, 93, 94, 95, 96, 93, 94, 95, 96, + 93, 94, 95, 96, 185, 186, 187, 188, 131, 190, + 191, 192, 162, 10, 11, 56, 13, 16, 11, 16, + 61, 20, 56, 20, 14, 24, 56, 24, 25, 131, + 11, 237, 13, 162, 22, 248, 248, 14, 238, 270, + 271, 241, 273, 274, 549, 550, 128, 129, 229, 230, + 231, 232, 233, 234, 235, 236, 95, 96, 388, 14, + 57, 32, 131, 131, 35, 36, 37, 38, 33, 34, + 41, 265, 131, 309, 93, 94, 95, 96, 228, 666, + 131, 566, 14, 131, 589, 82, 14, 11, 269, 270, + 271, 272, 273, 274, 362, 11, 39, 13, 248, 22, + 22, 308, 302, 93, 94, 95, 96, 14, 308, 290, + 615, 130, 85, 22, 442, 59, 93, 94, 95, 96, + 131, 85, 93, 94, 95, 96, 22, 308, 88, 11, + 635, 13, 130, 22, 131, 130, 22, 318, 93, 94, + 95, 96, 323, 587, 11, 22, 13, 245, 246, 247, + 13, 249, 250, 56, 252, 253, 254, 255, 22, 130, + 85, 93, 94, 95, 96, 93, 94, 95, 96, 56, + 121, 365, 125, 126, 127, 128, 129, 621, 622, 623, + 510, 56, 363, 364, 93, 94, 95, 96, 388, 131, + 371, 404, 404, 637, 638, 44, 15, 93, 94, 95, + 96, 79, 80, 403, 410, 59, 442, 93, 94, 95, + 96, 392, 393, 657, 79, 365, 93, 94, 95, 96, + 61, 665, 403, 79, 59, 406, 407, 408, 409, 93, + 94, 95, 96, 130, 564, 563, 436, 89, 116, 117, + 440, 11, 442, 13, 122, 395, 12, 125, 126, 127, + 128, 129, 117, 13, 404, 131, 25, 122, 465, 18, + 125, 126, 127, 128, 129, 465, 122, 25, 449, 125, + 126, 127, 128, 129, 544, 545, 10, 93, 94, 95, + 96, 551, 16, 25, 465, 25, 20, 557, 558, 32, + 24, 59, 35, 36, 37, 38, 30, 98, 41, 93, + 94, 95, 96, 503, 131, 505, 56, 405, 22, 98, + 510, 98, 130, 411, 130, 496, 414, 131, 12, 131, + 590, 591, 592, 530, 12, 12, 596, 563, 12, 12, + 530, 130, 130, 22, 131, 485, 434, 16, 130, 609, + 521, 93, 94, 95, 96, 130, 616, 617, 130, 530, + 93, 94, 95, 96, 93, 94, 95, 96, 130, 565, + 131, 56, 11, 563, 564, 130, 11, 89, 549, 550, + 640, 12, 578, 93, 94, 95, 96, 475, 130, 477, + 22, 581, 582, 653, 130, 15, 130, 587, 22, 130, + 488, 130, 45, 131, 664, 130, 87, 130, 604, 131, + 130, 130, 608, 22, 674, 131, 606, 588, 589, 22, + 130, 93, 94, 95, 96, 93, 94, 95, 96, 130, + 130, 621, 622, 623, 3, 4, 5, 6, 7, 8, + 9, 130, 17, 583, 615, 86, 13, 637, 638, 588, + 130, 117, 666, 541, 130, 595, 292, 406, 130, 649, + 283, 645, 130, 505, 635, 661, 21, 657, 23, 428, + 516, 26, 598, 28, 29, 665, 666, 434, 139, 669, + 404, 248, -1, -1, -1, -1, 41, -1, -1, 44, + -1, -1, -1, 48, -1, 0, 1, -1, -1, -1, + 55, 56, 57, 58, 59, 10, 11, -1, 13, -1, + 598, 16, -1, -1, 19, 20, 21, 22, -1, 24, + 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, + 35, 36, 37, 38, -1, 40, 41, 42, 43, -1, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, + 75, 76, 77, 78, -1, -1, -1, 82, 83, 84, + -1, -1, -1, -1, 139, 90, -1, -1, -1, -1, + -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 0, 1, 115, - 116, -1, 118, -1, 120, 121, -1, 10, 11, -1, - 13, -1, 128, 16, -1, -1, 19, 20, 21, 22, - -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, - -1, -1, 35, 36, 37, 38, -1, 40, -1, -1, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, - 63, 64, 65, 66, 67, -1, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, 79, 80, 81, -1, - -1, -1, -1, -1, 87, -1, -1, -1, -1, -1, - -1, 94, -1, -1, -1, 68, -1, -1, -1, -1, - -1, -1, -1, 76, 77, 78, 443, -1, -1, -1, - -1, -1, 115, 116, -1, 118, 89, 120, 121, -1, - -1, -1, 95, 96, 97, 128, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, -1, -1, -1, -1, 119, -1, -1, 122, - 123, 124, 125, 126, -1, -1, 1, -1, -1, -1, - -1, -1, 499, 500, -1, 10, 11, 12, 13, -1, - -1, 16, -1, -1, 19, 20, 21, 22, -1, 24, + -1, -1, -1, 118, 119, -1, 121, -1, 123, 124, + -1, -1, -1, -1, -1, -1, 131, -1, -1, -1, + -1, -1, -1, -1, 189, -1, -1, -1, -1, -1, + 195, -1, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 0, + 1, -1, 227, -1, -1, -1, -1, -1, -1, 10, + 11, -1, 13, -1, -1, 16, -1, -1, 19, 20, + 21, 22, -1, 24, 25, 26, 27, 28, 29, 30, + 31, 32, -1, -1, 35, 36, 37, 38, -1, 40, + 41, 42, 43, -1, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + -1, 62, 63, 64, 65, 66, 67, 68, 69, 70, + -1, 72, 73, 74, 75, 76, 77, 78, -1, -1, + -1, 82, 83, 84, -1, -1, -1, -1, -1, 90, + -1, -1, -1, -1, -1, -1, 97, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, 118, 119, -1, + 121, -1, 123, 124, -1, 10, 11, 12, 13, -1, + 131, 16, -1, -1, 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, - 35, 36, 37, 38, 531, 40, -1, -1, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, - 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, - 75, -1, -1, -1, 79, 80, 81, -1, -1, -1, - -1, -1, 87, -1, -1, -1, -1, -1, -1, 94, + 35, 36, 37, 38, -1, 40, 41, 42, 43, -1, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, + 75, 76, 77, 78, -1, -1, -1, 82, 83, 84, + -1, -1, -1, -1, -1, 90, -1, -1, -1, -1, + -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, + -1, 71, -1, -1, -1, -1, -1, -1, 453, 79, + 80, 81, -1, 118, 119, -1, 121, -1, 123, 124, + -1, -1, 92, -1, -1, -1, 131, -1, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, -1, -1, + -1, -1, 122, -1, -1, 125, 126, 127, 128, 129, + 1, -1, -1, -1, -1, -1, 511, 512, -1, 10, + 11, 12, 13, -1, -1, 16, -1, -1, 19, 20, + 21, 22, -1, 24, 25, 26, 27, 28, 29, 30, + 31, 32, -1, -1, 35, 36, 37, 38, 543, 40, + 41, 42, 43, -1, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + -1, 62, 63, 64, 65, 66, 67, 68, 69, 70, + -1, 72, 73, 74, 75, 76, 77, 78, -1, -1, + -1, 82, 83, 84, -1, -1, -1, -1, -1, 90, + -1, -1, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, - 115, 116, -1, 118, -1, 120, 121, -1, 10, 11, - 12, 13, -1, 128, 16, -1, -1, 19, 20, 21, - 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, - 32, -1, -1, 35, 36, 37, 38, -1, 40, -1, - -1, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, - 62, 63, 64, 65, 66, 67, -1, 69, 70, 71, - 72, 73, 74, 75, -1, -1, -1, 79, 80, 81, - -1, -1, -1, -1, -1, 87, -1, -1, -1, -1, - -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, 118, 119, -1, + 121, -1, 123, 124, -1, 10, 11, 12, 13, -1, + 131, 16, -1, -1, 19, 20, 21, 22, -1, 24, + 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, + 35, 36, 37, 38, -1, 40, 41, 42, 43, -1, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, + 75, 76, 77, 78, -1, -1, -1, 82, 83, 84, + -1, -1, -1, -1, -1, 90, -1, -1, -1, -1, + -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1, 115, 116, -1, 118, -1, 120, 121, - -1, 10, 11, 12, 13, -1, 128, 16, -1, -1, + -1, -1, 1, 118, 119, -1, 121, -1, 123, 124, + -1, 10, 11, 12, 13, -1, 131, 16, -1, -1, 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, 36, 37, 38, - -1, 40, -1, -1, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, 65, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, -1, -1, -1, - 79, 80, 81, -1, -1, -1, -1, -1, 87, -1, - -1, -1, -1, -1, -1, 94, -1, -1, -1, -1, + -1, 40, 41, 42, 43, -1, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, -1, 62, 63, 64, 65, 66, 67, 68, + 69, 70, -1, 72, 73, 74, 75, 76, 77, 78, + -1, -1, -1, 82, 83, 84, -1, -1, -1, -1, + -1, 90, -1, -1, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 1, 115, 116, -1, 118, - -1, 120, 121, -1, 10, 11, 12, 13, -1, 128, - 16, -1, -1, 19, 20, 21, 22, -1, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, - 36, 37, 38, -1, 40, -1, -1, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, 61, 62, 63, 64, 65, - 66, 67, -1, 69, 70, 71, 72, 73, 74, 75, - -1, -1, -1, 79, 80, 81, -1, -1, -1, -1, - -1, 87, -1, -1, -1, -1, -1, -1, 94, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 1, 115, - 116, -1, 118, -1, 120, 121, -1, 10, 11, 12, - 13, -1, 128, 16, -1, -1, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, -1, 1, 118, + 119, -1, 121, -1, 123, 124, -1, 10, 11, 12, + 13, -1, 131, 16, -1, -1, 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, - -1, -1, 35, 36, 37, 38, -1, 40, -1, -1, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, 61, 62, - 63, 64, 65, 66, 67, -1, 69, 70, 71, 72, - 73, 74, 75, -1, -1, -1, 79, 80, 81, -1, - -1, -1, -1, -1, 87, -1, -1, -1, -1, -1, - -1, 94, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1, 115, 116, -1, 118, -1, 120, 121, -1, - 10, 11, 12, 13, -1, 128, 16, -1, -1, 19, - 20, 21, 22, -1, 24, 25, 26, 27, 28, 29, - 30, 31, 32, -1, -1, 35, 36, 37, 38, -1, - 40, -1, -1, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, 61, 62, 63, 64, 65, 66, 67, -1, 69, - 70, 71, 72, 73, 74, 75, -1, -1, -1, 79, - 80, 81, -1, -1, -1, -1, -1, 87, -1, -1, - -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, + -1, -1, 35, 36, 37, 38, -1, 40, 41, 42, + 43, -1, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, -1, 62, + 63, 64, 65, 66, 67, 68, 69, 70, -1, 72, + 73, 74, 75, 76, 77, 78, -1, -1, -1, 82, + 83, 84, -1, -1, -1, -1, -1, 90, -1, -1, + -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1, 115, 116, -1, 118, -1, - 120, 121, -1, 10, 11, -1, 13, -1, 128, 16, + -1, -1, -1, -1, 1, 118, 119, -1, 121, -1, + 123, 124, -1, 10, 11, 12, 13, -1, 131, 16, -1, -1, 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, 36, - 37, 38, -1, 40, -1, -1, 43, 44, 45, 46, + 37, 38, -1, 40, 41, 42, 43, -1, -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, - 67, -1, 69, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, 84, -1, -1, - 87, -1, -1, -1, -1, -1, -1, 94, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1, 115, 116, - -1, 118, -1, 120, 121, -1, 10, 11, -1, 13, - -1, 128, 16, -1, -1, 19, 20, 21, 22, -1, - 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, - -1, 35, 36, 37, 38, -1, 40, -1, -1, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 60, 61, 62, 63, - 64, 65, 66, 67, -1, 69, 70, 71, 72, 73, - 74, 75, -1, -1, -1, 79, 80, 81, -1, -1, - -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, - 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 57, 58, 59, 60, -1, 62, 63, 64, 65, 66, + 67, 68, 69, 70, -1, 72, 73, 74, 75, 76, + 77, 78, -1, -1, -1, 82, 83, 84, -1, -1, + -1, -1, -1, 90, -1, -1, -1, -1, -1, -1, + 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1, 115, 116, -1, 118, -1, 120, 121, -1, 10, - 11, -1, 13, -1, 128, 16, -1, -1, 19, 20, + 1, 118, 119, -1, 121, -1, 123, 124, -1, 10, + 11, -1, 13, -1, 131, 16, -1, -1, 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, 36, 37, 38, -1, 40, - -1, -1, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 60, - 61, 62, 63, 64, 65, -1, 67, -1, 69, 70, - 71, 72, 73, 74, 75, -1, -1, -1, 79, 80, - 81, -1, 1, -1, -1, -1, 87, -1, -1, -1, - -1, 10, -1, 94, 13, -1, -1, 16, -1, -1, - 19, 20, 21, 22, -1, 24, 25, -1, -1, -1, - 29, 30, -1, -1, 115, 116, -1, 118, -1, 120, - 121, -1, -1, -1, -1, 44, 45, 128, -1, -1, - 49, 50, -1, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 61, 62, 63, 64, -1, -1, 67, -1, - -1, 70, 71, 72, 73, 74, 75, -1, -1, -1, - 79, 80, 81, -1, 1, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, 94, 13, -1, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, 115, 116, -1, 118, - -1, 120, 121, -1, -1, -1, -1, 44, 45, 128, - -1, -1, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, 11, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, 11, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - -1, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - -1, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, 11, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - -1, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - 127, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - -1, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, 10, -1, -1, 13, 94, -1, 16, - -1, -1, 19, 20, 21, -1, -1, 24, 25, -1, - -1, -1, 29, 30, -1, -1, -1, -1, 115, 116, - -1, 118, -1, 120, 121, -1, -1, 44, 45, -1, - -1, 128, 49, 50, -1, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 61, 62, 63, 64, -1, -1, - 67, -1, -1, 70, 71, 72, 73, 74, 75, -1, - -1, -1, 79, 80, 81, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, - -1, 68, -1, -1, -1, -1, -1, -1, -1, 76, - 77, 78, -1, -1, -1, -1, -1, -1, 115, 116, - -1, 118, 89, 120, 121, -1, -1, -1, 95, 96, - 97, 128, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, -1, -1, - -1, -1, 119, 68, -1, 122, 123, 124, 125, 126, - -1, 76, 77, 78, -1, -1, -1, -1, -1, -1, + 41, 42, 43, -1, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + -1, 62, 63, 64, 65, 66, 67, 68, 69, 70, + -1, 72, 73, 74, 75, 76, 77, 78, -1, -1, + -1, 82, 83, 84, -1, -1, 87, -1, -1, 90, + -1, -1, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 95, 96, 97, -1, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - -1, -1, -1, -1, 119, 68, -1, 122, 123, 124, - 125, 126, -1, 76, 77, 78, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, 118, 119, -1, + 121, -1, 123, 124, -1, 10, 11, -1, 13, -1, + 131, 16, -1, -1, 19, 20, 21, 22, -1, 24, + 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, + 35, 36, 37, 38, -1, 40, 41, 42, 43, -1, + -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, + 75, 76, 77, 78, -1, -1, -1, 82, 83, 84, + -1, -1, -1, -1, -1, 90, -1, -1, -1, -1, + -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 97, -1, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, -1, -1, -1, -1, 119, 68, -1, 122, - 123, 124, 125, 126, -1, 76, 77, 78, -1, -1, + -1, -1, 1, 118, 119, -1, 121, -1, 123, 124, + -1, 10, 11, -1, 13, -1, 131, 16, -1, -1, + 19, 20, 21, 22, -1, 24, 25, 26, 27, 28, + 29, 30, 31, 32, -1, -1, 35, 36, 37, 38, + -1, 40, 41, 42, 43, -1, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, -1, 62, 63, 64, 65, 66, 67, 68, + -1, 70, -1, 72, 73, 74, 75, 76, 77, 78, + -1, -1, -1, 82, 83, 84, -1, 1, -1, -1, + -1, 90, -1, -1, -1, -1, 10, -1, 97, 13, + -1, -1, 16, -1, -1, 19, 20, 21, 22, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, 118, + 119, -1, 121, -1, 123, 124, -1, -1, -1, -1, + -1, -1, 131, 47, 48, -1, -1, -1, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, 1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, -1, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, 11, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, 11, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, -1, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, -1, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, 11, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, -1, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, 130, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, -1, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, 10, -1, -1, 13, + -1, -1, 16, 97, -1, 19, 20, 21, -1, -1, + 24, 25, -1, -1, -1, 29, 30, -1, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, -1, 123, + 124, -1, -1, 47, 48, -1, -1, 131, 52, 53, + -1, 55, 56, 57, 58, 59, 60, -1, 62, 63, + 64, 65, 66, 67, -1, -1, 70, -1, -1, 73, + 74, 75, 76, 77, 78, -1, -1, -1, 82, 83, + 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 97, -1, -1, -1, 71, -1, -1, + -1, -1, -1, -1, -1, 79, 80, 81, -1, -1, + -1, -1, -1, -1, 118, 119, -1, 121, 92, 123, + 124, -1, -1, -1, 98, 99, 100, 131, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, -1, -1, -1, -1, 122, 71, + -1, 125, 126, 127, 128, 129, -1, 79, 80, 81, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 76, 77, 78, -1, 119, -1, - -1, 122, 123, 124, 125, 126, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 76, 77, 78, + 92, -1, -1, -1, -1, -1, 98, 99, 100, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, -1, -1, -1, -1, 119, -1, -1, - 122, 123, 124, 125, 126, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 76, 77, 78, -1, - 119, -1, -1, 122, 123, 124, 125, 126, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 76, 77, 78, - -1, -1, -1, -1, -1, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, -1, 76, 77, 78, 119, - -1, -1, 122, 123, 124, 125, 126, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 76, 77, 78, -1, - 119, -1, -1, 122, 123, 124, 125, 126, 108, 109, - 110, 111, 112, 113, 114, 76, 77, 78, -1, 119, - -1, -1, 122, 123, 124, 125, 126, -1, -1, -1, - 110, 111, 112, 113, 114, 76, 77, 78, -1, 119, - -1, -1, 122, 123, 124, 125, 126, -1, -1, 110, - 111, 112, 113, 114, 76, 77, 78, -1, 119, -1, - -1, 122, 123, 124, 125, 126, -1, -1, -1, -1, - 111, 112, 113, 114, -1, -1, -1, -1, 119, -1, - -1, 122, 123, 124, 125, 126, -1, -1, -1, -1, - 112, 113, 114, -1, -1, -1, -1, 119, -1, -1, - 122, 123, 124, 125, 126 + 112, 113, 114, 115, 116, 117, -1, -1, -1, -1, + 122, 71, -1, 125, 126, 127, 128, 129, -1, 79, + 80, 81, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, + 100, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, -1, -1, + -1, -1, 122, 71, -1, 125, 126, 127, 128, 129, + -1, 79, 80, 81, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 100, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + -1, -1, -1, -1, 122, 71, -1, 125, 126, 127, + 128, 129, -1, 79, 80, 81, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 79, 80, 81, -1, 122, -1, -1, 125, + 126, 127, 128, 129, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, 80, 81, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, -1, -1, -1, -1, 122, -1, -1, 125, 126, + 127, 128, 129, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 79, 80, 81, -1, 122, -1, + -1, 125, 126, 127, 128, 129, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, 80, 81, -1, -1, + -1, -1, -1, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, -1, 79, 80, 81, 122, -1, -1, + 125, 126, 127, 128, 129, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 79, 80, 81, -1, 122, -1, + -1, 125, 126, 127, 128, 129, 111, 112, 113, 114, + 115, 116, 117, 79, 80, 81, -1, 122, -1, -1, + 125, 126, 127, 128, 129, -1, -1, -1, 113, 114, + 115, 116, 117, 79, 80, 81, -1, 122, -1, -1, + 125, 126, 127, 128, 129, -1, -1, 113, 114, 115, + 116, 117, 79, 80, 81, -1, 122, -1, -1, 125, + 126, 127, 128, 129, -1, -1, -1, -1, 114, 115, + 116, 117, -1, -1, -1, -1, 122, -1, -1, 125, + 126, 127, 128, 129, -1, -1, -1, -1, 115, 116, + 117, -1, -1, -1, -1, 122, -1, -1, 125, 126, + 127, 128, 129 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 5, 6, 7, 8, 9, 130, 131, - 132, 133, 134, 135, 136, 137, 0, 142, 10, 13, - 16, 19, 20, 21, 24, 25, 29, 30, 44, 45, - 49, 50, 52, 53, 54, 55, 56, 57, 59, 60, - 61, 62, 63, 64, 67, 70, 71, 72, 73, 74, - 75, 79, 80, 81, 94, 115, 116, 118, 120, 121, - 128, 140, 201, 202, 203, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 217, 224, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 11, 139, 1, 22, + 0, 3, 4, 5, 6, 7, 8, 9, 133, 134, + 135, 136, 137, 138, 139, 140, 0, 145, 10, 13, + 16, 19, 20, 21, 24, 25, 29, 30, 47, 48, + 52, 53, 55, 56, 57, 58, 59, 60, 62, 63, + 64, 65, 66, 67, 70, 73, 74, 75, 76, 77, + 78, 82, 83, 84, 97, 118, 119, 121, 123, 124, + 131, 143, 204, 205, 206, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 220, 227, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 11, 142, 1, 22, 26, 27, 28, 31, 32, 35, 36, 37, 38, 40, - 43, 46, 47, 48, 51, 65, 69, 87, 138, 139, - 152, 166, 201, 221, 66, 150, 151, 152, 140, 148, - 194, 195, 148, 53, 58, 139, 233, 241, 224, 241, - 215, 241, 215, 241, 241, 215, 118, 128, 218, 233, - 234, 235, 215, 139, 215, 178, 178, 179, 241, 241, - 216, 13, 128, 215, 178, 215, 128, 128, 85, 128, - 139, 215, 53, 140, 202, 223, 233, 241, 139, 241, - 224, 53, 58, 181, 202, 215, 215, 215, 215, 215, - 127, 201, 90, 91, 92, 93, 15, 11, 13, 128, - 108, 109, 108, 106, 107, 106, 68, 76, 77, 78, - 89, 95, 96, 97, 99, 100, 101, 102, 103, 104, + 41, 42, 43, 46, 49, 50, 51, 54, 68, 72, + 90, 141, 142, 155, 169, 204, 224, 69, 153, 154, + 155, 143, 151, 197, 198, 151, 56, 61, 142, 236, + 244, 227, 244, 218, 244, 218, 244, 244, 218, 121, + 131, 221, 236, 237, 238, 218, 142, 218, 181, 181, + 182, 244, 244, 219, 13, 131, 218, 181, 218, 131, + 131, 88, 131, 142, 218, 56, 143, 205, 226, 236, + 244, 142, 244, 227, 56, 61, 184, 205, 218, 218, + 218, 218, 218, 130, 204, 93, 94, 95, 96, 15, + 11, 13, 131, 111, 112, 111, 109, 110, 109, 71, + 79, 80, 81, 92, 98, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 119, 122, 123, 124, 125, 126, 128, 11, 13, 11, - 13, 11, 13, 11, 142, 180, 53, 53, 219, 233, - 234, 235, 128, 128, 30, 118, 128, 231, 233, 128, - 128, 11, 143, 143, 177, 181, 22, 177, 181, 39, - 140, 168, 22, 32, 35, 36, 37, 38, 22, 151, - 152, 150, 16, 20, 24, 140, 186, 187, 188, 189, - 190, 191, 14, 128, 215, 218, 233, 234, 235, 127, - 201, 82, 184, 56, 140, 182, 82, 140, 183, 183, - 223, 128, 85, 201, 127, 139, 127, 127, 201, 224, - 224, 241, 202, 202, 22, 223, 13, 127, 201, 201, - 201, 201, 215, 201, 201, 127, 201, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 10, 11, 13, 16, 20, - 24, 25, 54, 79, 128, 205, 233, 127, 201, 201, - 201, 201, 201, 201, 201, 201, 148, 53, 140, 176, - 53, 53, 82, 140, 220, 142, 142, 118, 142, 30, - 229, 230, 232, 233, 234, 235, 142, 142, 128, 142, - 142, 144, 41, 156, 177, 155, 177, 139, 165, 201, - 165, 165, 173, 201, 165, 58, 185, 185, 15, 127, - 201, 184, 127, 56, 183, 56, 142, 199, 199, 224, - 202, 14, 204, 127, 86, 127, 201, 12, 201, 13, - 22, 14, 127, 98, 25, 181, 201, 201, 25, 25, - 25, 25, 25, 127, 201, 128, 127, 22, 14, 22, - 14, 22, 14, 22, 12, 18, 141, 11, 22, 183, - 56, 95, 174, 201, 174, 128, 226, 233, 128, 140, - 166, 171, 174, 175, 201, 229, 142, 173, 172, 201, - 148, 142, 53, 153, 22, 142, 196, 197, 154, 95, - 95, 189, 127, 197, 128, 140, 192, 193, 127, 23, - 140, 225, 223, 127, 14, 201, 12, 215, 128, 22, - 14, 127, 224, 12, 12, 12, 12, 142, 142, 11, - 22, 222, 127, 127, 227, 228, 233, 128, 142, 127, - 22, 159, 174, 127, 127, 12, 128, 140, 145, 53, - 182, 11, 183, 215, 215, 194, 11, 201, 86, 14, - 224, 12, 127, 22, 161, 142, 215, 143, 143, 15, - 127, 174, 174, 143, 157, 128, 127, 170, 170, 146, - 160, 223, 183, 148, 22, 198, 199, 127, 200, 127, - 84, 148, 162, 33, 34, 140, 167, 167, 233, 128, - 127, 127, 168, 172, 174, 143, 143, 143, 233, 143, - 22, 196, 12, 148, 140, 149, 12, 148, 143, 128, - 174, 143, 143, 22, 127, 168, 168, 168, 147, 42, - 169, 12, 22, 56, 163, 12, 174, 127, 168, 168, - 158, 143, 127, 139, 17, 83, 140, 164, 127, 143, - 170, 168, 148, 143, 168, 175, 84, 167, 127, 143 + 115, 116, 117, 122, 125, 126, 127, 128, 129, 131, + 11, 13, 11, 13, 11, 13, 11, 145, 183, 56, + 56, 222, 236, 237, 238, 131, 131, 30, 121, 131, + 234, 236, 131, 131, 131, 131, 142, 11, 146, 146, + 180, 184, 22, 180, 184, 39, 143, 171, 22, 32, + 35, 36, 37, 38, 41, 22, 154, 155, 153, 16, + 20, 24, 143, 189, 190, 191, 192, 193, 194, 14, + 131, 218, 221, 236, 237, 238, 130, 204, 85, 187, + 59, 143, 185, 85, 143, 186, 186, 226, 131, 88, + 204, 130, 142, 130, 130, 204, 227, 227, 244, 205, + 205, 22, 226, 13, 130, 204, 204, 204, 204, 218, + 204, 204, 130, 204, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 10, 11, 13, 16, 20, 24, 25, 57, + 82, 131, 208, 236, 130, 204, 204, 204, 204, 204, + 204, 204, 204, 151, 56, 143, 179, 56, 56, 85, + 143, 223, 145, 145, 121, 145, 30, 232, 233, 235, + 236, 237, 238, 145, 145, 131, 145, 145, 145, 145, + 147, 44, 159, 180, 158, 180, 142, 168, 204, 168, + 168, 176, 204, 168, 168, 61, 188, 188, 15, 130, + 204, 187, 130, 59, 186, 59, 145, 202, 202, 227, + 205, 14, 207, 130, 89, 130, 204, 12, 204, 13, + 22, 14, 130, 101, 25, 184, 204, 204, 25, 25, + 25, 25, 25, 130, 204, 131, 130, 22, 14, 22, + 14, 22, 14, 22, 12, 18, 144, 11, 22, 186, + 59, 98, 177, 204, 177, 131, 229, 236, 131, 143, + 169, 174, 177, 178, 204, 232, 145, 176, 175, 204, + 177, 177, 151, 145, 56, 156, 22, 145, 199, 200, + 157, 98, 98, 192, 130, 200, 131, 143, 195, 196, + 130, 23, 143, 228, 226, 130, 14, 204, 12, 218, + 131, 22, 14, 130, 227, 12, 12, 12, 12, 145, + 145, 11, 22, 225, 130, 130, 230, 231, 236, 131, + 145, 130, 22, 162, 177, 130, 130, 130, 130, 12, + 131, 143, 148, 56, 185, 11, 186, 218, 218, 197, + 11, 204, 89, 14, 227, 12, 130, 22, 164, 145, + 218, 146, 146, 15, 130, 177, 177, 146, 160, 131, + 130, 173, 173, 146, 146, 149, 163, 226, 186, 151, + 22, 201, 202, 130, 203, 130, 87, 151, 165, 33, + 34, 143, 170, 170, 236, 131, 130, 130, 171, 175, + 177, 146, 146, 146, 236, 146, 22, 199, 12, 151, + 143, 152, 12, 151, 146, 131, 177, 146, 146, 22, + 130, 171, 171, 171, 150, 45, 172, 12, 22, 59, + 166, 12, 177, 130, 171, 171, 161, 146, 130, 142, + 17, 86, 143, 167, 130, 146, 173, 171, 151, 146, + 171, 178, 87, 170, 130, 146 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_uint8 yyr1[] = { - 0, 129, 131, 130, 132, 130, 133, 130, 134, 130, - 135, 130, 136, 130, 137, 130, 138, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 145, 148, 148, - 149, 149, 150, 150, 151, 151, 152, 152, 153, 152, - 154, 152, 155, 152, 152, 152, 156, 152, 152, 152, - 152, 152, 157, 158, 152, 152, 152, 152, 159, 152, - 152, 152, 160, 152, 152, 161, 152, 162, 152, 152, - 152, 152, 152, 152, 163, 164, 164, 165, 166, 166, - 166, 166, 166, 166, 166, 167, 167, 167, 168, 168, - 169, 169, 170, 171, 171, 172, 172, 173, 174, 175, - 176, 176, 177, 178, 179, 180, 181, 181, 182, 182, - 183, 183, 183, 184, 184, 185, 185, 186, 186, 187, - 187, 187, 188, 188, 188, 189, 189, 190, 190, 190, - 191, 191, 192, 192, 193, 195, 194, 196, 196, 197, - 198, 198, 200, 199, 201, 201, 201, 201, 201, 202, - 202, 202, 203, 203, 203, 203, 203, 203, 203, 203, - 203, 203, 203, 203, 204, 203, 205, 205, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 208, 208, 208, 208, 208, 209, - 209, 210, 210, 210, 210, 211, 211, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, - 213, 214, 214, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 216, 215, 215, 215, 215, 217, 217, 217, 217, - 218, 218, 218, 218, 218, 219, 219, 219, 220, 220, - 220, 221, 222, 221, 223, 223, 224, 224, 225, 225, - 226, 227, 227, 227, 228, 229, 229, 229, 230, 230, - 231, 231, 232, 233, 234, 235, 236, 236, 237, 238, - 238, 239, 239, 240, 240, 241, 241, 241, 241 + 0, 132, 134, 133, 135, 133, 136, 133, 137, 133, + 138, 133, 139, 133, 140, 133, 141, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 148, 151, 151, + 152, 152, 153, 153, 154, 154, 155, 155, 156, 155, + 157, 155, 158, 155, 155, 155, 159, 155, 155, 155, + 155, 155, 155, 155, 155, 160, 161, 155, 155, 155, + 155, 162, 155, 155, 155, 163, 155, 155, 164, 155, + 165, 155, 155, 155, 155, 155, 155, 166, 167, 167, + 168, 169, 169, 169, 169, 169, 169, 169, 169, 170, + 170, 170, 171, 171, 172, 172, 173, 174, 174, 175, + 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, + 184, 184, 185, 185, 186, 186, 186, 187, 187, 188, + 188, 189, 189, 190, 190, 190, 191, 191, 191, 192, + 192, 193, 193, 193, 194, 194, 195, 195, 196, 198, + 197, 199, 199, 200, 201, 201, 203, 202, 204, 204, + 204, 204, 204, 205, 205, 205, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 207, 206, + 208, 208, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 210, 210, 210, 210, + 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, + 211, 211, 211, 212, 212, 213, 213, 213, 213, 214, + 214, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 216, 216, 216, 216, 216, 217, 217, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 219, 218, 218, 218, 218, + 220, 220, 220, 220, 221, 221, 221, 221, 221, 222, + 222, 222, 223, 223, 223, 224, 225, 224, 226, 226, + 227, 227, 228, 228, 229, 230, 230, 230, 231, 232, + 232, 232, 233, 233, 234, 234, 235, 236, 237, 238, + 239, 239, 240, 241, 241, 242, 242, 243, 243, 244, + 244, 244, 244 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1485,35 +1511,36 @@ static const yytype_int8 yyr2[] = 7, 0, 4, 0, 1, 0, 0, 5, 1, 2, 1, 2, 1, 1, 2, 2, 1, 4, 0, 7, 0, 6, 0, 4, 4, 5, 0, 7, 7, 7, - 8, 8, 0, 0, 13, 9, 11, 8, 0, 10, - 9, 7, 0, 8, 2, 0, 8, 0, 9, 2, - 2, 2, 2, 1, 2, 1, 3, 1, 1, 1, - 3, 3, 3, 3, 3, 1, 2, 6, 1, 2, - 0, 2, 0, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, - 1, 2, 1, 2, 1, 0, 1, 1, 1, 2, - 3, 4, 2, 3, 4, 1, 1, 2, 3, 1, - 1, 1, 1, 1, 3, 0, 2, 1, 1, 4, - 1, 1, 0, 6, 3, 3, 3, 3, 1, 2, - 3, 1, 3, 3, 5, 6, 3, 7, 4, 3, - 5, 2, 4, 4, 0, 5, 1, 1, 5, 4, - 5, 4, 5, 6, 5, 4, 5, 4, 3, 6, - 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 1, 3, 2, 2, 3, 3, - 3, 1, 3, 2, 2, 3, 3, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 4, 5, 4, - 4, 2, 2, 1, 1, 1, 1, 5, 2, 1, - 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, - 4, 4, 5, 5, 1, 1, 3, 4, 3, 4, - 4, 4, 4, 4, 1, 2, 2, 1, 2, 2, - 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, - 4, 0, 6, 1, 1, 1, 3, 2, 4, 3, - 3, 2, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 3, 0, 6, 1, 1, 1, 1, 1, 2, - 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 4, 2, 1, - 3, 1, 3, 1, 3, 1, 1, 1, 1 + 6, 6, 2, 8, 8, 0, 0, 13, 9, 11, + 8, 0, 10, 9, 7, 0, 8, 2, 0, 8, + 0, 9, 2, 2, 2, 2, 1, 2, 1, 3, + 1, 1, 1, 3, 3, 3, 3, 3, 3, 1, + 2, 6, 1, 2, 0, 2, 0, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 2, 1, 2, 1, 0, + 1, 1, 1, 2, 3, 4, 2, 3, 4, 1, + 1, 2, 3, 1, 1, 1, 1, 1, 3, 0, + 2, 1, 1, 4, 1, 1, 0, 6, 3, 3, + 3, 3, 1, 2, 3, 1, 3, 3, 5, 6, + 3, 7, 4, 3, 5, 2, 4, 4, 0, 5, + 1, 1, 5, 4, 5, 4, 5, 6, 5, 4, + 5, 4, 3, 6, 4, 5, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, + 2, 2, 3, 3, 3, 1, 3, 2, 2, 3, + 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 4, 5, 4, 4, 2, 2, 1, 1, 1, + 1, 5, 2, 1, 2, 3, 1, 2, 1, 1, + 1, 1, 1, 1, 4, 4, 5, 5, 1, 1, + 3, 4, 3, 4, 4, 4, 4, 4, 1, 2, + 2, 1, 2, 2, 1, 2, 1, 2, 1, 3, + 1, 3, 1, 3, 4, 0, 6, 1, 1, 1, + 3, 2, 4, 3, 3, 2, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 3, 0, 6, 1, 1, + 1, 1, 1, 2, 1, 2, 3, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 4, 2, 1, 3, 1, 3, 1, 3, 1, + 1, 1, 1 }; typedef enum { @@ -1533,27 +1560,28 @@ 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_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_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_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_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_opval, - toketype_ival, toketype_opval, toketype_ival, toketype_opval, toketype_ival, 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_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_opval, toketype_ival, + toketype_opval, toketype_ival, toketype_opval, toketype_ival, 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_ival, toketype_ival, 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_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval, @@ -1571,6 +1599,6 @@ static const toketypes yy_type_tab[] = }; /* Generated from: - * 0f40c00aa6e92910072b579304d07e319b034979bfaf4292495c7a23de0bd41a perly.y + * 453a810482a42d27feedcc7688cd6ced725b9dee5ec9d7dea0a8c789a368e038 perly.y * f13e9c08cea6302f0c1d1f467405bd0e0880d0ea92d0669901017a7f7e94ab28 regen_perly.pl * ex: set ro ft=c: */ diff --git a/perly.y b/perly.y index 2cba2c32f5ae..c19e717c966f 100644 --- a/perly.y +++ b/perly.y @@ -68,6 +68,7 @@ %token KW_LOCAL KW_MY KW_FIELD %token KW_IF KW_ELSE KW_ELSIF KW_UNLESS %token KW_FOR KW_UNTIL KW_WHILE KW_CONTINUE +%token KW_GIVEN KW_WHEN KW_DEFAULT %token KW_TRY KW_CATCH KW_FINALLY KW_DEFER %token KW_REQUIRE KW_DO @@ -472,6 +473,15 @@ barestmt: PLUGSTMT newCONDOP(0, $mexpr, $else, op_scope($mblock))); parser->copline = (line_t)$KW_UNLESS; } + | KW_GIVEN PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock + { + $$ = block_end($remember, newGIVENOP($mexpr, op_scope($mblock), 0)); + parser->copline = (line_t)$KW_GIVEN; + } + | KW_WHEN PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock + { $$ = block_end($remember, newWHENOP($mexpr, op_scope($mblock))); } + | KW_DEFAULT block + { $$ = newWHENOP(0, op_scope($block)); } | KW_WHILE PERLY_PAREN_OPEN remember texpr PERLY_PAREN_CLOSE mintro mblock cont { $$ = block_end($remember, @@ -679,6 +689,8 @@ sideff : error | expr[body] KW_FOR condition { $$ = newFOROP(0, NULL, $condition, $body, NULL); parser->copline = (line_t)$KW_FOR; } + | expr[body] KW_WHEN condition + { $$ = newWHENOP($condition, op_scope($body)); } ; /* else and elsif blocks */ diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 3d4162f6379c..890e71ca879d 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -887,6 +887,15 @@ object instance. (F) Only hard references may be blessed. This is how Perl "enforces" encapsulation of objects. See L. +=item Can't "break" in a loop topicalizer + +(F) You called C, but you're in a C block rather than +a C block. You probably meant to use C or C. + +=item Can't "break" outside a given block + +(F) You called C, but you're not inside a C block. + =item Can't call destructor for 0x%p in global destruction (S) This should not happen. Internals code has set up a destructor @@ -953,6 +962,11 @@ You CAN say but then $foo no longer contains a glob. +=item Can't "continue" outside a when block + +(F) You called C, but you're not inside a C +or C block. + =item can't convert empty path (F) On Cygwin, you called a path conversion function with an empty path. @@ -968,6 +982,13 @@ quotas or other plumbing problems. (F) Only scalar, array, and hash variables may be declared as "my", "our" or "state" variables. They must have ordinary identifiers as names. +=item Can't "default" outside a topicalizer + +(F) You have used a C block that is neither inside a +C loop nor a C block. (Note that this error is +issued on exit from the C block, so you won't get the +error if you use an explicit C.) + =item Can't determine class of operator %s, assuming BASEOP (S) This warning indicates something wrong in the internals of perl. @@ -1166,6 +1187,11 @@ error occurs in cases such as these: (F) A C statement was executed to jump into the scope of a C block. This is not permitted. +=item Can't "goto" into a "given" block + +(F) A "goto" statement was executed to jump into the middle of a C +block. You can't get there from here. See L. + =item Can't "goto" into the middle of a foreach loop (F) A "goto" statement was executed to jump into the middle of a foreach @@ -1694,6 +1720,13 @@ instead. (F) You attempted to weaken something that was not a reference. Only references can be weakened. +=item Can't "when" outside a topicalizer + +(F) You have used a when() block that is neither inside a C +loop nor a C block. (Note that this error is issued on exit +from the C block, so you won't get the error if the match fails, +or if you use an explicit C.) + =item Can't x= to read-only value (F) You tried to repeat a constant value (often the undefined value) @@ -2742,6 +2775,12 @@ L. arguments are provided in key/value pairs, with the keys being one of C, C or C, followed by a boolean. +=item given is deprecated + +(D deprecated::smartmatch) C depends on smartmatch, which is +deprecated. It will be removed in Perl 5.42. See the explanation under +L. + =item Global symbol "%s" requires explicit package name (did you forget to declare "my %s"?) @@ -8198,6 +8237,14 @@ but in actual fact, you got So put in parentheses to say what you really mean. +=item when is deprecated + +(D deprecated::smartmatch) C depends on smartmatch, which is +deprecated. Additionally, it has several special cases that may +not be immediately obvious, and it will be removed in Perl 5.42. +See the explanation +under L. + =item Wide character in %s (S utf8) Perl met a wide character (ordinal >255) when it wasn't diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 972e25233383..57fb3285403d 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -4240,6 +4240,7 @@ valid. =for apidoc Cmnh||CXt_BLOCK =for apidoc_item ||CXt_EVAL =for apidoc_item ||CXt_FORMAT +=for apidoc_item ||CXt_GIVEN =for apidoc_item ||CXt_LOOP_ARY =for apidoc_item ||CXt_LOOP_LAZYIV =for apidoc_item ||CXt_LOOP_LAZYSV @@ -4248,6 +4249,7 @@ valid. =for apidoc_item ||CXt_NULL =for apidoc_item ||CXt_SUB =for apidoc_item ||CXt_SUBST +=for apidoc_item ||CXt_WHEN The main division in the context struct is between a substitution scope (C) and block scopes, which are everything else. The former is diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index b5ad0cda01f6..323a70b4b78e 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -216,9 +216,22 @@ it. Future versions of perl might do something different from the version of perl you try it out on. Here be dragons. X +The C modifier is an experimental feature that first appeared in Perl +5.14. To use it, you should include a C declaration. +(Technically, it requires only the C feature, but that aspect of it +was not available before 5.14.) Operative only from within a C +loop or a C block, it executes the statement only if the smartmatch +C<< $_ ~~ I >> is true. If the statement executes, it is followed by +a C from inside a C and C from inside a C. + +Under the current implementation, the C loop can be +anywhere within the C modifier's dynamic scope, but must be +within the C block's lexical scope. This restriction may +be relaxed in a future release. See L below. + =head2 Compound Statements X X X X X -X<{> X<}> X X X X X X X +X<{> X<}> X X X X X X X X In Perl, a sequence of statements that defines a scope is called a block. Sometimes a block is delimited by the file containing it (in the case @@ -248,6 +261,8 @@ The following compound statements may be used to control flow: unless (EXPR) BLOCK elsif (EXPR) BLOCK ... unless (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK + given (EXPR) BLOCK + LABEL while (EXPR) BLOCK LABEL while (EXPR) BLOCK continue BLOCK @@ -280,6 +295,9 @@ If enabled by the C feature, the following may also be used try BLOCK catch (VAR) BLOCK try BLOCK catch (VAR) BLOCK finally BLOCK +The experimental C statement is I; see +L below for how to do so, and the attendant caveats. + Unlike in C and Pascal, in Perl these are all defined in terms of BLOCKs, not statements. This means that the curly brackets are I--no dangling statements allowed. If you want to write conditionals without @@ -754,8 +772,9 @@ and a switch: $nothing = 1; } -Such constructs are quite frequently used, both because -Perl has no official C statement. +Such constructs are quite frequently used, both because older versions of +Perl had no official C statement, and also because the new version +described immediately below remains experimental and can sometimes be confusing. =head2 defer blocks X @@ -840,10 +859,93 @@ C. =head2 Switch Statements -Switch statements were removed in Perl 5.42. - X X X X X +Starting from Perl 5.10.1 (well, 5.10.0, but it didn't work +right), you can say + + use feature "switch"; + +to enable an experimental switch feature. This is loosely based on an +old version of a Raku proposal, but it no longer resembles the Raku +construct. You also get the switch feature whenever you declare that your +code prefers to run under a version of Perl between 5.10 and 5.34. For +example: + + use v5.14; + +Under the "switch" feature, Perl gains the experimental keywords +C, C, C, C, and C. +Starting from Perl 5.16, one can prefix the switch +keywords with C to access the feature without a C +statement. The keywords C and +C are analogous to C and +C in other languages -- though C is not -- so the code +in the previous section could be rewritten as + + use v5.10.1; + for ($var) { + when (/^abc/) { $abc = 1 } + when (/^def/) { $def = 1 } + when (/^xyz/) { $xyz = 1 } + default { $nothing = 1 } + } + +The C is the non-experimental way to set a topicalizer. +If you wish to use the highly experimental C, that could be +written like this: + + use v5.10.1; + given ($var) { + when (/^abc/) { $abc = 1 } + when (/^def/) { $def = 1 } + when (/^xyz/) { $xyz = 1 } + default { $nothing = 1 } + } + +As of 5.14, that can also be written this way: + + use v5.14; + for ($var) { + $abc = 1 when /^abc/; + $def = 1 when /^def/; + $xyz = 1 when /^xyz/; + default { $nothing = 1 } + } + +Or if you don't care to play it safe, like this: + + use v5.14; + given ($var) { + $abc = 1 when /^abc/; + $def = 1 when /^def/; + $xyz = 1 when /^xyz/; + default { $nothing = 1 } + } + +The arguments to C and C are in scalar context, +and C assigns the C<$_> variable its topic value. + +Exactly what the I argument to C does is hard to describe +precisely, but in general, it tries to guess what you want done. Sometimes +it is interpreted as C<< $_ ~~ I >>, and sometimes it is not. It +also behaves differently when lexically enclosed by a C block than +it does when dynamically enclosed by a C loop. The rules are far +too difficult to understand to be described here. See L later on. + +Due to an unfortunate bug in how C was implemented between Perl 5.10 +and 5.16, under those implementations the version of C<$_> governed by +C is merely a lexically scoped copy of the original, not a +dynamically scoped alias to the original, as it would be if it were a +C or under both the original and the current Raku language +specification. This bug was fixed in Perl 5.18 (and lexicalized C<$_> itself +was removed in Perl 5.24). + +If your code still needs to run on older versions, +stick to C for your topicalizer and +you will be less unhappy. + =head2 Goto X @@ -1053,4 +1155,336 @@ shell: __END__ foo at goop line 345. +=head2 Experimental Details on given and when + +As previously mentioned, the "switch" feature is considered highly +experimental (it is also scheduled to be removed in perl 5.42.0); +it is subject to change with little notice. In particular, +C has tricky behaviours that are expected to change to become less +tricky in the future. Do not rely upon its current (mis)implementation. +Before Perl 5.18, C also had tricky behaviours that you should still +beware of if your code must run on older versions of Perl. + +Here is a longer example of C: + + use feature ":5.10"; + given ($foo) { + when (undef) { + say '$foo is undefined'; + } + when ("foo") { + say '$foo is the string "foo"'; + } + when ([1,3,5,7,9]) { + say '$foo is an odd digit'; + continue; # Fall through + } + when ($_ < 100) { + say '$foo is numerically less than 100'; + } + when (\&complicated_check) { + say 'a complicated check for $foo is true'; + } + default { + die q(I don't know what to do with $foo); + } + } + +Before Perl 5.18, C assigned the value of I to +merely a lexically scoped I> (!) of C<$_>, not a dynamically +scoped alias the way C does. That made it similar to + + do { my $_ = EXPR; ... } + +except that the block was automatically broken out of by a successful +C or an explicit C. Because it was only a copy, and because +it was only lexically scoped, not dynamically scoped, you could not do the +things with it that you are used to in a C loop. In particular, +it did not work for arbitrary function calls if those functions might try +to access $_. Best stick to C for that. + +Most of the power comes from the implicit smartmatching that can +sometimes apply. Most of the time, C is treated as an +implicit smartmatch of C<$_>, that is, C<$_ ~~ EXPR>. (See +L for more information on smartmatching.) +But when I is one of the 10 exceptional cases (or things like them) +listed below, it is used directly as a boolean. + +=over 4 + +=item Z<>1. + +A user-defined subroutine call or a method invocation. + +=item Z<>2. + +A regular expression match in the form of C, C<$foo =~ /REGEX/>, +or C<$foo =~ EXPR>. Also, a negated regular expression match in +the form C, C<$foo !~ /REGEX/>, or C<$foo !~ EXPR>. + +=item Z<>3. + +A smart match that uses an explicit C<~~> operator, such as C. + +B You will often have to use C<$c ~~ $_> because the default case +uses C<$_ ~~ $c> , which is frequently the opposite of what you want. + +=item Z<>4. + +A boolean comparison operator such as C<$_ E 10> or C<$x eq "abc">. The +relational operators that this applies to are the six numeric comparisons +(C<< < >>, C<< > >>, C<< <= >>, C<< >= >>, C<< == >>, and C<< != >>), and +the six string comparisons (C, C, C, C, C, and C). + +=item Z<>5. + +At least the three builtin functions C, C, and +C. We might someday add more of these later if we think of them. + +=item Z<>6. + +A negated expression, whether C or C, or a logical +exclusive-or, C<(EXPR1) xor (EXPR2)>. The bitwise versions (C<~> and C<^>) +are not included. + +=item Z<>7. + +A filetest operator, with exactly 4 exceptions: C<-s>, C<-M>, C<-A>, and +C<-C>, as these return numerical values, not boolean ones. The C<-z> +filetest operator is not included in the exception list. + +=item Z<>8. + +The C<..> and C<...> flip-flop operators. Note that the C<...> flip-flop +operator is completely different from the C<...> elliptical statement +just described. + +=back + +In those 8 cases above, the value of EXPR is used directly as a boolean, so +no smartmatching is done. You may think of C as a smartsmartmatch. + +Furthermore, Perl inspects the operands of logical operators to +decide whether to use smartmatching for each one by applying the +above test to the operands: + +=over 4 + +=item Z<>9. + +If EXPR is C or C, the test is applied +I to both EXPR1 and EXPR2. +Only if I operands also pass the +test, I, will the expression be treated as boolean. Otherwise, +smartmatching is used. + +=item Z<>10. + +If EXPR is C, C, or C, the +test is applied I to EXPR1 only (which might itself be a +higher-precedence AND operator, for example, and thus subject to the +previous rule), not to EXPR2. If EXPR1 is to use smartmatching, then EXPR2 +also does so, no matter what EXPR2 contains. But if EXPR2 does not get to +use smartmatching, then the second argument will not be either. This is +quite different from the C<&&> case just described, so be careful. + +=back + +These rules are complicated, but the goal is for them to do what you want +(even if you don't quite understand why they are doing it). For example: + + when (/^\d+$/ && $_ < 75) { ... } + +will be treated as a boolean match because the rules say both +a regex match and an explicit test on C<$_> will be treated +as boolean. + +Also: + + when ([qw(foo bar)] && /baz/) { ... } + +will use smartmatching because only I of the operands is a boolean: +the other uses smartmatching, and that wins. + +Further: + + when ([qw(foo bar)] || /^baz/) { ... } + +will use smart matching (only the first operand is considered), whereas + + when (/^baz/ || [qw(foo bar)]) { ... } + +will test only the regex, which causes both operands to be +treated as boolean. Watch out for this one, then, because an +arrayref is always a true value, which makes it effectively +redundant. Not a good idea. + +Tautologous boolean operators are still going to be optimized +away. Don't be tempted to write + + when ("foo" or "bar") { ... } + +This will optimize down to C<"foo">, so C<"bar"> will never be considered (even +though the rules say to use a smartmatch +on C<"foo">). For an alternation like +this, an array ref will work, because this will instigate smartmatching: + + when ([qw(foo bar)] { ... } + +This is somewhat equivalent to the C-style switch statement's fallthrough +functionality (not to be confused with I fallthrough +functionality--see below), wherein the same block is used for several +C statements. + +Another useful shortcut is that, if you use a literal array or hash as the +argument to C, it is turned into a reference. So C is +the same as C, for example. + +C behaves exactly like C, which is +to say that it always matches. + +=head3 Breaking out + +You can use the C keyword to break out of the enclosing +C block. Every C block is implicitly ended with +a C. + +=head3 Fall-through + +You can use the C keyword to fall through from one +case to the next immediate C or C: + + given($foo) { + when (/x/) { say '$foo contains an x'; continue } + when (/y/) { say '$foo contains a y' } + default { say '$foo does not contain a y' } + } + +=head3 Return value + +When a C statement is also a valid expression (for example, +when it's the last statement of a block), it evaluates to: + +=over 4 + +=item * + +An empty list as soon as an explicit C is encountered. + +=item * + +The value of the last evaluated expression of the successful +C/C clause, if there happens to be one. + +=item * + +The value of the last evaluated expression of the C block if no +condition is true. + +=back + +In both last cases, the last expression is evaluated in the context that +was applied to the C block. + +Note that, unlike C and C, failed C statements always +evaluate to an empty list. + + my $price = do { + given ($item) { + when (["pear", "apple"]) { 1 } + break when "vote"; # My vote cannot be bought + 1e10 when /Mona Lisa/; + "unknown"; + } + }; + +Currently, C blocks can't always +be used as proper expressions. This +may be addressed in a future version of Perl. + +=head3 Switching in a loop + +Instead of using C, you can use a C loop. +For example, here's one way to count how many times a particular +string occurs in an array: + + use v5.10.1; + my $count = 0; + for (@array) { + when ("foo") { ++$count } + } + print "\@array contains $count copies of 'foo'\n"; + +Or in a more recent version: + + use v5.14; + my $count = 0; + for (@array) { + ++$count when "foo"; + } + print "\@array contains $count copies of 'foo'\n"; + +At the end of all C blocks, there is an implicit C. +You can override that with an explicit C if you're +interested in only the first match alone. + +This doesn't work if you explicitly specify a loop variable, as +in C. You have to use the default variable C<$_>. + +=head3 Differences from Raku + +The Perl 5 smartmatch and C/C constructs are not compatible +with their Raku analogues. The most visible difference and least +important difference is that, in Perl 5, parentheses are required around +the argument to C and C (except when this last one is used +as a statement modifier). Parentheses in Raku are always optional in a +control construct such as C, C, or C; they can't be +made optional in Perl 5 without a great deal of potential confusion, +because Perl 5 would parse the expression + + given $foo { + ... + } + +as though the argument to C were an element of the hash +C<%foo>, interpreting the braces as hash-element syntax. + +However, there are many, many other differences. For example, +this works in Perl 5: + + use v5.12; + my @primary = ("red", "blue", "green"); + + if (@primary ~~ "red") { + say "primary smartmatches red"; + } + + if ("red" ~~ @primary) { + say "red smartmatches primary"; + } + + say "that's all, folks!"; + +But it doesn't work at all in Raku. Instead, you should +use the (parallelizable) C operator: + + if any(@primary) eq "red" { + say "primary smartmatches red"; + } + + if "red" eq any(@primary) { + say "red smartmatches primary"; + } + +The table of smartmatches in L is not +identical to that proposed by the Raku specification, mainly due to +differences between Raku's and Perl 5's data models, but also because +the Raku spec has changed since Perl 5 rushed into early adoption. + +In Raku, C will always do an implicit smartmatch with its +argument, while in Perl 5 it is convenient (albeit potentially confusing) to +suppress this implicit smartmatch in various rather loosely-defined +situations, as roughly outlined above. (The difference is largely because +Perl 5 does not have, even internally, a boolean type.) + =cut diff --git a/pp_ctl.c b/pp_ctl.c index c949a52962db..e1cef3f5e63a 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1556,12 +1556,14 @@ PP_wrapped(pp_flop, (GIMME_V == G_LIST) ? 2 : 1, 0) static const char * const context_name[] = { "pseudo-block", + NULL, /* CXt_WHEN never actually needs "block" */ NULL, /* CXt_BLOCK never actually needs "block" */ - NULL, /* CXt_LOOP_ARY never actually needs "loop" */ - NULL, /* CXt_LOOP_LAZYSV never actually needs "loop" */ + NULL, /* CXt_GIVEN never actually needs "block" */ + NULL, /* CXt_LOOP_PLAIN never actually needs "loop" */ NULL, /* CXt_LOOP_LAZYIV never actually needs "loop" */ + NULL, /* CXt_LOOP_LAZYSV never actually needs "loop" */ NULL, /* CXt_LOOP_LIST never actually needs "loop" */ - NULL, /* CXt_LOOP_PLAIN never actually needs "loop" */ + NULL, /* CXt_LOOP_ARY never actually needs "loop" */ "subroutine", "format", "eval", @@ -1780,6 +1782,53 @@ S_dopoptoloop(pTHX_ I32 startingblock) return i; } +/* find the next GIVEN or FOR (with implicit $_) loop context block */ + +STATIC I32 +S_dopoptogivenfor(pTHX_ I32 startingblock) +{ + I32 i; + for (i = startingblock; i >= 0; i--) { + const PERL_CONTEXT *cx = &cxstack[i]; + switch (CxTYPE(cx)) { + default: + continue; + case CXt_GIVEN: + DEBUG_l( Perl_deb(aTHX_ "(dopoptogivenfor(): found given at cx=%ld)\n", (long)i)); + return i; + case CXt_LOOP_PLAIN: + assert(!(cx->cx_type & CXp_FOR_DEF)); + break; + case CXt_LOOP_LAZYIV: + case CXt_LOOP_LAZYSV: + case CXt_LOOP_LIST: + case CXt_LOOP_ARY: + if (cx->cx_type & CXp_FOR_DEF) { + DEBUG_l( Perl_deb(aTHX_ "(dopoptogivenfor(): found foreach at cx=%ld)\n", (long)i)); + return i; + } + } + } + return i; +} + +STATIC I32 +S_dopoptowhen(pTHX_ I32 startingblock) +{ + I32 i; + for (i = startingblock; i >= 0; i--) { + const PERL_CONTEXT *cx = &cxstack[i]; + switch (CxTYPE(cx)) { + default: + continue; + case CXt_WHEN: + DEBUG_l( Perl_deb(aTHX_ "(dopoptowhen(): found when at cx=%ld)\n", (long)i)); + return i; + } + } + return i; +} + /* dounwind(): pop all contexts above (but not including) cxix. * Note that it clears the savestack frame associated with each popped * context entry, but doesn't free any temps. @@ -1824,6 +1873,12 @@ Perl_dounwind(pTHX_ I32 cxix) case CXt_LOOP_ARY: cx_poploop(cx); break; + case CXt_WHEN: + cx_popwhen(cx); + break; + case CXt_GIVEN: + cx_popgiven(cx); + break; case CXt_BLOCK: case CXt_NULL: case CXt_DEFER: @@ -3081,7 +3136,8 @@ S_dofindlabel(pTHX_ OP *o, const char *label, STRLEN len, U32 flags, OP **opstac o->op_type == OP_SCOPE || o->op_type == OP_LEAVELOOP || o->op_type == OP_LEAVESUB || - o->op_type == OP_LEAVETRY) + o->op_type == OP_LEAVETRY || + o->op_type == OP_LEAVEGIVEN) { *ops++ = cUNOPo->op_first; } @@ -3173,6 +3229,9 @@ S_check_op_type(pTHX_ OP * const o) if (o->op_type == OP_ENTERITER) Perl_croak(aTHX_ "Can't \"goto\" into the middle of a foreach loop"); + if (o->op_type == OP_ENTERGIVEN) + Perl_croak(aTHX_ + "Can't \"goto\" into a \"given\" block"); } /* also used for: pp_dump() */ @@ -3513,6 +3572,8 @@ PP(pp_goto) case CXt_LOOP_LAZYSV: case CXt_LOOP_LIST: case CXt_LOOP_ARY: + case CXt_GIVEN: + case CXt_WHEN: gotoprobe = OpSIBLING(cx->blk_oldcop); break; case CXt_SUBST: @@ -5720,6 +5781,46 @@ PP(pp_leavetry) return retop; } +PP(pp_entergiven) +{ + PERL_CONTEXT *cx; + const U8 gimme = GIMME_V; + SV *origsv = DEFSV; + + assert(!PL_op->op_targ); /* used to be set for lexical $_ */ + GvSV(PL_defgv) = rpp_pop_1_norc(); + + cx = cx_pushblock(CXt_GIVEN, gimme, PL_stack_sp, PL_savestack_ix); + cx_pushgiven(cx, origsv); + + return NORMAL; +} + +PP(pp_leavegiven) +{ + PERL_CONTEXT *cx; + U8 gimme; + SV **oldsp; + PERL_UNUSED_CONTEXT; + + cx = CX_CUR(); + assert(CxTYPE(cx) == CXt_GIVEN); + oldsp = PL_stack_base + cx->blk_oldsp; + gimme = cx->blk_gimme; + + if (gimme == G_VOID) + rpp_popfree_to_NN(oldsp); + else + leave_adjust_stacks(oldsp, oldsp, gimme, 1); + + CX_LEAVE_SCOPE(cx); + cx_popgiven(cx); + cx_popblock(cx); + CX_POP(cx); + + return NORMAL; +} + /* Helper routines used by pp_smartmatch */ STATIC PMOP * S_make_matcher(pTHX_ REGEXP *re) @@ -6234,6 +6335,124 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other, const bool copied) } +PP(pp_enterwhen) +{ + PERL_CONTEXT *cx; + const U8 gimme = GIMME_V; + + /* This is essentially an optimization: if the match + fails, we don't want to push a context and then + pop it again right away, so we skip straight + to the op that follows the leavewhen. + */ + if (!(PL_op->op_flags & OPf_SPECIAL)) { /* SPECIAL implies no condition */ + bool tr = SvTRUEx(*PL_stack_sp); + rpp_popfree_1_NN(); + if (!tr) { + if (gimme == G_SCALAR) + rpp_push_IMM(&PL_sv_undef); + return cLOGOP->op_other->op_next; + } + } + + cx = cx_pushblock(CXt_WHEN, gimme, PL_stack_sp, PL_savestack_ix); + cx_pushwhen(cx); + + return NORMAL; +} + +PP(pp_leavewhen) +{ + I32 cxix; + PERL_CONTEXT *cx; + U8 gimme; + SV **oldsp; + + cx = CX_CUR(); + assert(CxTYPE(cx) == CXt_WHEN); + gimme = cx->blk_gimme; + + cxix = dopoptogivenfor(cxstack_ix); + if (cxix < 0) + /* diag_listed_as: Can't "when" outside a topicalizer */ + DIE(aTHX_ "Can't \"%s\" outside a topicalizer", + PL_op->op_flags & OPf_SPECIAL ? "default" : "when"); + + oldsp = PL_stack_base + cx->blk_oldsp; + if (gimme == G_VOID) + rpp_popfree_to_NN(oldsp); + else + leave_adjust_stacks(oldsp, oldsp, gimme, 1); + + /* pop the WHEN, BLOCK and anything else before the GIVEN/FOR */ + assert(cxix < cxstack_ix); + dounwind(cxix); + + cx = &cxstack[cxix]; + + if (CxFOREACH(cx)) { + /* emulate pp_next. Note that any stack(s) cleanup will be + * done by the pp_unstack which op_nextop should point to */ + cx = CX_CUR(); + cx_topblock(cx); + PL_curcop = cx->blk_oldcop; + return cx->blk_loop.my_op->op_nextop; + } + else { + PERL_ASYNC_CHECK(); + assert(cx->blk_givwhen.leave_op->op_type == OP_LEAVEGIVEN); + return cx->blk_givwhen.leave_op; + } +} + +PP(pp_continue) +{ + I32 cxix; + PERL_CONTEXT *cx; + OP *nextop; + + cxix = dopoptowhen(cxstack_ix); + if (cxix < 0) + DIE(aTHX_ "Can't \"continue\" outside a when block"); + + if (cxix < cxstack_ix) + dounwind(cxix); + + cx = CX_CUR(); + assert(CxTYPE(cx) == CXt_WHEN); + rpp_popfree_to_NN(PL_stack_base + cx->blk_oldsp); + CX_LEAVE_SCOPE(cx); + cx_popwhen(cx); + cx_popblock(cx); + nextop = cx->blk_givwhen.leave_op->op_next; + CX_POP(cx); + + return nextop; +} + +PP(pp_break) +{ + I32 cxix; + PERL_CONTEXT *cx; + + cxix = dopoptogivenfor(cxstack_ix); + if (cxix < 0) + DIE(aTHX_ "Can't \"break\" outside a given block"); + + cx = &cxstack[cxix]; + if (CxFOREACH(cx)) + DIE(aTHX_ "Can't \"break\" in a loop topicalizer"); + + if (cxix < cxstack_ix) + dounwind(cxix); + + /* Restore the sp at the time we entered the given block */ + cx = CX_CUR(); + rpp_popfree_to_NN(PL_stack_base + cx->blk_oldsp); + + return cx->blk_givwhen.leave_op; +} + static void _invoke_defer_block(pTHX_ U8 type, void *_arg) { diff --git a/pp_proto.h b/pp_proto.h index 31b9242cdce2..4921c2e636f1 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -35,6 +35,7 @@ PERL_CALLCONV PP(pp_bit_and) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_bit_or) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_bless) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_blessed) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_break) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_caller) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_catch) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_ceil) __attribute__visibility__("hidden"); @@ -53,6 +54,7 @@ PERL_CALLCONV PP(pp_complement) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_concat) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_cond_expr) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_const) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_continue) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_coreargs) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_crypt) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_dbmopen) __attribute__visibility__("hidden"); @@ -66,11 +68,13 @@ PERL_CALLCONV PP(pp_ehostent) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_emptyavhv) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_enter) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_entereval) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_entergiven) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_enteriter) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_enterloop) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_entersub) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_entertry) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_entertrycatch) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_enterwhen) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_enterwrite) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_eof) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_eq) __attribute__visibility__("hidden"); @@ -148,11 +152,13 @@ PERL_CALLCONV PP(pp_lc) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_le) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leave) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leaveeval) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_leavegiven) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leaveloop) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leavesub) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leavesublv) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leavetry) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leavetrycatch) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_leavewhen) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_leavewrite) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_left_shift) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_length) __attribute__visibility__("hidden"); diff --git a/proto.h b/proto.h index 46a9ae7e1b06..e1ec07236a5a 100644 --- a/proto.h +++ b/proto.h @@ -2870,6 +2870,12 @@ Perl_newFOROP(pTHX_ I32 flags, OP *sv, OP *expr, OP *block, OP *cont) #define PERL_ARGS_ASSERT_NEWFOROP \ assert(expr) +PERL_CALLCONV OP * +Perl_newGIVENOP(pTHX_ OP *cond, OP *block, PADOFFSET defsv_off) + __attribute__warn_unused_result__; +#define PERL_ARGS_ASSERT_NEWGIVENOP \ + assert(cond); assert(block) + PERL_CALLCONV GP * Perl_newGP(pTHX_ GV * const gv); #define PERL_ARGS_ASSERT_NEWGP \ @@ -3167,6 +3173,12 @@ Perl_newUNOP_AUX(pTHX_ I32 type, I32 flags, OP *first, UNOP_AUX_item *aux) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWUNOP_AUX +PERL_CALLCONV OP * +Perl_newWHENOP(pTHX_ OP *cond, OP *block) + __attribute__warn_unused_result__; +#define PERL_ARGS_ASSERT_NEWWHENOP \ + assert(block) + PERL_CALLCONV OP * Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP *loop, OP *expr, OP *block, OP *cont, I32 has_my) __attribute__warn_unused_result__; @@ -7383,6 +7395,11 @@ STATIC OP * S_listkids(pTHX_ OP *o); # define PERL_ARGS_ASSERT_LISTKIDS +STATIC bool +S_looks_like_bool(pTHX_ const OP *o); +# define PERL_ARGS_ASSERT_LOOKS_LIKE_BOOL \ + assert(o) + STATIC OP * S_modkids(pTHX_ OP *o, I32 type); # define PERL_ARGS_ASSERT_MODKIDS @@ -7397,6 +7414,11 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp); # define PERL_ARGS_ASSERT_MY_KID \ assert(imopsp) +STATIC OP * +S_newGIVWHENOP(pTHX_ OP *cond, OP *block, I32 enter_opcode, I32 leave_opcode, PADOFFSET entertarg); +# define PERL_ARGS_ASSERT_NEWGIVWHENOP \ + assert(block) + STATIC OP * S_new_logop(pTHX_ I32 type, I32 flags, OP **firstp, OP **otherp) __attribute__warn_unused_result__; @@ -7780,6 +7802,11 @@ S_dopoptoeval(pTHX_ I32 startingblock) __attribute__warn_unused_result__; # define PERL_ARGS_ASSERT_DOPOPTOEVAL +STATIC I32 +S_dopoptogivenfor(pTHX_ I32 startingblock) + __attribute__warn_unused_result__; +# define PERL_ARGS_ASSERT_DOPOPTOGIVENFOR + STATIC I32 S_dopoptolabel(pTHX_ const char *label, STRLEN len, U32 flags) __attribute__warn_unused_result__; @@ -7797,6 +7824,11 @@ S_dopoptosub_at(pTHX_ const PERL_CONTEXT *cxstk, I32 startingblock) # define PERL_ARGS_ASSERT_DOPOPTOSUB_AT \ assert(cxstk) +STATIC I32 +S_dopoptowhen(pTHX_ I32 startingblock) + __attribute__warn_unused_result__; +# define PERL_ARGS_ASSERT_DOPOPTOWHEN + STATIC PMOP * S_make_matcher(pTHX_ REGEXP *re) __attribute__warn_unused_result__; @@ -10143,6 +10175,11 @@ Perl_cx_popformat(pTHX_ PERL_CONTEXT *cx); # define PERL_ARGS_ASSERT_CX_POPFORMAT \ assert(cx) +PERL_STATIC_INLINE void +Perl_cx_popgiven(pTHX_ PERL_CONTEXT *cx); +# define PERL_ARGS_ASSERT_CX_POPGIVEN \ + assert(cx) + PERL_STATIC_INLINE void Perl_cx_poploop(pTHX_ PERL_CONTEXT *cx); # define PERL_ARGS_ASSERT_CX_POPLOOP \ @@ -10163,6 +10200,11 @@ Perl_cx_popsub_common(pTHX_ PERL_CONTEXT *cx); # define PERL_ARGS_ASSERT_CX_POPSUB_COMMON \ assert(cx) +PERL_STATIC_INLINE void +Perl_cx_popwhen(pTHX_ PERL_CONTEXT *cx); +# define PERL_ARGS_ASSERT_CX_POPWHEN \ + assert(cx) + PERL_STATIC_INLINE PERL_CONTEXT * Perl_cx_pushblock(pTHX_ U8 type, U8 gimme, SV **sp, I32 saveix); # define PERL_ARGS_ASSERT_CX_PUSHBLOCK \ @@ -10179,6 +10221,11 @@ Perl_cx_pushformat(pTHX_ PERL_CONTEXT *cx, CV *cv, OP *retop, GV *gv); assert(cx); assert(cv); \ assert(SvTYPE(cv) == SVt_PVCV || SvTYPE(cv) == SVt_PVFM) +PERL_STATIC_INLINE void +Perl_cx_pushgiven(pTHX_ PERL_CONTEXT *cx, SV *orig_defsv); +# define PERL_ARGS_ASSERT_CX_PUSHGIVEN \ + assert(cx) + PERL_STATIC_INLINE void Perl_cx_pushloop_for(pTHX_ PERL_CONTEXT *cx, void *itervarp, SV *itersave); # define PERL_ARGS_ASSERT_CX_PUSHLOOP_FOR \ @@ -10200,6 +10247,11 @@ Perl_cx_pushtry(pTHX_ PERL_CONTEXT *cx, OP *retop); # define PERL_ARGS_ASSERT_CX_PUSHTRY \ assert(cx) +PERL_STATIC_INLINE void +Perl_cx_pushwhen(pTHX_ PERL_CONTEXT *cx); +# define PERL_ARGS_ASSERT_CX_PUSHWHEN \ + assert(cx) + PERL_STATIC_INLINE void Perl_cx_topblock(pTHX_ PERL_CONTEXT *cx); # define PERL_ARGS_ASSERT_CX_TOPBLOCK \ diff --git a/regen/keywords.pl b/regen/keywords.pl index fef5b4186792..9379e57712e8 100755 --- a/regen/keywords.pl +++ b/regen/keywords.pl @@ -38,7 +38,11 @@ my %feature_kw = ( state => 'state', say => 'say', + given => 'switch', + when => 'switch', + default => 'switch', # continue is already a keyword + break => 'switch', evalbytes => 'evalbytes', __SUB__ => '__SUB__', fc => 'fc', @@ -141,6 +145,7 @@ END -bind -binmode -bless +-break -caller +catch -chdir @@ -160,6 +165,7 @@ END -crypt -dbmclose -dbmopen ++default +defer +defined +delete @@ -221,6 +227,7 @@ END -getservent -getsockname -getsockopt ++given +glob -gmtime +goto @@ -373,6 +380,7 @@ END -waitpid -wantarray -warn ++when +while -write -x diff --git a/regen/opcodes b/regen/opcodes index a2676d8aa8b1..46965259731b 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -335,6 +335,13 @@ method_super super with known name ck_null d. method_redir redirect method with known name ck_null d. method_redir_super redirect super method with known name ck_null d. +entergiven given() ck_null d| +leavegiven leave given block ck_null 1 +enterwhen when() ck_null d| +leavewhen leave when block ck_null 1 +break break ck_null 0 +continue continue ck_null 0 + # I/O. open open ck_open ismt@ F S? L diff --git a/sv.c b/sv.c index 89ef063c0531..7c82b0408912 100644 --- a/sv.c +++ b/sv.c @@ -15183,8 +15183,13 @@ Perl_cx_dup(pTHX_ PERL_CONTEXT *cxs, I32 ix, I32 max, CLONE_PARAMS* param) ncx->blk_format.dfoutgv = gv_dup_inc(ncx->blk_format.dfoutgv, param); break; + case CXt_GIVEN: + ncx->blk_givwhen.defsv_save = + sv_dup_inc(ncx->blk_givwhen.defsv_save, param); + break; case CXt_BLOCK: case CXt_NULL: + case CXt_WHEN: case CXt_DEFER: break; } diff --git a/t/lib/croak/pp_ctl b/t/lib/croak/pp_ctl index 266cb90e3cca..179c8d7aea89 100644 --- a/t/lib/croak/pp_ctl +++ b/t/lib/croak/pp_ctl @@ -11,13 +11,13 @@ no warnings 'deprecated'; goto f; CORE::given(1){f:} EXPECT -CORE::given is not a keyword at - line 3. +Can't "goto" into a "given" block at - line 3. ######## # NAME goto from given topic expression no warnings 'deprecated'; CORE::given(goto f){f:} EXPECT -CORE::given is not a keyword at - line 2. +Can't "goto" into a "given" block at - line 2. ######## # NAME goto into expression no warnings 'deprecated'; @@ -39,17 +39,16 @@ EXPECT Can't find label foo at - line 3. ######## # NAME when outside given -use 5.01; +use 5.01; no warnings 'deprecated'; when(undef){} EXPECT -syntax error at - line 2, near "){" -Execution of - aborted due to compilation errors. +Can't "when" outside a topicalizer at - line 2. ######## # NAME default outside given use 5.01; default{} EXPECT -Can't call method "default" without a package or object reference at - line 2. +Can't "default" outside a topicalizer at - line 2. ######## # NAME croak with read only $@ eval '"a" =~ /${*@=\_})/'; diff --git a/t/lib/feature/switch b/t/lib/feature/switch new file mode 100644 index 000000000000..4d379ea21322 --- /dev/null +++ b/t/lib/feature/switch @@ -0,0 +1,142 @@ +Check the lexical scoping of the switch keywords. +(The actual behaviour is tested in t/op/switch.t) + +__END__ +# No switch; given should be a bareword. +use warnings; no warnings 'deprecated'; +print STDOUT given; +EXPECT +Unquoted string "given" may clash with future reserved word at - line 3. +given +######## +# No switch; when should be a bareword. +use warnings; no warnings 'deprecated'; +print STDOUT when; +EXPECT +Unquoted string "when" may clash with future reserved word at - line 3. +when +######## +# No switch; default should be a bareword. +use warnings; no warnings 'deprecated'; +print STDOUT default; +EXPECT +Unquoted string "default" may clash with future reserved word at - line 3. +default +######## +# No switch; break should be a bareword. +use warnings; no warnings 'deprecated'; +print STDOUT break; +EXPECT +Unquoted string "break" may clash with future reserved word at - line 3. +break +######## +# No switch; but continue is still a keyword +print STDOUT continue; +EXPECT +Can't "continue" outside a when block at - line 2. +######## +# Use switch; so given is a keyword +use feature 'switch'; no warnings 'deprecated'; +given("okay\n") { print } +EXPECT +okay +######## +# Use switch; so when is a keyword +use feature 'switch'; no warnings 'deprecated'; +given(1) { when(1) { print "okay" } } +EXPECT +okay +######## +# Use switch; so default is a keyword +use feature 'switch'; no warnings 'deprecated'; +given(1) { default { print "okay" } } +EXPECT +okay +######## +# Use switch; so break is a keyword +use feature 'switch'; +break; +EXPECT +Can't "break" outside a given block at - line 3. +######## +# switch out of scope; given should be a bareword. +use warnings; no warnings 'deprecated'; +{ use feature 'switch'; + given (1) {print "Okay here\n";} +} +print STDOUT given; +EXPECT +Unquoted string "given" may clash with future reserved word at - line 6. +Okay here +given +######## +# switch out of scope; when should be a bareword. +use warnings; no warnings 'deprecated'; +{ use feature 'switch'; + given (1) { when(1) {print "Okay here\n";} } +} +print STDOUT when; +EXPECT +Unquoted string "when" may clash with future reserved word at - line 6. +Okay here +when +######## +# switch out of scope; default should be a bareword. +use warnings; no warnings 'deprecated'; +{ use feature 'switch'; + given (1) { default {print "Okay here\n";} } +} +print STDOUT default; +EXPECT +Unquoted string "default" may clash with future reserved word at - line 6. +Okay here +default +######## +# switch out of scope; break should be a bareword. +use warnings; no warnings 'deprecated'; +{ use feature 'switch'; + given (1) { break } +} +print STDOUT break; +EXPECT +Unquoted string "break" may clash with future reserved word at - line 6. +break +######## +# C should work +use warnings; no warnings 'deprecated'; +use feature 'switch'; +given (1) { when(1) {print "Okay here\n";} } +no feature 'switch'; +print STDOUT when; +EXPECT +Unquoted string "when" may clash with future reserved word at - line 6. +Okay here +when +######## +# C should work too +use warnings; no warnings 'deprecated'; +use feature 'switch'; +given (1) { when(1) {print "Okay here\n";} } +no feature; +print STDOUT when; +EXPECT +Unquoted string "when" may clash with future reserved word at - line 6. +Okay here +when +######## +# Without the feature, no 'Unambiguous use of' warning: +use warnings; no warnings 'deprecated'; +@break = ($break = "break"); +print ${break}, ${break[0]}; +EXPECT +breakbreak +######## +# With the feature, we get an 'Unambiguous use of' warning: +use warnings; no warnings 'deprecated'; +use feature 'switch'; +@break = ($break = "break"); +print ${break}, ${break[0]}; +EXPECT +Ambiguous use of ${break} resolved to $break at - line 5. +Ambiguous use of ${break[...]} resolved to $break[...] at - line 5. +breakbreak diff --git a/t/op/coreamp.t b/t/op/coreamp.t index 1c2ee711363d..d928c39b8ae3 100644 --- a/t/op/coreamp.t +++ b/t/op/coreamp.t @@ -370,6 +370,20 @@ like join(" ", &CORE::bless([],'parcel')), qr/^parcel=ARRAY(?!.* )/, "&bless in list context"; like &mybless([]), qr/^main=ARRAY/, '&bless with one arg'; +test_proto 'break'; +{ + $tests ++; + my $tmp; + no warnings 'deprecated'; + CORE::given(1) { + CORE::when(1) { + &mybreak; + $tmp = 'bad'; + } + } + is $tmp, undef, '&break'; +} + test_proto 'caller'; $tests += 4; sub caller_test { @@ -476,6 +490,16 @@ SKIP: lis [&myconnect('foo','bar')], [undef], '&connect in list context'; } +test_proto 'continue'; +$tests ++; +no warnings 'deprecated'; +CORE::given(1) { + CORE::when(1) { + &mycontinue(); + } + pass "&continue"; +} + test_proto 'cos'; test_proto 'crypt'; @@ -1166,7 +1190,7 @@ like $@, qr'^Undefined format "STDOUT" called', my %nottest_words = map { $_ => 1 } qw( ADJUST AUTOLOAD BEGIN CHECK CORE DESTROY END INIT UNITCHECK __DATA__ __END__ - all and any catch class cmp continue default defer do dump else elsif + all and any catch class cmp default defer do dump else elsif eq eval field finally for foreach format ge given goto grep gt if isa last le local lt m map method my ne next no or our package print printf q qq qr qw qx redo require diff --git a/t/op/coresubs.t b/t/op/coresubs.t index afcc072c46cd..2991347d25d3 100644 --- a/t/op/coresubs.t +++ b/t/op/coresubs.t @@ -18,11 +18,11 @@ use B; my %unsupported = map +($_=>1), qw ( __DATA__ __END__ ADJUST AUTOLOAD BEGIN UNITCHECK CORE DESTROY END INIT CHECK - all and any catch class cmp continue defer do dump else elsif eq eval field - finally for foreach format ge goto grep gt if isa last le local + all and any catch class cmp default defer do dump else elsif eq eval field + finally for foreach format ge given goto grep gt if isa last le local lt m map method my ne next no or our package print printf q qq qr qw qx redo require return s say sort state sub tr try unless until use - while x xor y + when while x xor y ); my %args_for = ( dbmopen => '%1,$2,$3', diff --git a/t/op/cproto.t b/t/op/cproto.t index bf0d823d65c3..fec9fe6ba939 100644 --- a/t/op/cproto.t +++ b/t/op/cproto.t @@ -7,7 +7,7 @@ BEGIN { set_up_inc('../lib'); } -plan tests => 249; +plan tests => 254; while () { chomp; @@ -51,6 +51,7 @@ atan2 ($$) bind (*$) binmode (*;$) bless ($;$) +break () caller (;$) chdir (;$) chmod (@) @@ -63,10 +64,12 @@ close (;*) closedir (*) cmp undef connect (*$) +continue () cos (_) crypt ($$) dbmclose (\%) dbmopen (\%$$) +default undef defined undef delete undef die (@) @@ -125,6 +128,7 @@ getservbyport ($$) getservent () getsockname (*) getsockopt (*$$) +given undef glob (_;) gmtime (;$) goto undef @@ -274,6 +278,7 @@ wait () waitpid ($$) wantarray () warn (@) +when undef while undef write (;*) x undef diff --git a/t/op/state.t b/t/op/state.t index 1c0b0a81fecd..26410e5a017a 100644 --- a/t/op/state.t +++ b/t/op/state.t @@ -9,7 +9,7 @@ BEGIN { use strict; -plan tests => 166; +plan tests => 170; # Before loading feature.pm, test it with CORE:: ok eval 'CORE::state $x = 1;', 'CORE::state outside of feature.pm scope'; @@ -341,6 +341,18 @@ foreach my $x (0 .. 4) { } +# +# Use with given. +# +my @spam = qw [spam ham bacon beans]; +foreach my $spam (@spam) { + no warnings 'deprecated'; + given (state $spam = $spam) { + when ($spam [0]) {ok 1, "given"} + default {ok 0, "given"} + } +} + # # Redefine. # diff --git a/t/op/switch.t b/t/op/switch.t new file mode 100644 index 000000000000..e1c079956f0d --- /dev/null +++ b/t/op/switch.t @@ -0,0 +1,1384 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + require './test.pl'; + set_up_inc('../lib'); +} + +use strict; +use warnings; +no warnings 'deprecated'; + +plan tests => 197; + +# The behaviour of the feature pragma should be tested by lib/feature.t +# using the tests in t/lib/feature/*. This file tests the behaviour of +# the switch ops themselves. + + +# Before loading feature, test the switch ops with CORE:: +CORE::given(3) { + CORE::when(3) { pass "CORE::given and CORE::when"; continue } + CORE::default { pass "continue (without feature) and CORE::default" } +} + + +use feature 'switch'; + +eval { continue }; +like($@, qr/^Can't "continue" outside/, "continue outside"); + +eval { break }; +like($@, qr/^Can't "break" outside/, "break outside"); + +# Scoping rules + +{ + my $x = "foo"; + given(my $x = "bar") { + is($x, "bar", "given scope starts"); + } + is($x, "foo", "given scope ends"); +} + +sub be_true {1} + +given(my $x = "foo") { + when(be_true(my $x = "bar")) { + is($x, "bar", "given scope starts"); + } + is($x, "foo", "given scope ends"); +} + +$_ = "outside"; +given("inside") { check_outside1() } +sub check_outside1 { is($_, "inside", "\$_ is not lexically scoped") } + +# Basic string/numeric comparisons and control flow + +{ + my $ok; + given(3) { + when(2) { $ok = 'two'; } + when(3) { $ok = 'three'; } + when(4) { $ok = 'four'; } + default { $ok = 'd'; } + } + is($ok, 'three', "numeric comparison"); +} + +{ + my $ok; + use integer; + given(3.14159265) { + when(2) { $ok = 'two'; } + when(3) { $ok = 'three'; } + when(4) { $ok = 'four'; } + default { $ok = 'd'; } + } + is($ok, 'three', "integer comparison"); +} + +{ + my ($ok1, $ok2); + given(3) { + when(3.1) { $ok1 = 'n'; } + when(3.0) { $ok1 = 'y'; continue } + when("3.0") { $ok2 = 'y'; } + default { $ok2 = 'n'; } + } + is($ok1, 'y', "more numeric (pt. 1)"); + is($ok2, 'y', "more numeric (pt. 2)"); +} + +{ + my $ok; + given("c") { + when("b") { $ok = 'B'; } + when("c") { $ok = 'C'; } + when("d") { $ok = 'D'; } + default { $ok = 'def'; } + } + is($ok, 'C', "string comparison"); +} + +{ + my $ok; + given("c") { + when("b") { $ok = 'B'; } + when("c") { $ok = 'C'; continue } + when("c") { $ok = 'CC'; } + default { $ok = 'D'; } + } + is($ok, 'CC', "simple continue"); +} + +# Definedness +{ + my $ok = 1; + given (0) { when(undef) {$ok = 0} } + is($ok, 1, "Given(0) when(undef)"); +} +{ + my $undef; + my $ok = 1; + given (0) { when($undef) {$ok = 0} } + is($ok, 1, 'Given(0) when($undef)'); +} +{ + my $undef; + my $ok = 0; + given (0) { when($undef++) {$ok = 1} } + is($ok, 1, "Given(0) when($undef++)"); +} +{ + no warnings "uninitialized"; + my $ok = 1; + given (undef) { when(0) {$ok = 0} } + is($ok, 1, "Given(undef) when(0)"); +} +{ + no warnings "uninitialized"; + my $undef; + my $ok = 1; + given ($undef) { when(0) {$ok = 0} } + is($ok, 1, 'Given($undef) when(0)'); +} +######## +{ + my $ok = 1; + given ("") { when(undef) {$ok = 0} } + is($ok, 1, 'Given("") when(undef)'); +} +{ + my $undef; + my $ok = 1; + given ("") { when($undef) {$ok = 0} } + is($ok, 1, 'Given("") when($undef)'); +} +{ + no warnings "uninitialized"; + my $ok = 1; + given (undef) { when("") {$ok = 0} } + is($ok, 1, 'Given(undef) when("")'); +} +{ + no warnings "uninitialized"; + my $undef; + my $ok = 1; + given ($undef) { when("") {$ok = 0} } + is($ok, 1, 'Given($undef) when("")'); +} +######## +{ + my $ok = 0; + given (undef) { when(undef) {$ok = 1} } + is($ok, 1, "Given(undef) when(undef)"); +} +{ + my $undef; + my $ok = 0; + given (undef) { when($undef) {$ok = 1} } + is($ok, 1, 'Given(undef) when($undef)'); +} +{ + my $undef; + my $ok = 0; + given ($undef) { when(undef) {$ok = 1} } + is($ok, 1, 'Given($undef) when(undef)'); +} +{ + my $undef; + my $ok = 0; + given ($undef) { when($undef) {$ok = 1} } + is($ok, 1, 'Given($undef) when($undef)'); +} + + +# Regular expressions +{ + my ($ok1, $ok2); + given("Hello, world!") { + when(/lo/) + { $ok1 = 'y'; continue} + when(/no/) + { $ok1 = 'n'; continue} + when(/^(Hello,|Goodbye cruel) world[!.?]/) + { $ok2 = 'Y'; continue} + when(/^(Hello cruel|Goodbye,) world[!.?]/) + { $ok2 = 'n'; continue} + } + is($ok1, 'y', "regex 1"); + is($ok2, 'Y', "regex 2"); +} + +# Comparisons +{ + my $test = "explicit numeric comparison (<)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ < 10) { $ok = "ten" } + when ($_ < 20) { $ok = "twenty" } + when ($_ < 30) { $ok = "thirty" } + when ($_ < 40) { $ok = "forty" } + default { $ok = "default" } + } + is($ok, "thirty", $test); +} + +{ + use integer; + my $test = "explicit numeric comparison (integer <)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ < 10) { $ok = "ten" } + when ($_ < 20) { $ok = "twenty" } + when ($_ < 30) { $ok = "thirty" } + when ($_ < 40) { $ok = "forty" } + default { $ok = "default" } + } + is($ok, "thirty", $test); +} + +{ + my $test = "explicit numeric comparison (<=)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ <= 10) { $ok = "ten" } + when ($_ <= 20) { $ok = "twenty" } + when ($_ <= 30) { $ok = "thirty" } + when ($_ <= 40) { $ok = "forty" } + default { $ok = "default" } + } + is($ok, "thirty", $test); +} + +{ + use integer; + my $test = "explicit numeric comparison (integer <=)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ <= 10) { $ok = "ten" } + when ($_ <= 20) { $ok = "twenty" } + when ($_ <= 30) { $ok = "thirty" } + when ($_ <= 40) { $ok = "forty" } + default { $ok = "default" } + } + is($ok, "thirty", $test); +} + + +{ + my $test = "explicit numeric comparison (>)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ > 40) { $ok = "forty" } + when ($_ > 30) { $ok = "thirty" } + when ($_ > 20) { $ok = "twenty" } + when ($_ > 10) { $ok = "ten" } + default { $ok = "default" } + } + is($ok, "twenty", $test); +} + +{ + my $test = "explicit numeric comparison (>=)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ >= 40) { $ok = "forty" } + when ($_ >= 30) { $ok = "thirty" } + when ($_ >= 20) { $ok = "twenty" } + when ($_ >= 10) { $ok = "ten" } + default { $ok = "default" } + } + is($ok, "twenty", $test); +} + +{ + use integer; + my $test = "explicit numeric comparison (integer >)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ > 40) { $ok = "forty" } + when ($_ > 30) { $ok = "thirty" } + when ($_ > 20) { $ok = "twenty" } + when ($_ > 10) { $ok = "ten" } + default { $ok = "default" } + } + is($ok, "twenty", $test); +} + +{ + use integer; + my $test = "explicit numeric comparison (integer >=)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ >= 40) { $ok = "forty" } + when ($_ >= 30) { $ok = "thirty" } + when ($_ >= 20) { $ok = "twenty" } + when ($_ >= 10) { $ok = "ten" } + default { $ok = "default" } + } + is($ok, "twenty", $test); +} + + +{ + my $test = "explicit string comparison (lt)"; + my $twenty_five = "25"; + my $ok; + given($twenty_five) { + when ($_ lt "10") { $ok = "ten" } + when ($_ lt "20") { $ok = "twenty" } + when ($_ lt "30") { $ok = "thirty" } + when ($_ lt "40") { $ok = "forty" } + default { $ok = "default" } + } + is($ok, "thirty", $test); +} + +{ + my $test = "explicit string comparison (le)"; + my $twenty_five = "25"; + my $ok; + given($twenty_five) { + when ($_ le "10") { $ok = "ten" } + when ($_ le "20") { $ok = "twenty" } + when ($_ le "30") { $ok = "thirty" } + when ($_ le "40") { $ok = "forty" } + default { $ok = "default" } + } + is($ok, "thirty", $test); +} + +{ + my $test = "explicit string comparison (gt)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ ge "40") { $ok = "forty" } + when ($_ ge "30") { $ok = "thirty" } + when ($_ ge "20") { $ok = "twenty" } + when ($_ ge "10") { $ok = "ten" } + default { $ok = "default" } + } + is($ok, "twenty", $test); +} + +{ + my $test = "explicit string comparison (ge)"; + my $twenty_five = 25; + my $ok; + given($twenty_five) { + when ($_ ge "40") { $ok = "forty" } + when ($_ ge "30") { $ok = "thirty" } + when ($_ ge "20") { $ok = "twenty" } + when ($_ ge "10") { $ok = "ten" } + default { $ok = "default" } + } + is($ok, "twenty", $test); +} + +# Optimized-away comparisons +{ + my $ok; + given(23) { + when (2 + 2 == 4) { $ok = 'y'; continue } + when (2 + 2 == 5) { $ok = 'n' } + } + is($ok, 'y', "Optimized-away comparison"); +} + +{ + my $ok; + given(23) { + when (scalar 24) { $ok = 'n'; continue } + default { $ok = 'y' } + } + is($ok,'y','scalar()'); +} + +# File tests +# (How to be both thorough and portable? Pinch a few ideas +# from t/op/filetest.t. We err on the side of portability for +# the time being.) + +{ + my ($ok_d, $ok_f, $ok_r); + given("op") { + when(-d) {$ok_d = 1; continue} + when(!-f) {$ok_f = 1; continue} + when(-r) {$ok_r = 1; continue} + } + ok($ok_d, "Filetest -d"); + ok($ok_f, "Filetest -f"); + ok($ok_r, "Filetest -r"); +} + +# Sub and method calls +sub notfoo {"bar"} +{ + my $ok = 0; + given("foo") { + when(notfoo()) {$ok = 1} + } + ok($ok, "Sub call acts as boolean") +} + +{ + my $ok = 0; + given("foo") { + when(main->notfoo()) {$ok = 1} + } + ok($ok, "Class-method call acts as boolean") +} + +{ + my $ok = 0; + my $obj = bless []; + given("foo") { + when($obj->notfoo()) {$ok = 1} + } + ok($ok, "Object-method call acts as boolean") +} + +# Other things that should not be smart matched +{ + my $ok = 0; + given(12) { + when( /(\d+)/ and ( 1 <= $1 and $1 <= 12 ) ) { + $ok = 1; + } + } + ok($ok, "bool not smartmatches"); +} + +{ + my $ok = 0; + given(0) { + when(eof(DATA)) { + $ok = 1; + } + } + ok($ok, "eof() not smartmatched"); +} + +{ + my $ok = 0; + my %foo = ("bar", 0); + given(0) { + when(exists $foo{bar}) { + $ok = 1; + } + } + ok($ok, "exists() not smartmatched"); +} + +{ + my $ok = 0; + given(0) { + when(defined $ok) { + $ok = 1; + } + } + ok($ok, "defined() not smartmatched"); +} + +{ + my $ok = 1; + given("foo") { + when((1 == 1) && "bar") { + $ok = 0; + } + when((1 == 1) && $_ eq "foo") { + $ok = 2; + } + } + is($ok, 2, "((1 == 1) && \"bar\") not smartmatched"); +} + +{ + my $n = 0; + for my $l (qw(a b c d)) { + given ($l) { + when ($_ eq "b" .. $_ eq "c") { $n = 1 } + default { $n = 0 } + } + ok(($n xor $l =~ /[ad]/), 'when(E1..E2) evaluates in boolean context'); + } +} + +{ + my $n = 0; + for my $l (qw(a b c d)) { + given ($l) { + when ($_ eq "b" ... $_ eq "c") { $n = 1 } + default { $n = 0 } + } + ok(($n xor $l =~ /[ad]/), 'when(E1...E2) evaluates in boolean context'); + } +} + +{ + my $ok = 0; + given("foo") { + when((1 == $ok) || "foo") { + $ok = 1; + } + } + ok($ok, '((1 == $ok) || "foo") smartmatched'); +} + +{ + my $ok = 0; + given("foo") { + when((1 == $ok || undef) // "foo") { + $ok = 1; + } + } + ok($ok, '((1 == $ok || undef) // "foo") smartmatched'); +} + +# Make sure we aren't invoking the get-magic more than once + +{ # A helper class to count the number of accesses. + package FetchCounter; + sub TIESCALAR { + my ($class) = @_; + bless {value => undef, count => 0}, $class; + } + sub STORE { + my ($self, $val) = @_; + $self->{count} = 0; + $self->{value} = $val; + } + sub FETCH { + my ($self) = @_; + # Avoid pre/post increment here + $self->{count} = 1 + $self->{count}; + $self->{value}; + } + sub count { + my ($self) = @_; + $self->{count}; + } +} + +my $f = tie my $v, "FetchCounter"; + +{ my $test_name = "Multiple FETCHes in given, due to aliasing"; + my $ok; + given($v = 23) { + when(undef) {} + when(sub{0}->()) {} + when(21) {} + when("22") {} + when(23) {$ok = 1} + when(/24/) {$ok = 0} + } + is($ok, 1, "precheck: $test_name"); + is($f->count(), 4, $test_name); +} + +{ my $test_name = "Only one FETCH (numeric when)"; + my $ok; + $v = 23; + is($f->count(), 0, "Sanity check: $test_name"); + given(23) { + when(undef) {} + when(sub{0}->()) {} + when(21) {} + when("22") {} + when($v) {$ok = 1} + when(/24/) {$ok = 0} + } + is($ok, 1, "precheck: $test_name"); + is($f->count(), 1, $test_name); +} + +{ my $test_name = "Only one FETCH (string when)"; + my $ok; + $v = "23"; + is($f->count(), 0, "Sanity check: $test_name"); + given("23") { + when(undef) {} + when(sub{0}->()) {} + when("21") {} + when("22") {} + when($v) {$ok = 1} + when(/24/) {$ok = 0} + } + is($ok, 1, "precheck: $test_name"); + is($f->count(), 1, $test_name); +} + +{ my $test_name = "Only one FETCH (undef)"; + my $ok; + $v = undef; + is($f->count(), 0, "Sanity check: $test_name"); + no warnings "uninitialized"; + given(my $undef) { + when(sub{0}->()) {} + when("21") {} + when("22") {} + when($v) {$ok = 1} + when(undef) {$ok = 0} + } + is($ok, 1, "precheck: $test_name"); + is($f->count(), 1, $test_name); +} + +# Loop topicalizer +{ + my $first = 1; + for (1, "two") { + when ("two") { + is($first, 0, "Loop: second"); + eval {break}; + like($@, qr/^Can't "break" in a loop topicalizer/, + q{Can't "break" in a loop topicalizer}); + } + when (1) { + is($first, 1, "Loop: first"); + $first = 0; + # Implicit break is okay + } + } +} + +{ + my $first = 1; + for $_ (1, "two") { + when ("two") { + is($first, 0, "Explicit \$_: second"); + eval {break}; + like($@, qr/^Can't "break" in a loop topicalizer/, + q{Can't "break" in a loop topicalizer}); + } + when (1) { + is($first, 1, "Explicit \$_: first"); + $first = 0; + # Implicit break is okay + } + } +} + + +# Code references +{ + my $called_foo = 0; + sub foo {$called_foo = 1; "@_" eq "foo"} + my $called_bar = 0; + sub bar {$called_bar = 1; "@_" eq "bar"} + my ($matched_foo, $matched_bar) = (0, 0); + given("foo") { + when(\&bar) {$matched_bar = 1} + when(\&foo) {$matched_foo = 1} + } + is($called_foo, 1, "foo() was called"); + is($called_bar, 1, "bar() was called"); + is($matched_bar, 0, "bar didn't match"); + is($matched_foo, 1, "foo did match"); +} + +sub contains_x { + my $x = shift; + return ($x =~ /x/); +} +{ + my ($ok1, $ok2) = (0,0); + given("foxy!") { + when(contains_x($_)) + { $ok1 = 1; continue } + when(\&contains_x) + { $ok2 = 1; continue } + } + is($ok1, 1, "Calling sub directly (true)"); + is($ok2, 1, "Calling sub indirectly (true)"); + + given("foggy") { + when(contains_x($_)) + { $ok1 = 2; continue } + when(\&contains_x) + { $ok2 = 2; continue } + } + is($ok1, 1, "Calling sub directly (false)"); + is($ok2, 1, "Calling sub indirectly (false)"); +} + +{ + # Test overloading + { package OverloadTest; + + use overload '""' => sub{"string value of obj"}; + use overload 'eq' => sub{"$_[0]" eq "$_[1]"}; + + use overload "~~" => sub { + my ($self, $other, $reversed) = @_; + if ($reversed) { + $self->{left} = $other; + $self->{right} = $self; + $self->{reversed} = 1; + } else { + $self->{left} = $self; + $self->{right} = $other; + $self->{reversed} = 0; + } + $self->{called} = 1; + return $self->{retval}; + }; + + sub new { + my ($pkg, $retval) = @_; + bless { + called => 0, + retval => $retval, + }, $pkg; + } + } + + { + my $test = "Overloaded obj in given (true)"; + my $obj = OverloadTest->new(1); + my $matched; + given($obj) { + when ("other arg") {$matched = 1} + default {$matched = 0} + } + + is($obj->{called}, 1, "$test: called"); + ok($matched, "$test: matched"); + } + + { + my $test = "Overloaded obj in given (false)"; + my $obj = OverloadTest->new(0); + my $matched; + given($obj) { + when ("other arg") {$matched = 1} + } + + is($obj->{called}, 1, "$test: called"); + ok(!$matched, "$test: not matched"); + } + + { + my $test = "Overloaded obj in when (true)"; + my $obj = OverloadTest->new(1); + my $matched; + given("topic") { + when ($obj) {$matched = 1} + default {$matched = 0} + } + + is($obj->{called}, 1, "$test: called"); + ok($matched, "$test: matched"); + is($obj->{left}, "topic", "$test: left"); + is($obj->{right}, "string value of obj", "$test: right"); + ok($obj->{reversed}, "$test: reversed"); + } + + { + my $test = "Overloaded obj in when (false)"; + my $obj = OverloadTest->new(0); + my $matched; + given("topic") { + when ($obj) {$matched = 1} + default {$matched = 0} + } + + is($obj->{called}, 1, "$test: called"); + ok(!$matched, "$test: not matched"); + is($obj->{left}, "topic", "$test: left"); + is($obj->{right}, "string value of obj", "$test: right"); + ok($obj->{reversed}, "$test: reversed"); + } +} + +# Postfix when +{ + my $ok; + given (undef) { + $ok = 1 when undef; + } + is($ok, 1, "postfix undef"); +} +{ + my $ok; + given (2) { + $ok += 1 when 7; + $ok += 2 when 9.1685; + $ok += 4 when $_ > 4; + $ok += 8 when $_ < 2.5; + } + is($ok, 8, "postfix numeric"); +} +{ + my $ok; + given ("apple") { + $ok = 1, continue when $_ eq "apple"; + $ok += 2; + $ok = 0 when "banana"; + } + is($ok, 3, "postfix string"); +} +{ + my $ok; + given ("pear") { + do { $ok = 1; continue } when /pea/; + $ok += 2; + $ok = 0 when /pie/; + default { $ok += 4 } + $ok = 0; + } + is($ok, 7, "postfix regex"); +} +# be_true is defined at the beginning of the file +{ + my $x = "what"; + given(my $x = "foo") { + do { + is($x, "foo", "scope inside ... when my \$x = ..."); + continue; + } when be_true(my $x = "bar"); + is($x, "bar", "scope after ... when my \$x = ..."); + } +} +{ + my $x = 0; + given(my $x = 1) { + my $x = 2, continue when be_true(); + is($x, undef, "scope after my \$x = ... when ..."); + } +} + +# Tests for last and next in when clauses +my $letter; + +$letter = ''; +for ("a".."e") { + given ($_) { + $letter = $_; + when ("b") { last } + } + $letter = "z"; +} +is($letter, "b", "last in when"); + +$letter = ''; +LETTER1: for ("a".."e") { + given ($_) { + $letter = $_; + when ("b") { last LETTER1 } + } + $letter = "z"; +} +is($letter, "b", "last LABEL in when"); + +$letter = ''; +for ("a".."e") { + given ($_) { + when (/b|d/) { next } + $letter .= $_; + } + $letter .= ','; +} +is($letter, "a,c,e,", "next in when"); + +$letter = ''; +LETTER2: for ("a".."e") { + given ($_) { + when (/b|d/) { next LETTER2 } + $letter .= $_; + } + $letter .= ','; +} +is($letter, "a,c,e,", "next LABEL in when"); + +# Test goto with given/when +{ + my $flag = 0; + goto GIVEN1; + $flag = 1; + GIVEN1: given ($flag) { + when (0) { break; } + $flag = 2; + } + is($flag, 0, "goto GIVEN1"); +} +{ + my $flag = 0; + given ($flag) { + when (0) { $flag = 1; } + goto GIVEN2; + $flag = 2; + } +GIVEN2: + is($flag, 1, "goto inside given"); +} +{ + my $flag = 0; + given ($flag) { + when (0) { $flag = 1; goto GIVEN3; $flag = 2; } + $flag = 3; + } +GIVEN3: + is($flag, 1, "goto inside given and when"); +} +{ + my $flag = 0; + for ($flag) { + when (0) { $flag = 1; goto GIVEN4; $flag = 2; } + $flag = 3; + } +GIVEN4: + is($flag, 1, "goto inside for and when"); +} +{ + my $flag = 0; +GIVEN5: + given ($flag) { + when (0) { $flag = 1; goto GIVEN5; $flag = 2; } + when (1) { break; } + $flag = 3; + } + is($flag, 1, "goto inside given and when to the given stmt"); +} + +# test with unreified @_ in smart match [perl #71078] +sub unreified_check { ok([@_] ~~ \@_) } # should always match +unreified_check(1,2,"lala"); +unreified_check(1,2,undef); +unreified_check(undef); +unreified_check(undef,""); + +# Test do { given } as a rvalue + +{ + # Simple scalar + my $lexical = 5; + my @things = (11 .. 26); # 16 elements + my @exp = (5, 16, 9); + no warnings 'void'; + for (0, 1, 2) { + my $scalar = do { given ($_) { + when (0) { $lexical } + when (2) { 'void'; 8, 9 } + @things; + } }; + is($scalar, shift(@exp), "rvalue given - simple scalar [$_]"); + } +} +{ + # Postfix scalar + my $lexical = 5; + my @exp = (5, 7, 9); + for (0, 1, 2) { + no warnings 'void'; + my $scalar = do { given ($_) { + $lexical when 0; + 8, 9 when 2; + 6, 7; + } }; + is($scalar, shift(@exp), "rvalue given - postfix scalar [$_]"); + } +} +{ + # Default scalar + my @exp = (5, 9, 9); + for (0, 1, 2) { + my $scalar = do { given ($_) { + no warnings 'void'; + when (0) { 5 } + default { 8, 9 } + 6, 7; + } }; + is($scalar, shift(@exp), "rvalue given - default scalar [$_]"); + } +} +{ + # Simple list + my @things = (11 .. 13); + my @exp = ('3 4 5', '11 12 13', '8 9'); + for (0, 1, 2) { + my @list = do { given ($_) { + when (0) { 3 .. 5 } + when (2) { my $fake = 'void'; 8, 9 } + @things; + } }; + is("@list", shift(@exp), "rvalue given - simple list [$_]"); + } +} +{ + # Postfix list + my @things = (12); + my @exp = ('3 4 5', '6 7', '12'); + for (0, 1, 2) { + my @list = do { given ($_) { + 3 .. 5 when 0; + @things when 2; + 6, 7; + } }; + is("@list", shift(@exp), "rvalue given - postfix list [$_]"); + } +} +{ + # Default list + my @things = (11 .. 20); # 10 elements + my @exp = ('m o o', '8 10', '8 10'); + for (0, 1, 2) { + my @list = do { given ($_) { + when (0) { "moo" =~ /(.)/g } + default { 8, scalar(@things) } + 6, 7; + } }; + is("@list", shift(@exp), "rvalue given - default list [$_]"); + } +} +{ + # Switch control + my @exp = ('6 7', '', '6 7'); + for (0, 1, 2, 3) { + my @list = do { given ($_) { + continue when $_ <= 1; + break when 1; + next when 2; + 6, 7; + } }; + is("@list", shift(@exp), "rvalue given - default list [$_]"); + } +} +{ + # Context propagation + my $smart_hash = sub { + do { given ($_[0]) { + 'undef' when undef; + when ([ 1 .. 3 ]) { 1 .. 3 } + when (4) { my $fake; do { 4, 5 } } + } }; + }; + + my $scalar; + + $scalar = $smart_hash->(); + is($scalar, 'undef', "rvalue given - scalar context propagation [undef]"); + + $scalar = $smart_hash->(4); + is($scalar, 5, "rvalue given - scalar context propagation [4]"); + + $scalar = $smart_hash->(999); + is($scalar, undef, "rvalue given - scalar context propagation [999]"); + + my @list; + + @list = $smart_hash->(); + is("@list", 'undef', "rvalue given - list context propagation [undef]"); + + @list = $smart_hash->(2); + is("@list", '1 2 3', "rvalue given - list context propagation [2]"); + + @list = $smart_hash->(4); + is("@list", '4 5', "rvalue given - list context propagation [4]"); + + @list = $smart_hash->(999); + is("@list", '', "rvalue given - list context propagation [999]"); +} +{ + # Array slices + my @list = 10 .. 15; + my @in_list; + my @in_slice; + for (5, 10, 15) { + given ($_) { + when (@list) { + push @in_list, $_; + continue; + } + when (@list[0..2]) { + push @in_slice, $_; + } + } + } + is("@in_list", "10 15", "when(array)"); + is("@in_slice", "10", "when(array slice)"); +} +{ + # Hash slices + my %list = map { $_ => $_ } "a" .. "f"; + my @in_list; + my @in_slice; + for ("a", "e", "i") { + given ($_) { + when (%list) { + push @in_list, $_; + continue; + } + when (@list{"a".."c"}) { + push @in_slice, $_; + } + } + } + is("@in_list", "a e", "when(hash)"); + is("@in_slice", "a", "when(hash slice)"); +} + +{ # RT#84526 - Handle magical TARG + my $x = my $y = "aaa"; + for ($x, $y) { + given ($_) { + is(pos, undef, "handle magical TARG"); + pos = 1; + } + } +} + +# Test that returned values are correctly propagated through several context +# levels (see RT #93548). +{ + my $tester = sub { + my $id = shift; + + package fmurrr; + + our ($when_loc, $given_loc, $ext_loc); + + my $ext_lex = 7; + our $ext_glob = 8; + local $ext_loc = 9; + + given ($id) { + my $given_lex = 4; + our $given_glob = 5; + local $given_loc = 6; + + when (0) { 0 } + + when (1) { my $when_lex = 1 } + when (2) { our $when_glob = 2 } + when (3) { local $when_loc = 3 } + + when (4) { $given_lex } + when (5) { $given_glob } + when (6) { $given_loc } + + when (7) { $ext_lex } + when (8) { $ext_glob } + when (9) { $ext_loc } + + 'fallback'; + } + }; + + my @descriptions = qw< + constant + + when-lexical + when-global + when-local + + given-lexical + given-global + given-local + + extern-lexical + extern-global + extern-local + >; + + for my $id (0 .. 9) { + my $desc = $descriptions[$id]; + + my $res = $tester->($id); + is $res, $id, "plain call - $desc"; + + $res = do { + my $id_plus_1 = $id + 1; + given ($id_plus_1) { + do { + when (/\d/) { + --$id_plus_1; + continue; + 456; + } + }; + default { + $tester->($id_plus_1); + } + 'XXX'; + } + }; + is $res, $id, "across continue and default - $desc"; + } +} + +# Check that values returned from given/when are destroyed at the right time. +{ + { + package Fmurrr; + + sub new { + bless { + flag => \($_[1]), + id => $_[2], + }, $_[0] + } + + sub DESTROY { + ${$_[0]->{flag}}++; + } + } + + my @descriptions = qw< + when + break + continue + default + >; + + for my $id (0 .. 3) { + my $desc = $descriptions[$id]; + + my $destroyed = 0; + my $res_id; + + { + my $res = do { + given ($id) { + my $x; + when (0) { Fmurrr->new($destroyed, 0) } + when (1) { my $y = Fmurrr->new($destroyed, 1); break } + when (2) { $x = Fmurrr->new($destroyed, 2); continue } + when (2) { $x } + default { Fmurrr->new($destroyed, 3) } + } + }; + $res_id = $res->{id}; + } + $res_id = $id if $id == 1; # break doesn't return anything + + is $res_id, $id, "given/when returns the right object - $desc"; + is $destroyed, 1, "given/when does not leak - $desc"; + }; +} + +# break() must reset the stack +{ + my @res = (1, do { + given ("x") { + 2, 3, do { + when (/[a-z]/) { + 4, 5, 6, break + } + } + } + }); + is "@res", "1", "break resets the stack"; +} + +# RT #94682: +# must ensure $_ is initialised and cleared at start/end of given block + +{ + package RT94682; + + my $d = 0; + sub DESTROY { $d++ }; + + sub f2 { + local $_ = 5; + given(bless [7]) { + ::is($_->[0], 7, "is [7]"); + } + ::is($_, 5, "is 5"); + ::is($d, 1, "DESTROY called once"); + } + f2(); +} + +# check that 'when' handles all 'for' loop types + +{ + my $i; + + $i = 0; + for (1..3) { + when (1) {$i += 1 } + when (2) {$i += 10 } + when (3) {$i += 100 } + default { $i += 1000 } + } + is($i, 111, "when in for 1..3"); + + $i = 0; + for ('a'..'c') { + when ('a') {$i += 1 } + when ('b') {$i += 10 } + when ('c') {$i += 100 } + default { $i += 1000 } + } + is($i, 111, "when in for a..c"); + + $i = 0; + for (1,2,3) { + when (1) {$i += 1 } + when (2) {$i += 10 } + when (3) {$i += 100 } + default { $i += 1000 } + } + is($i, 111, "when in for 1,2,3"); + + $i = 0; + my @a = (1,2,3); + for (@a) { + when (1) {$i += 1 } + when (2) {$i += 10 } + when (3) {$i += 100 } + default { $i += 1000 } + } + is($i, 111, 'when in for @a'); +} + +given("xyz") { + no warnings "void"; + my @a = (qw(a b c), do { when(/abc/) { qw(x y) } }, qw(d e f)); + is join(",", map { $_ // "u" } @a), "a,b,c,d,e,f", + "list value of false when"; + @a = (qw(a b c), scalar do { when(/abc/) { qw(x y) } }, qw(d e f)); + is join(",", map { $_ // "u" } @a), "a,b,c,u,d,e,f", + "scalar value of false when"; +} + +# RT #133368 +# index() and rindex() comparisons such as '> -1' are optimised away. Make +# sure that they're still treated as a direct boolean expression rather +# than when(X) being implicitly converted to when($_ ~~ X) + +{ + my $s = "abc"; + my $ok = 0; + given("xyz") { + when (index($s, 'a') > -1) { $ok = 1; } + } + ok($ok, "RT #133368 index"); + + $ok = 0; + given("xyz") { + when (rindex($s, 'a') > -1) { $ok = 1; } + } + ok($ok, "RT #133368 rindex"); +} + + +# Okay, that'll do for now. The intricacies of the smartmatch +# semantics are tested in t/op/smartmatch.t. Taintedness of +# returned values is checked in t/op/taint.t. +__END__ diff --git a/t/op/taint.t b/t/op/taint.t index a884a3e47721..daeb164efafe 100644 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -25,7 +25,7 @@ if ($NoTaintSupport) { exit 0; } -plan tests => 1059; +plan tests => 1065; $| = 1; @@ -2440,6 +2440,32 @@ EOF is_tainted $dest, "ucfirst(tainted) taints its return value"; } +{ + # Taintedness of values returned from given() + use feature 'switch'; + no warnings 'experimental::smartmatch'; + + my @descriptions = ('when', 'given end', 'default'); + + for (qw) { + my $letter = "$_$TAINT"; + + my $desc = "tainted value returned from " . shift(@descriptions); + + my $res = do { + no warnings 'deprecated'; + given ($_) { + when ('x') { $letter } + when ('y') { goto leavegiven } + default { $letter } + leavegiven: $letter + } + }; + is $res, $letter, "$desc is correct"; + is_tainted $res, "$desc stays tainted"; + } +} + # tainted constants and index() # RT 64804; http://bugs.debian.org/291450 diff --git a/toke.c b/toke.c index 0dd398356ee8..54bda355beb7 100644 --- a/toke.c +++ b/toke.c @@ -446,10 +446,12 @@ static struct debug_tokens { DEBUG_TOKEN (IVAL, KW_CATCH), DEBUG_TOKEN (IVAL, KW_CLASS), DEBUG_TOKEN (IVAL, KW_CONTINUE), + DEBUG_TOKEN (IVAL, KW_DEFAULT), DEBUG_TOKEN (IVAL, KW_DO), DEBUG_TOKEN (IVAL, KW_ELSE), DEBUG_TOKEN (IVAL, KW_ELSIF), DEBUG_TOKEN (IVAL, KW_FIELD), + DEBUG_TOKEN (IVAL, KW_GIVEN), DEBUG_TOKEN (IVAL, KW_FOR), DEBUG_TOKEN (IVAL, KW_FORMAT), DEBUG_TOKEN (IVAL, KW_IF), @@ -467,6 +469,7 @@ static struct debug_tokens { DEBUG_TOKEN (IVAL, KW_USE_or_NO), DEBUG_TOKEN (IVAL, KW_UNLESS), DEBUG_TOKEN (IVAL, KW_UNTIL), + DEBUG_TOKEN (IVAL, KW_WHEN), DEBUG_TOKEN (IVAL, KW_WHILE), DEBUG_TOKEN (OPVAL, LABEL), DEBUG_TOKEN (OPNUM, LOOPEX), @@ -7997,6 +8000,9 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct case KEY_bless: LOP(OP_BLESS,XTERM); + case KEY_break: + FUN0(OP_BREAK); + case KEY_catch: PREBLOCK(KW_CATCH); @@ -8014,7 +8020,16 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct TOKEN(KW_CLASS); case KEY_continue: - PREBLOCK(KW_CONTINUE); + /* We have to disambiguate the two senses of + "continue". If the next token is a '{' then + treat it as the start of a continue block; + otherwise treat it as a control operator. + */ + s = skipspace(s); + if (*s == '{') + PREBLOCK(KW_CONTINUE); + else + FUN0(OP_CONTINUE); case KEY_chdir: /* may use HOME */ @@ -8057,6 +8072,9 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct case KEY_chroot: UNI(OP_CHROOT); + case KEY_default: + PREBLOCK(KW_DEFAULT); + case KEY_defer: Perl_ck_warner_d(aTHX_ packWARN(WARN_EXPERIMENTAL__DEFER), "defer is experimental"); @@ -8290,6 +8308,12 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct case KEY_getlogin: FUN0(OP_GETLOGIN); + case KEY_given: + pl_yylval.ival = CopLINE(PL_curcop); + Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED__SMARTMATCH), + "given is deprecated"); + OPERATOR(KW_GIVEN); + case KEY_glob: LOP( orig_keyword==KEY_glob ? -OP_GLOB : OP_GLOB, XTERM ); @@ -8793,6 +8817,15 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct case KEY_vec: LOP(OP_VEC,XTERM); + case KEY_when: + if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_NONEXPR) + return REPORT(0); + pl_yylval.ival = CopLINE(PL_curcop); + Perl_ck_warner_d(aTHX_ + packWARN(WARN_DEPRECATED__SMARTMATCH), + "when is deprecated"); + OPERATOR(KW_WHEN); + case KEY_while: if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_NONEXPR) return REPORT(0);