-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Now every node that should have a block has a SAST::Block - Stop auto optimizing empty SAST:Block to a SAST::Nop - SAST::If now hides its `else` from the composer and walks them top down (manually) The end result is that we can properly inline things like: my Pkg $nc = given $*os { when Debian { 'netcat' } when RHEL { 'nc' } default { 'nc' } }; To just (in the shell): nc=netcat
- Loading branch information
Showing
5 changed files
with
61 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
use Test; | ||
use Spit::Compile; | ||
|
||
plan 1; | ||
plan 2; | ||
|
||
ok compile(name => "Cmd || Cmd",Q{ my $a = Cmd<printf> || Cmd<echo> || Cmd<true> }). | ||
contains('exists printf'&'exists echo'), "Cmd junction always looks like exists cmd ||"; | ||
|
||
ok compile(name => "given inline", Q{ | ||
my Pkg $nc = given $*os { | ||
when Debian { 'netcat' } | ||
when RHEL { 'nc' } | ||
default { 'nc' } | ||
}; | ||
note $nc; | ||
}).contains('nc=netcat'), 'given block completely inline away'; |