Issue #137 boilerplate Lua block comment

This commit is contained in:
steve donovan 2014-01-06 13:35:12 +02:00
parent 94975bcb8c
commit 60c6e79dd9
2 changed files with 6 additions and 3 deletions

View File

@ -87,6 +87,7 @@ end
function Lua:grab_block_comment(v,tok)
local equals = v:match('^%-%-%[(=*)%[')
if not equals then return v end
v = v:gsub(self.block_comment,'')
return tools.grab_block_comment(v,tok,'%]'..equals..'%]')
end

View File

@ -214,6 +214,8 @@ local function parse_file(fname, lang, package, args)
local t,v = tnext(tok)
-- with some coding styles first comment is standard boilerplate; option to ignore this.
if args.boilerplate and t == 'comment' then
-- hack to deal with boilerplate inside Lua block comments
if v:match '%s*%-%-%[%[' then lang:grab_block_comment(v,tok) end
t,v = tnext(tok)
end
if t == '#' then -- skip Lua shebang line, if present