Make minor improvements to parser

main
Ethan Reece 2023-09-07 23:04:01 -05:00
parent ff7fe0a1d3
commit a58bb2bab0
Signed by: me
GPG Key ID: D3993665FF92E1C3
1 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,7 @@ module Main (main) where
import Control.Monad.Combinators.Expr
import Data.Void (Void)
import System.Environment
import Text.Megaparsec
import Text.Megaparsec.Char as C
import Text.Megaparsec.Char.Lexer as L
@ -46,6 +47,7 @@ expr = makeExprParser term table
parseExpr :: String -> Either (ParseErrorBundle String Void) Expr
parseExpr = parse (C.space *> expr <* eof) ""
main :: IO ()
-- main :: IO ()
main = do
print $ parseExpr "2+3* 4"
input <- fmap head getArgs
parseTest expr input