X-Git-Url: https://git.rmz.io/my-scheme.git/blobdiff_plain/f124ec5ddc0b30d092be82eb7b9fd3a9d1f47990..429ac1845f1b93f54bca8511a4efbf8cbcbb9bf3:/app/Main.hs diff --git a/app/Main.hs b/app/Main.hs index 2740935..8520891 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -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)