Make minor improvements to parser
parent
ff7fe0a1d3
commit
a58bb2bab0
|
@ -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
|
Reference in New Issue