gdritter repos s-cargot / 1c23cc8
Reproduced pull request#3 after it got eaten by unprincipled git usage on the part of the maintainer. Getty Ritter 7 years ago
1 changed file(s) with 9 addition(s) and 4 deletion(s). Collapse all Expand all
7777
7878 main :: IO ()
7979 main = do
80 sExprText <- pack . head <$> getArgs
80 sExprText <- pack . head <$> getContents
8181 either putStrLn print (decode myLangParser sExprText)
8282
8383 {-
84 Exmaple usage:
84 Example usage:
8585
86 $ dist/build/example/example "$(echo -e '(+ (* 2 20) 10) (* 10 10)')"
87 [EOp Add (EOp Mul (ENum 2) (ENum 20)) (ENum 10),EOp Mul (ENum 10) (ENum 10)]
86 $ dist/build/example/example <<EOF
87 > -- you can put comments in the code!
88 > (+ 10 (* 20 20))
89 > -- and more than one s-expression!
90 > (* 10 10)
91 > EOF
92 [EOp Add (ENum 10) (EOp Mul (ENum 20) (ENum 20)),EOp Mul (ENum 10) (ENum 10)]
8893 -}