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:
parent
debf0bc464
commit
270fb5e845
5 changed files with 16 additions and 18 deletions
|
|
@ -674,9 +674,8 @@ local syntaxerror = validator.syntaxerror
|
|||
function parser.parse (subject, filename)
|
||||
local errorinfo = { subject = subject, filename = filename }
|
||||
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
|
||||
local errpos = #subject-#sfail+1
|
||||
local errmsg = labels[label][2]
|
||||
return ast, syntaxerror(errorinfo, errpos, errmsg)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue