mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-07-01 23:30:21 +02:00
Fixed lua pattern error interpreting () incorrectly
...Well, that was stupid.
This commit is contained in:
@ -398,14 +398,14 @@ local function lexLua(code)
|
|||||||
return nil --unfinished string
|
return nil --unfinished string
|
||||||
end
|
end
|
||||||
function lexElements.blockcomment(str)
|
function lexElements.blockcomment(str)
|
||||||
local a=str:match("^--%[%[")
|
local a=str:match("^%-%-%[%[")
|
||||||
if not a then return nil end
|
if not a then return nil end
|
||||||
local s=str:find("--%]%]")
|
local s=str:find("%-%-%]%]")
|
||||||
if not s then return nil end
|
if not s then return nil end
|
||||||
return str:sub(1,s+3)
|
return str:sub(1,s+3)
|
||||||
end
|
end
|
||||||
function lexElements.linecomment(str)
|
function lexElements.linecomment(str)
|
||||||
return str:match("^--[^\r\n]+")
|
return str:match("^%-%-[^\r\n]+")
|
||||||
end
|
end
|
||||||
local lexElementsOrder={"keyword","whitespace","string","blockcomment","linecomment","cleanup"}
|
local lexElementsOrder={"keyword","whitespace","string","blockcomment","linecomment","cleanup"}
|
||||||
local lexResults={}
|
local lexResults={}
|
||||||
@ -470,6 +470,7 @@ local function code_prohibited(code)
|
|||||||
end
|
end
|
||||||
rcode=rcode..v[2]
|
rcode=rcode..v[2]
|
||||||
end
|
end
|
||||||
|
print(rcode)
|
||||||
return rcode
|
return rcode
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user