diff options
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 |
