Ticket #1207: PCA-patch-006.patch

File PCA-patch-006.patch, 2.5 KB (added by Paul C. Anagnostopoulos, 4 years ago)
  • DEPRECATED.pod

     
    206206 
    207207L<https://trac.parrot.org/parrot/ticket/1565> 
    208208 
    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  
    215209=item inplace string updates. [eligible in 2.4] 
    216210 
    217211All "inplace" string update ops are deprecated. E.g. "chopn_s", etc. 
     
    251245 
    252246=item errorson, errorsoff operations [eligible in 2.7] 
    253247 
    254 The C<.PARROT_ERRORS_GLOBAL_FLAG> flag will be eliminated. It is not used by Parrot. 
     248The C<.PARROT_ERRORS_GLOBALS_FLAG> flag will be eliminated. It is not used by Parrot. 
    255249 
    256250=back 
    257251 
  • src/ops/var.ops

     
    8686 
    8787=item B<find_lex>(out PMC, in STR) 
    8888 
    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. 
     89Find the lexical variable named $2 and store it in $1. Return a 
     90Null PMC if the variable is not found. 
    9391 
    9492=cut 
    9593 
     
    10098 
    10199    PMC * const result = 
    102100        PMC_IS_NULL(lex_pad) 
    103             ? NULL 
     101            ? PMCNULL 
    104102            : 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     } 
    111103    $1 = result; 
    112104} 
    113105 
  • t/op/lexicals.t

     
    840840/Null PMC access/ 
    841841OUT 
    842842 
    843 pir_error_output_like( <<'CODE', <<'OUTPUT', 'get non existing' ); 
     843pir_output_is( <<'CODE', <<'OUTPUT', 'get undefined lexical' ); 
    844844.sub "main" :main 
    845845    .lex 'a', $P0 
    846846    foo() 
     
    852852.sub bar   :outer('foo') 
    853853    .lex 'c', $P0 
    854854    $P2 = find_lex 'no_such' 
     855    if null $P2 goto ok 
     856    print "Undefined name not NULL\n" 
     857    end 
     858ok: 
     859    print "ok\n" 
    855860.end 
    856861CODE 
    857 /Lexical 'no_such' not found/ 
     862ok 
    858863OUTPUT 
    859864 
    860865pir_output_is( <<'CODE', <<'OUTPUT', 'find_name on lexicals' );