Ticket #466: pct-complex.patch

File pct-complex.patch, 1.5 KB (added by bsdz, 13 years ago)

New patch with test case included for PCT PAST compiler.

  • compilers/pct/src/PAST/Compiler.pir

     
    9191    valflags['String']   = 's~*:e' 
    9292    valflags['Integer']  = 'i+*:' 
    9393    valflags['Float']    = 'n+*:' 
     94    valflags['Complex']   = 's~*:e' 
    9495    set_global '%valflags', valflags 
    9596 
    9697    ##  %!controltypes holds the list of exception types for each 
  • t/compilers/pct/complete_workflow.t

     
    88 
    99use Test::More; 
    1010 
    11 use Parrot::Test tests => 6 * 9; 
     11use Parrot::Test tests => 7 * 9; 
    1212use Parrot::Test::Util 'create_tempfile'; 
    1313use Parrot::Config qw(%PConfig); 
    1414 
     
    3232 
    3333{ 
    3434    test_pct( 'sanity', <<'IN', <<'GRAMMAR', <<'ACTIONS', <<'OUT' ); 
     3510i 
     36IN 
     37token TOP   { '10i' {*} } 
     38GRAMMAR 
     39 
     40method TOP($/) { 
     41    my $past  := PAST::Stmts.new( 
     42                     PAST::Op.new( 
     43                         PAST::Val.new( 
     44                             :value( ~$/ ), 
     45                             :returns('Complex') 
     46                         ), 
     47                         :pirop('say'), 
     48                     ) 
     49                 ); 
     50 
     51    make $past; 
     52} 
     53ACTIONS 
     540+10i 
     55OUT 
     56} 
     57 
     58{ 
     59    test_pct( 'sanity', <<'IN', <<'GRAMMAR', <<'ACTIONS', <<'OUT' ); 
    3560thingy 
    3661IN 
    3762token TOP   { 'thingy' {*} }