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

Lexer fails to ignore multi-line string within a commented out block #191

Open
drauschenbach opened this issue Feb 27, 2019 · 3 comments
Open

Comments

@drauschenbach
Copy link

drauschenbach commented Feb 27, 2019

Given the following commented-out code:

--[[
  call_function([[
local x = 1
local y = 2
... dozens more lines
]])
--]]

LuaCheck reports:

spec.lua:237:3: (E011) expected statement near ')'

@CelticMinstrel
Copy link

I think this is correct, actually. You should add one or more = to your comment, like so:

--[=[
  call_function([[
local x = 1
local y = 2
... dozens more lines
]])
--]=]

@alerque
Copy link

alerque commented Feb 12, 2024

As @CelticMinstrel notes, if you are trying to nest block comments in Lua you should be using different = counts in the comment syntax to differentiate which starts go with which stops.

@alerque
Copy link

alerque commented Feb 12, 2024

Also per #198 this is no longer the canonical repository for this project (see https://github.com/lunarmodules/luacheck) and nobody has any ability to close issues here. Please lets try to keep things tidy so future users can better notice the relevant migration issue. I ask that you please close this issue. If something is still amiss and you have a bug or question, feel free to open a new issue on the current repository.

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

3 participants