Skip to content

Instantly share code, notes, and snippets.

@Whiteknight
Created July 23, 2011 16:07
Show Gist options
  • Save Whiteknight/1101588 to your computer and use it in GitHub Desktop.
Save Whiteknight/1101588 to your computer and use it in GitHub Desktop.
Current behavior in whiteknight/imcc_tag branch
<parrot git:whiteknight/imcc_tag> ./parrot test.pir
a
Foo
Bar
b
Foo
c
Bar
.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