if statement

This commit is contained in:
Oleg Sobolev 2025-12-30 05:43:01 +03:00
parent 7242b1b9d1
commit 01699716af
4 changed files with 96 additions and 47 deletions

View file

@ -12,9 +12,7 @@ run source = do
Right tokens -> do
let stmtMaybe = parse tokens
case stmtMaybe of
Left ExpectedExpressionError -> putStrLn "Expected expression"
Left MismatchedParenthesesError -> putStrLn "Mismatched parentheses"
Left ExpectedSemicolonError -> putStrLn "Expected semicolon"
Left (SyntaxError s) -> putStrLn s
Right statements -> runStatements statements
repl :: IO ()