]> git.rmz.io Git - my-scheme.git/blob - app/Main.hs
Ignore spaces
[my-scheme.git] / app / Main.hs
1 module Main where
2 import Text.ParserCombinators.Parsec hiding (spaces)
3 import System.Environment
4
5 symbol :: Parser Char
6 symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
7
8 spaces :: Parser ()
9 spaces = skipMany space
10
11 readExpr :: String -> String
12 readExpr input = case parse (spaces >> symbol) "lisp" input of
13 Left err -> "No match: " ++ show err
14 Right val -> "Found value"
15
16 main :: IO ()
17 main = do
18 args <- getLine
19 putStrLn (readExpr args)