1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 17:59:30 +00:00

Updated to latest LPegLabel (fix error messages), Candran 0.6.2

This commit is contained in:
Étienne Fildadut 2018-08-08 16:48:31 +02:00
parent debf0bc464
commit 270fb5e845
5 changed files with 16 additions and 18 deletions

View file

@ -10,7 +10,7 @@
#import("lib.lua-parser.parser") #import("lib.lua-parser.parser")
local candran = { local candran = {
VERSION = "0.6.0" VERSION = "0.6.2"
} }
--- Default options. --- Default options.

View file

@ -2894,19 +2894,18 @@ local errorinfo = { -- ./lib/lua-parser/parser.lua:675
["filename"] = filename -- ./lib/lua-parser/parser.lua:675 ["filename"] = filename -- ./lib/lua-parser/parser.lua:675
} -- ./lib/lua-parser/parser.lua:675 } -- ./lib/lua-parser/parser.lua:675
lpeg["setmaxstack"](1000) -- ./lib/lua-parser/parser.lua:676 lpeg["setmaxstack"](1000) -- ./lib/lua-parser/parser.lua:676
local ast, label, sfail = lpeg["match"](G, subject, nil, errorinfo) -- ./lib/lua-parser/parser.lua:677 local ast, label, errpos = lpeg["match"](G, subject, nil, errorinfo) -- ./lib/lua-parser/parser.lua:677
if not ast then -- ./lib/lua-parser/parser.lua:678 if not ast then -- ./lib/lua-parser/parser.lua:678
local errpos = # subject - # sfail + 1 -- ./lib/lua-parser/parser.lua:679 local errmsg = labels[label][2] -- ./lib/lua-parser/parser.lua:679
local errmsg = labels[label][2] -- ./lib/lua-parser/parser.lua:680 return ast, syntaxerror(errorinfo, errpos, errmsg) -- ./lib/lua-parser/parser.lua:680
return ast, syntaxerror(errorinfo, errpos, errmsg) -- ./lib/lua-parser/parser.lua:681 end -- ./lib/lua-parser/parser.lua:680
end -- ./lib/lua-parser/parser.lua:681 return validate(ast, errorinfo) -- ./lib/lua-parser/parser.lua:682
return validate(ast, errorinfo) -- ./lib/lua-parser/parser.lua:683 end -- ./lib/lua-parser/parser.lua:682
end -- ./lib/lua-parser/parser.lua:683 return parser -- ./lib/lua-parser/parser.lua:685
return parser -- ./lib/lua-parser/parser.lua:686 end -- ./lib/lua-parser/parser.lua:685
end -- ./lib/lua-parser/parser.lua:686 local parser = _() or parser -- ./lib/lua-parser/parser.lua:689
local parser = _() or parser -- ./lib/lua-parser/parser.lua:690 package["loaded"]["lib.lua-parser.parser"] = parser or true -- ./lib/lua-parser/parser.lua:690
package["loaded"]["lib.lua-parser.parser"] = parser or true -- ./lib/lua-parser/parser.lua:691 local candran = { ["VERSION"] = "0.6.2" } -- candran.can:13
local candran = { ["VERSION"] = "0.6.0" } -- candran.can:13
candran["default"] = { -- candran.can:17 candran["default"] = { -- candran.can:17
["target"] = "lua53", -- candran.can:18 ["target"] = "lua53", -- candran.can:18
["indentation"] = "", -- candran.can:19 ["indentation"] = "", -- candran.can:19

View file

@ -674,9 +674,8 @@ local syntaxerror = validator.syntaxerror
function parser.parse (subject, filename) function parser.parse (subject, filename)
local errorinfo = { subject = subject, filename = filename } local errorinfo = { subject = subject, filename = filename }
lpeg.setmaxstack(1000) lpeg.setmaxstack(1000)
local ast, label, sfail = lpeg.match(G, subject, nil, errorinfo) local ast, label, errpos = lpeg.match(G, subject, nil, errorinfo)
if not ast then if not ast then
local errpos = #subject-#sfail+1
local errmsg = labels[label][2] local errmsg = labels[label][2]
return ast, syntaxerror(errorinfo, errpos, errmsg) return ast, syntaxerror(errorinfo, errpos, errmsg)
end end

View file

@ -17,12 +17,12 @@ description = {
source = { source = {
url = "git://github.com/Reuh/candran", url = "git://github.com/Reuh/candran",
tag = "v0.6.1" tag = "v0.6.2"
} }
dependencies = { dependencies = {
"lua >= 5.1", "lua >= 5.1",
"lpeglabel >= 1.0.0" "lpeglabel >= 1.5.0"
} }
build = { build = {

View file

@ -21,7 +21,7 @@ source = {
dependencies = { dependencies = {
"lua >= 5.1", "lua >= 5.1",
"lpeglabel >= 1.0.0" "lpeglabel >= 1.5.0"
} }
build = { build = {