From e9e962dfe5f46003a901ea0b5be13bf7210429be Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 5 Nov 2015 16:53:16 -0500 Subject: [PATCH] Do SES on the substrings. --- prototype/doubt-difftool/main.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prototype/doubt-difftool/main.swift b/prototype/doubt-difftool/main.swift index bed06870a..75e63b30c 100644 --- a/prototype/doubt-difftool/main.swift +++ b/prototype/doubt-difftool/main.swift @@ -147,6 +147,11 @@ func parserForType(type: String) -> String throws -> Term { func refineLeafReplacement(diff: Diff, aString: String, bString: String) -> Diff { switch diff { case let .Pure(.Replace(.Unroll(aExtract, .Leaf), .Unroll(bExtract, .Leaf))): + let aSubstring = aString.utf16[aExtract.range] + let bSubstring = bString.utf16[bExtract.range] + let children = SES(aSubstring, bSubstring, cost: const(1)) { (a: (String.UTF16Index, UTF16.CodeUnit), b: (String.UTF16Index, UTF16.CodeUnit)) -> Free>? in + return nil + } return .Roll((aExtract, bExtract), .Indexed([])) default: return diff