21 lines
362 B
Haskell
21 lines
362 B
Haskell
module Main (main) where
|
|
|
|
import Data.Either
|
|
import Eval.Expression
|
|
import Objects.Expression
|
|
import Parser.Expression
|
|
import System.Environment
|
|
import Text.Megaparsec
|
|
|
|
parseResult :: ParseResult
|
|
parseResult = parseExpr "2+3*4"
|
|
|
|
getRight :: ParseResult -> Expr
|
|
getRight (Right r) = r
|
|
|
|
expr = getRight parseResult
|
|
|
|
result = evalExpr expr
|
|
|
|
main = do
|
|
print result |