Ticket #466: pct-complex.patch
File pct-complex.patch, 1.5 KB (added by bsdz, 13 years ago) |
---|
-
compilers/pct/src/PAST/Compiler.pir
91 91 valflags['String'] = 's~*:e' 92 92 valflags['Integer'] = 'i+*:' 93 93 valflags['Float'] = 'n+*:' 94 valflags['Complex'] = 's~*:e' 94 95 set_global '%valflags', valflags 95 96 96 97 ## %!controltypes holds the list of exception types for each -
t/compilers/pct/complete_workflow.t
8 8 9 9 use Test::More; 10 10 11 use Parrot::Test tests => 6* 9;11 use Parrot::Test tests => 7 * 9; 12 12 use Parrot::Test::Util 'create_tempfile'; 13 13 use Parrot::Config qw(%PConfig); 14 14 … … 32 32 33 33 { 34 34 test_pct( 'sanity', <<'IN', <<'GRAMMAR', <<'ACTIONS', <<'OUT' ); 35 10i 36 IN 37 token TOP { '10i' {*} } 38 GRAMMAR 39 40 method 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 } 53 ACTIONS 54 0+10i 55 OUT 56 } 57 58 { 59 test_pct( 'sanity', <<'IN', <<'GRAMMAR', <<'ACTIONS', <<'OUT' ); 35 60 thingy 36 61 IN 37 62 token TOP { 'thingy' {*} }