[PDD] Add docs for the Parrot_PMC_push_* and Parrot_PMC_pop_* functions
[parrot.git] / examples / tutorial / 50_goto.pir
blobc7926055cf0488cdb78bd45c7a6c4e6cc542d3e5
1 # Copyright (C) 2007-2009, Parrot Foundation.
2 # $Id$
4 =head1
6 The unconditional jump is the simplest of all flow control devices in any
7 language, and PIR is no exception. Using the C<goto> command, control flow
8 can jump to any location with a label. Labels are named just like named
9 variables, except they have a colon C<:> at the end.
11 =cut
13 .sub main :main
15     say "before branch"
17     goto branch_to_here
18       say "never printed"
19   branch_to_here:
21     say "after branch"
23 .end
25 # Local Variables:
26 #   mode: pir
27 #   fill-column: 100
28 # End:
29 # vim: expandtab shiftwidth=4 ft=pir: