module deduction can blow up; UTF BOM ignored
This commit is contained in:
parent
6d22818ec9
commit
68cd576bf4
|
@ -410,6 +410,7 @@ function Item:set_tag (tag,value)
|
|||
value = value[1]
|
||||
modifiers = value.modifiers
|
||||
end
|
||||
if value == nil then self:error("Tag without value: "..tag) end
|
||||
local id, rest = tools.extract_identifier(value)
|
||||
self.tags[tag] = id
|
||||
self:add_to_description(rest)
|
||||
|
|
|
@ -172,6 +172,9 @@ function lexer.scan (s,matches,filter,options)
|
|||
if file then
|
||||
s = file:read()
|
||||
if not s then return nil end -- empty file
|
||||
if s:match '^\239\187' then -- UTF-8 BOM Abomination
|
||||
s = s:sub(4)
|
||||
end
|
||||
s = s ..'\n'
|
||||
end
|
||||
local sz = #s
|
||||
|
|
|
@ -211,7 +211,7 @@ local function parse_file(fname, lang, package, args)
|
|||
else
|
||||
mod,t,v = lang:parse_module_call(tok,t,v)
|
||||
if mod ~= '...' then
|
||||
add_module({summary='(no description)'},mod,true)
|
||||
add_module(Tags.new{summary='(no description)'},mod,true)
|
||||
first_comment = false
|
||||
module_found = true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue