Created
July 23, 2011 16:07
-
-
Save Whiteknight/1101588 to your computer and use it in GitHub Desktop.
Current behavior in whiteknight/imcc_tag branch
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
<parrot git:whiteknight/imcc_tag> ./parrot test.pir | |
a | |
Foo | |
Bar | |
b | |
Foo | |
c | |
Bar |
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
.sub 'foo' :tag("a", "b") | |
say "Foo" | |
.end | |
.sub 'bar' :tag("a", "c") | |
say "Bar" | |
.end | |
.sub 'main' :main | |
$P0 = getinterp | |
$P1 = $P0["packfile"] | |
say "a" | |
$P2 = $P1.'subs_by_flag'("a") | |
'say_all'($P2) | |
say "\nb" | |
$P2 = $P1.'subs_by_flag'("b") | |
'say_all'($P2) | |
say "\nc" | |
$P2 = $P1.'subs_by_flag'("c") | |
'say_all'($P2) | |
.end | |
.sub 'say_all' | |
.param pmc subs | |
$P3 = iter subs | |
a_loop_top: | |
unless $P3 goto a_loop_end | |
$P4 = shift $P3 | |
$P4() | |
goto a_loop_top | |
a_loop_end: | |
.end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment