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

Classify ambiguous syntax #121

Open
OverHash opened this issue Dec 30, 2020 · 0 comments
Open

Classify ambiguous syntax #121

OverHash opened this issue Dec 30, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@OverHash
Copy link

In Lua (and Luau) users may write code like the following:

local myVar = workspace.Part.CFrame

(workspace.Part).Touched:Connect(function()
	print(myVar)
end)

This should be classified as ambiguous syntax, as the parser will identify workspace.Part.CFrame as a function as we then call it on the following line. full-moon should classify this as ambiguous syntax as the programmer probably wanted to assign workspace.Part.CFrame to myVar and then listen to workspace.Part.Touched, using myVar inside the callback function.

Other linters such as Roblox Studio's linter will give a useful warning message:
image

And Roblox LSP will suggest to add a semicolon to make the parser identify what you want to do
image

@Kampfkarren Kampfkarren added the enhancement New feature or request label Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants