Fri, 13 Nov 2009 18:39:17 +0000
Don't highlight table fields if they have the same name as local/global
lua2html.lua | file | annotate | diff | comparison | revisions |
--- a/lua2html.lua Fri Nov 13 18:38:39 2009 +0000 +++ b/lua2html.lua Fri Nov 13 18:39:17 2009 +0000 @@ -87,7 +87,7 @@ for _, op in pairs(ops[linenum]) do if op.comment and #op.comment > 0 and op.name ~= "JMP" then --print("Replacing "..escape_pattern(op.comment).."("..op.comment..") for "..op.name); - line, sub = line:gsub("([^%w_])("..escape_pattern(op.comment)..")([^%w_])", "%1<span class='"..op.name:lower().."'>"..escape_html(op.comment).."</span>%3"); + line, sub = line:gsub("([^%w_.])("..escape_pattern(op.comment)..")([^%w_])", "%1<span class='"..op.name:lower().."'>"..escape_html(op.comment).."</span>%3"); if sub == 0 and op.name == "GETTABLE" then --print("Trying again..."); local id = op.comment:match("[%w_]+");