aboutsummaryrefslogtreecommitdiff
path: root/Toks.hs
diff options
context:
space:
mode:
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