cortav  Check-in [709518a06e]

Overview
Comment:error improvements, sirsem bug fix
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 709518a06e109715aed36ad7bdbff4a6ae7b8878ae62278a27e9e69bc04213ff
User & Date: lexi on 2021-12-20 00:14:03
Other Links: manifest | tags
Context
2021-12-20
00:40
tweak headers check-in: bdd8d569a9 user: lexi tags: trunk
00:14
error improvements, sirsem bug fix check-in: 709518a06e user: lexi tags: trunk
00:09
split cortav into modules, enable use as library, create extension mechanism stub, fix up docs check-in: 9c67b0312c user: lexi tags: trunk
Changes

Modified cortav.lua from [2576638f1f] to [e2f30c819c].

   806    806   		{seq = '##', parse = insert_var_ref(true)};
   807    807   		{seq = '#', parse = insert_var_ref(false)};
   808    808   	}
   809    809   end
   810    810   
   811    811   function ct.parse_span(str,ctx)
   812    812   	local function delimited(start, stop, s)
   813         -		-- local r = { pcall(ss.str.delimit, 'utf8', start, stop, s) }
   814         -		-- if r[1] then return table.unpack(r, 2) end
   815         -		-- ctx:fail(tostring(e))
   816         -		return ss.str.delimit(ss.str.enc.utf8, start, stop, s)
          813  +		local r = { pcall(ss.str.delimit, nil, start, stop, s) }
          814  +		if r[1] then return table.unpack(r, 2) end
          815  +		ctx:fail(tostring(r[2]))
   817    816   	end
   818    817   	local buf = ""
   819    818   	local spans = {}
   820    819   	local function flush()
   821    820   		if buf ~= "" then
   822    821   			table.insert(spans, buf)
   823    822   			buf = ""

Modified sirsem.lua from [2492fec6e5] to [a1f6282434].

   261    261   		elseif c == start then
   262    262   			depth = depth + 1
   263    263   		elseif c == stop then
   264    264   			depth = depth - 1
   265    265   			if depth == 0 then
   266    266   				return s:sub(1+#start, p.byte - #stop), p.byte -- FIXME
   267    267   			elseif depth < 0 then
   268         -				ss.str.exn('out of place %s', stop):throw()
          268  +				ss.str.exn('out of place token ā€œ%sā€', stop):throw()
   269    269   			end
   270    270   		end
   271    271   	end
   272    272   
   273         -	ss.str.exn('[%s] expected before end of line', stop):throw()
          273  +	ss.str.exn('token ā€œ%sā€ expected before end of line', stop):throw()
   274    274   end