From 49fcd0ca44bc3dd49019386543e32e2189d39c7f Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Thu, 17 Jul 2025 20:44:40 +0200 Subject: clean up --- Toks.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Toks.hs') 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 -- cgit v1.2.3