full-moon
full-moon copied to clipboard
Classify ambiguous syntax
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:

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