]> git.rmz.io Git - my-scheme.git/blobdiff - app/Main.hs
Ignore spaces
[my-scheme.git] / app / Main.hs
index 2740935ca44f24d9121b6d9464c61c4b633b8121..852089135df8fa8b9ccef54f9699d95bc41d8df2 100644 (file)
@@ -1,8 +1,19 @@
 module Main where
-import Text.ParserCombinators.Parsec
+import Text.ParserCombinators.Parsec hiding (spaces)
 import System.Environment
 
+symbol :: Parser Char
+symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
+
+spaces :: Parser ()
+spaces = skipMany space
+
+readExpr :: String -> String
+readExpr input = case parse (spaces >> symbol) "lisp" input of
+    Left err -> "No match: " ++ show err
+    Right val -> "Found value"
+
 main :: IO ()
 main = do
     args <- getLine
-    putStrLn (args)
+    putStrLn (readExpr args)