Author: pmichaud
Date: Thu Dec 18 10:16:18 2008
New Revision: 34071
Modified:
branches/main/compilers/pct/src/PAST/Compiler.pir
Log:
[pct]: Adjust interpretation of 'lexical' just a bit.
Modified: branches/main/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/main/compilers/pct/src/PAST/Compiler.pir (original)
+++ branches/main/compilers/pct/src/PAST/Compiler.pir Thu Dec 18 10:16:18 2008
@@ -59,8 +59,6 @@
piropsig['isnull'] = 'IP'
piropsig['issame'] = 'IPP'
piropsig['istrue'] = 'IP'
- piropsig['newclosure'] = 'PP'
- piropsig['n_abs'] = 'PP'
piropsig['add'] = 'PP+'
piropsig['band'] = 'PPP'
piropsig['bnot'] = 'PP'
@@ -68,10 +66,13 @@
piropsig['concat'] = 'PP~'
piropsig['div'] = 'PP+'
piropsig['fdiv'] = 'PP+'
+ piropsig['find_name'] = 'P~'
piropsig['getprop'] = 'P~P'
piropsig['mod'] = 'PP+'
piropsig['mul'] = 'PP+'
+ piropsig['n_abs'] = 'PP'
piropsig['n_neg'] = 'PP'
+ piropsig['newclosure'] = 'PP'
piropsig['not'] = 'PP'
piropsig['shl'] = 'PP+'
piropsig['shr'] = 'PP+'
@@ -785,15 +786,13 @@
## determine the outer POST::Sub for the new one
.local pmc outerpost
outerpost = get_global '$?SUB'
- $P0 = node.'lexical'()
- if $P0 goto outer_block
- null $P0
- set_global '$?SUB', $P0
- goto outer_done
- outer_block:
- bpost.'outer'(outerpost)
set_global '$?SUB', bpost
+ .local int islexical
+ islexical = node.'lexical'()
+ unless islexical goto outer_done
+ bpost.'outer'(outerpost)
+
## add block setup code (cpost) to outer block if needed
if null outerpost goto outer_done
$I0 = index pirflags, ':anon'
@@ -933,6 +932,7 @@
$P0 = get_hll_global ['POST'], 'Ops'
bpost = $P0.'new'( bpost, 'node'=>node, 'result'=>blockreg)
bpost.'push_pirop'( blockref, 'result'=>blockreg )
+ unless islexical goto block_done
bpost.'push_pirop'('capture_lex', blockreg)
goto block_done
@@ -946,7 +946,9 @@
$P0 = get_hll_global ['POST'], 'Ops'
bpost = $P0.'new'(bpost, 'node'=>node, 'result'=>result)
bpost.'push_pirop'(blockref)
+ unless islexical goto block_immediate_capture_skip
bpost.'push_pirop'('capture_lex', blockreg)
+ block_immediate_capture_skip:
bpost.'push_pirop'('call', blockreg, arglist :flat, 'result'=>result)
block_done: