aboutsummaryrefslogtreecommitdiff
path: root/Toks.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2025-07-18 15:21:08 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2025-07-18 15:21:08 +0200
commitcb5257b285e162127e7d2def86e6ae47435650db (patch)
treebbffa083d4dfde28785c41bf5a73c3096e8174c7 /Toks.hs
parent56cf7c69a948ee04100b8363206b51d680bc4664 (diff)
downloadwerge-cb5257b285e162127e7d2def86e6ae47435650db.tar.gz
werge-cb5257b285e162127e7d2def86e6ae47435650db.tar.bz2
make diff+patch work together, document
Diffstat (limited to 'Toks.hs')
-rw-r--r--Toks.hs8
1 files changed, 6 insertions, 2 deletions
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