JuliaLang/julia — pull request #5699 by dcjones (2014-02-06 08:38:29+00:00)
Title: Add labels and gotos. (Fixes #101)

I've taken a crack at implementing gotos.

What I've done is add new ast nodes `SymbolicLabelNode` and `SymbolicGotoNode` mirroring `LabelNode` and `GotoNode` but with symbol labels instead of integers. In `goto-form`, integer labels are assigned along with everything else, so this plays nicely with other control flow.

Rather than introducing new syntax or keywords I just made macros `@label` and `@goto`. I figured goto is (should be) used rarely enough that new syntax might not be worth it.

Now we can make local jumps to our hearts' content:
```julia
function f()
@goto a
@label c
println("they seem")
return
@label b
println("not what")
@goto c
@label a
println("things are")
@goto b
return
end
```

This is my first foray into the src directory, so there could be something I've totally overlooked.