85 line = line:gsub("\".-[^\\]\"", "<span class='string'>%1</span>"); |
85 line = line:gsub("\".-[^\\]\"", "<span class='string'>%1</span>"); |
86 if ops[linenum] then |
86 if ops[linenum] then |
87 for _, op in pairs(ops[linenum]) do |
87 for _, op in pairs(ops[linenum]) do |
88 if op.comment and #op.comment > 0 and op.name ~= "JMP" then |
88 if op.comment and #op.comment > 0 and op.name ~= "JMP" then |
89 --print("Replacing "..escape_pattern(op.comment).."("..op.comment..") for "..op.name); |
89 --print("Replacing "..escape_pattern(op.comment).."("..op.comment..") for "..op.name); |
90 line, sub = line:gsub("([^%w_])("..escape_pattern(op.comment)..")([^%w_])", "%1<span class='"..op.name:lower().."'>"..escape_html(op.comment).."</span>%3"); |
90 line, sub = line:gsub("([^%w_.])("..escape_pattern(op.comment)..")([^%w_])", "%1<span class='"..op.name:lower().."'>"..escape_html(op.comment).."</span>%3"); |
91 if sub == 0 and op.name == "GETTABLE" then |
91 if sub == 0 and op.name == "GETTABLE" then |
92 --print("Trying again..."); |
92 --print("Trying again..."); |
93 local id = op.comment:match("[%w_]+"); |
93 local id = op.comment:match("[%w_]+"); |
94 if id then |
94 if id then |
95 --print("Got "..id); |
95 --print("Got "..id); |