aboutsummaryrefslogtreecommitdiff
path: root/Toks.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2025-07-17 20:44:40 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2025-07-17 20:44:40 +0200
commit49fcd0ca44bc3dd49019386543e32e2189d39c7f (patch)
tree17831481698ca98abca4faccd39f4b3f57f3b34b /Toks.hs
parentecdaa9511d277b8adca6928a40d1e48955894441 (diff)
downloadwerge-49fcd0ca44bc3dd49019386543e32e2189d39c7f.tar.gz
werge-49fcd0ca44bc3dd49019386543e32e2189d39c7f.tar.bz2
clean up
Diffstat (limited to 'Toks.hs')
-rw-r--r--Toks.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Toks.hs b/Toks.hs
index bff68e6..54240e1 100644
--- a/Toks.hs
+++ b/Toks.hs
@@ -15,11 +15,11 @@ unescape :: String -> String
unescape [] = []
unescape ('\\':'\\':xs) = '\\' : unescape xs
unescape ('\\':'n':xs) = '\n' : unescape xs
-unescape ('\\':_) = error "bad escape?"
+unescape ('\\':_) = error "bad escape on input"
unescape (x:xs) = x : unescape xs
markSpace :: String -> Tok
-markSpace [] = error "wat"
+markSpace [] = error "empty token"
markSpace s@(c:_)
| isSpace c = '.' : s
| otherwise = '|' : s
@@ -27,7 +27,7 @@ markSpace s@(c:_)
unmarkSpace :: Tok -> String
unmarkSpace ('.':s) = s
unmarkSpace ('|':s) = s
-unmarkSpace x = error "unwat"
+unmarkSpace _ = error "bad space marking on input"
space :: Tok -> Bool
space ('.':_) = True