]> git.rmz.io Git - my-scheme.git/blobdiff - app/Main.hs
readExpr function to check whether the input matches symbol
[my-scheme.git] / app / Main.hs
index 2740935ca44f24d9121b6d9464c61c4b633b8121..a94dc2ce2355835c62533047f14994df94f28319 100644 (file)
@@ -2,7 +2,15 @@ module Main where
 import Text.ParserCombinators.Parsec
 import System.Environment
 
+symbol :: Parser Char
+symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
+
+readExpr :: String -> String
+readExpr input = case parse 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)