yuin / gopher-lua

GopherLua: VM and compiler for Lua in Go
MIT License
6.28k stars 652 forks source link

goto doesn't work #509

Open ArcherSean opened 17 hours ago

ArcherSean commented 17 hours ago

You must post issues only here. Questions, ideas must be posted in discussions.

Please answer the following before submitting your issue:

  1. What version of GopherLua are you using? : v1.1.1
  2. What version of Go are you using? : 1.21
  3. What operating system and processor architecture are you using? :MacOS/ARM
  4. What did you do? :use goto and ::label::
  5. What did you expect to see? : 'goto' will jump to ::label::
  6. What did you see instead? :syntax error
ArcherSean commented 17 hours ago

Hi there, I met a problem when I use 'goto' in gopher-lua v1.1.1. When I use goto like this

for i = 1, #backupSource do
     if i == 2 then
        goto continue
    end
    ::continue::
end

It get error: near '::': syntax error Is there something wrong with how I used it?