From cb5257b285e162127e7d2def86e6ae47435650db Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Fri, 18 Jul 2025 15:21:08 +0200 Subject: make diff+patch work together, document --- Toks.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Toks.hs') diff --git a/Toks.hs b/Toks.hs index 54240e1..8eb7eb7 100644 --- a/Toks.hs +++ b/Toks.hs @@ -18,15 +18,19 @@ unescape ('\\':'n':xs) = '\n' : unescape xs unescape ('\\':_) = error "bad escape on input" unescape (x:xs) = x : unescape xs +tok ('.':_) = True +tok ('/':_) = True +tok _ = False + markSpace :: String -> Tok markSpace [] = error "empty token" markSpace s@(c:_) | isSpace c = '.' : s - | otherwise = '|' : s + | otherwise = '/' : s unmarkSpace :: Tok -> String unmarkSpace ('.':s) = s -unmarkSpace ('|':s) = s +unmarkSpace ('/':s) = s unmarkSpace _ = error "bad space marking on input" space :: Tok -> Bool -- cgit v1.2.3