diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-05-25 17:38:35 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-05-25 17:38:35 +0200 |
commit | 624c3db6f493edfb458ee262c4dd691915c46567 (patch) | |
tree | bf6614b3cc6a2d042d7bcade64992d3c2bb9882b /rip.hs | |
parent | 03b3893fc87c35edabc33a2c533e479e69da76fe (diff) |
Add string mode
Diffstat (limited to 'rip.hs')
-rw-r--r-- | rip.hs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -331,6 +331,13 @@ rip' code@(x:xs) fns conns st = do '\'' -> rip' (tail xs) fns conns $ ordI (head xs) : st + '"' -> + let str = takeWhile (/='"') xs + rest = drop (length str + 1) xs + in if length str == length xs + then riperror "No closing quote in \"string\"" + else rip' rest fns conns $ reverse (map (fromIntegral . fromEnum) str) ++ st + '$' -> do putStrLn $ '[' : ((intercalate " " . map show . reverse) st) ++ "]" rip' xs fns conns st |