Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goto doesn't work #509

Open
2 tasks
ArcherSean opened this issue Nov 7, 2024 · 3 comments
Open
2 tasks

goto doesn't work #509

ArcherSean opened this issue Nov 7, 2024 · 3 comments

Comments

@ArcherSean
Copy link

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

  • GopherLua is a Lua5.1 implementation. You should be familiar with Lua programming language. Have you read Lua 5.1 reference manual carefully?
  • GopherLua is a Lua5.1 implementation. In Lua, to keep it simple, it is more important to remove functionalities rather than to add functionalities unlike other languages . If you are going to introduce some new cool functionalities into the GopherLua code base and the functionalities can be implemented by existing APIs, It should be implemented as a library.

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
Copy link
Author

ArcherSean commented Nov 7, 2024

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?

@xkisu
Copy link

xkisu commented Nov 10, 2024

I believe it's not supported, as this library is a Lua 5.1 implementation and goto was added in 5.2

@ArcherSean
Copy link
Author

I believe it's not supported, as this library is a Lua 5.1 implementation and goto was added in 5.2

But in the version v1.1.0, gopher-lua has supported goto
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants