From 5f8dedf9b02a7752febc52cef6b2b1e1332272d7 Mon Sep 17 00:00:00 2001 From: Vasily Chekalkin Date: Sun, 9 Jan 2011 00:21:32 +1100 Subject: [PATCH] Reduce syntax noice - use postfix for. --- src/POST/Compiler.pm | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/POST/Compiler.pm b/src/POST/Compiler.pm index fbcb2d0..c32ecfc 100644 --- a/src/POST/Compiler.pm +++ b/src/POST/Compiler.pm @@ -30,9 +30,7 @@ method pbc($post, %adverbs) { # PCC call handling. self.enumerate_subs($post, %context); - for @($post) -> $s { - self.to_pbc($s, %context); - } + self.to_pbc($_, %context) for @($post); %context; }; @@ -78,9 +76,7 @@ our multi method to_pbc(POST::Sub $sub, %context) { } # Emit ops. - for @($sub) { - self.to_pbc($_, %context); - } + self.to_pbc($_, %context) for @($sub); self.debug("Middle { +$bc }") if %context; @@ -169,18 +165,15 @@ our multi method to_pbc(POST::Op $op, %context) { %context := $fullname; my @op := list($fullname); - for @($op) { - @op.push(self.to_op($_, %context)); - } + @op.push(self.to_op($_, %context)) for @($op); + self.debug("Op size { +@op }") if %context; %context.push(@op); } # Some PIR sugar produces nested Nodes. our multi method to_pbc(POST::Node $node, %context) { - for @($node) { - self.to_pbc($_, %context); - } + self.to_pbc($_, %context) for @($node); } our multi method to_pbc(POST::Label $l, %context) { @@ -192,9 +185,7 @@ our multi method to_pbc(POST::Label $l, %context) { # Declaration of Label. Update offset in Sub.labels. $l.position($pos); # We can have "enclosed" ops. Process them now. - for @($l) { - self.to_pbc($_, %context); - } + self.to_pbc($_, %context) for @($l); } our multi method to_pbc(POST::Call $call, %context) { @@ -620,9 +611,7 @@ our method get_register($name, %context) { } method debug(*@args) { - for @args { - pir::say($_); - } + pir::say($_) for @args; } our method create_context($past, %adverbs) {