[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Can goto target a variable string label? If so, syntax?
- From: Craig Barnes <craigbarnes85@...>
- Date: Sun, 24 Nov 2013 01:29:48 +0000
On 24 November 2013 01:11, Paul Merrell <firstname.lastname@example.org> wrote:
> ... thus far, I have been unable to persuade goto to
> accept a string variable as the target label. I get a missing name
> error for the variable label's name. Is this a known limitation or is
> there some way to write something like:
The goto statement takes a name, rather than an expression. It gets
compiled as a JMP to a bytecode offset, so there's no way to use
$ luac -l -p - <<< 'goto label ::label::'
main <stdin:0,0> (2 instructions at 0x8cd2970)
0+ params, 2 slots, 1 upvalue, 0 locals, 0 constants, 0 functions
1  JMP 0 0 ; to 2
2  RETURN 0 1