module deduction can blow up; UTF BOM ignored

This commit is contained in:
steve donovan 2013-04-16 10:11:05 +02:00
parent 6d22818ec9
commit 68cd576bf4
3 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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

View File

@ -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