Content deleted Content added
test |
poke |
||
Line 9:
-----------------------------------------------------------------------------
local SKIP_SEPARATOR = true -- a constant
local IN = "in"
local OUT = "out"
local SAME = "same"
-----------------------------------------------------------------------------
Line 23 ⟶ 26:
-- @return A list of tokens.
-----------------------------------------------------------------------------
local function split(text, separator, skip_separator)
separator = separator or "%s+"
local parts = {}
Line 53 ⟶ 56:
-- @return the least common subsequence as a matrix.
-----------------------------------------------------------------------------
local function quick_LCS(t1, t2)
local m = #t1
local n = #t2
Line 98 ⟶ 101:
-- @return an HTML string.
-----------------------------------------------------------------------------
local function format_as_html(tokens)
local diff_buffer = ""
local token, status
Line 125 ⟶ 128:
-- @return A list of annotated tokens.
-----------------------------------------------------------------------------
local function diff(old, new, separator)
assert(old); assert(new)
new = split(new, separator); old = split(old, separator)
Line 200 ⟶ 203:
-- Wiki diff style, currently just for a line
-----------------------------------------------------------------------------
local function wikiDiff(old, new, separator)
local tokens = diff(old, new, separator)
local token, status
Line 271 ⟶ 274:
end
end
return
end
local function main(frame)
end
|