Ticket #1207: PCA-patch-006.patch
File PCA-patch-006.patch, 2.5 KB (added by Paul C. Anagnostopoulos, 11 years ago) |
---|
-
DEPRECATED.pod
206 206 207 207 L<https://trac.parrot.org/parrot/ticket/1565> 208 208 209 =item find_lex [eligible in 2.4]210 211 find_lex will not throw exception for non-existing lexicals.212 213 L<https://trac.parrot.org/parrot/ticket/1207>214 215 209 =item inplace string updates. [eligible in 2.4] 216 210 217 211 All "inplace" string update ops are deprecated. E.g. "chopn_s", etc. … … 251 245 252 246 =item errorson, errorsoff operations [eligible in 2.7] 253 247 254 The C<.PARROT_ERRORS_GLOBAL _FLAG> flag will be eliminated. It is not used by Parrot.248 The C<.PARROT_ERRORS_GLOBALS_FLAG> flag will be eliminated. It is not used by Parrot. 255 249 256 250 =back 257 251 -
src/ops/var.ops
86 86 87 87 =item B<find_lex>(out PMC, in STR) 88 88 89 Find the lexical variable named $2 and store it in $1. This 90 opcode either throws an exception or returns a Null PMC for the failure case, 91 depending on the implementation of the LexPad PMC. Parrot's 92 standard LexPad throws an exception for non-existent names. 89 Find the lexical variable named $2 and store it in $1. Return a 90 Null PMC if the variable is not found. 93 91 94 92 =cut 95 93 … … 100 98 101 99 PMC * const result = 102 100 PMC_IS_NULL(lex_pad) 103 ? NULL101 ? PMCNULL 104 102 : VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name); 105 if (!result) {106 opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,107 EXCEPTION_LEX_NOT_FOUND,108 "Lexical '%Ss' not found", lex_name);109 goto ADDRESS(handler);110 }111 103 $1 = result; 112 104 } 113 105 -
t/op/lexicals.t
840 840 /Null PMC access/ 841 841 OUT 842 842 843 pir_ error_output_like( <<'CODE', <<'OUTPUT', 'get non existing' );843 pir_output_is( <<'CODE', <<'OUTPUT', 'get undefined lexical' ); 844 844 .sub "main" :main 845 845 .lex 'a', $P0 846 846 foo() … … 852 852 .sub bar :outer('foo') 853 853 .lex 'c', $P0 854 854 $P2 = find_lex 'no_such' 855 if null $P2 goto ok 856 print "Undefined name not NULL\n" 857 end 858 ok: 859 print "ok\n" 855 860 .end 856 861 CODE 857 /Lexical 'no_such' not found/ 862 ok 858 863 OUTPUT 859 864 860 865 pir_output_is( <<'CODE', <<'OUTPUT', 'find_name on lexicals' );