diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2025-07-18 15:21:08 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2025-07-18 15:21:08 +0200 |
| commit | cb5257b285e162127e7d2def86e6ae47435650db (patch) | |
| tree | bbffa083d4dfde28785c41bf5a73c3096e8174c7 /Toks.hs | |
| parent | 56cf7c69a948ee04100b8363206b51d680bc4664 (diff) | |
| download | werge-cb5257b285e162127e7d2def86e6ae47435650db.tar.gz werge-cb5257b285e162127e7d2def86e6ae47435650db.tar.bz2 | |
make diff+patch work together, document
Diffstat (limited to 'Toks.hs')
| -rw-r--r-- | Toks.hs | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |
