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

Support goto statements. #224

Open
howmanysmall opened this issue Mar 29, 2021 · 16 comments
Open

Support goto statements. #224

howmanysmall opened this issue Mar 29, 2021 · 16 comments
Labels
C-enhancement Category: Feature request or improvement

Comments

@howmanysmall
Copy link

Currently Selene doesn't really like my usage of goto labels, as shown below. It'd be nice if it was supported.
image

@Kampfkarren
Copy link
Owner

Relies on a full-moon update.

@Kampfkarren Kampfkarren added the C-enhancement Category: Feature request or improvement label Apr 9, 2021
@Kampfkarren Kampfkarren linked a pull request Apr 30, 2021 that will close this issue
@Kampfkarren Kampfkarren removed a link to a pull request Apr 30, 2021
@Kampfkarren
Copy link
Owner

#229 makes this possible, though a separate PR will need to turn on lua52 feature flag.

@esatterwhite
Copy link

@Kampfkarren I'm still getting this error on 0.24.0 w/ lua52 as a base.
Is there something special that needs to be done to enable this support?

@Kampfkarren
Copy link
Owner

You need specifically a selene built with the lua52 feature flag. I'm not sure if that's available, or if that would even work.

@Kampfkarren
Copy link
Owner

It's more viable today than when this issue was first posted though

@esatterwhite
Copy link

I'd have to build one my self? do you have an example build command for this?

@Kampfkarren
Copy link
Owner

You would need to edit Cargo.toml in selene to include lua52 for full-moon

@esatterwhite
Copy link

ok. that seems to have worked. I'm not sure its entirely right.

# Cargo.toml

[workspace.dependencies]
full_moon = { version = "0.17.0", features = ["lua52"] }
#selene/Cargo.toml

[features]
default = [ "roblox", "lua52" ]
lua52 = []
tracy-profiling = ["profiling/profile-with-tracy","tracy-client"]
roblox = ["selene-lib/roblox", "full_moon/roblox", "ureq"]

@Kampfkarren
Copy link
Owner

That looks right to me, though we'd need a bit more work ourselves if we wanted to ship that.

@esatterwhite
Copy link

Is there any reason not to?

@Kampfkarren
Copy link
Owner

@JohnnyMorganz would be able to answer if the backwards incompatibilities with Lua 5.2 and Luau are problematic. There are more than zero. Ideally we want full-moon to be able to dynamically switch capabilities.

@JohnnyMorganz
Copy link
Contributor

Yup, see JohnnyMorganz/StyLua#407

@chrisgrieser
Copy link

any updates on this?

or any way to work with goto without having to build on your own, e.g. an ignore rule I may have missed in the docs?

@Kampfkarren
Copy link
Owner

Work is being done in the parser (https://github.com/Kampfkarren/full-moon) to be able to support swapping out languages easier, we can't really move forward on it until that's done. No ETA but it recently picked up more steam.

@PMassicotte
Copy link

Anyone have found a way to ignore goto parse_error?

I have tried to use this in my selene.toml without success.

std="lua52+vim"

@Kampfkarren
Copy link
Owner

This still needs a full-moon update, but everything is already merged into full-moon that makes this possible thankfully. ETA could be a week or so with dedicated effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Feature request or improvement
Projects
None yet
Development

No branches or pull requests

6 participants