-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
344 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
module Main (main) where | ||
|
||
import Parser (parse) | ||
import Lexer (lexer) | ||
import Checker (checker) | ||
import Backend.Eval (eval) | ||
import Checker (checker) | ||
import Lexer (lexer) | ||
import Parser (parse) | ||
|
||
main :: IO () | ||
main = do | ||
let tokens = lexer "type A = Int in let a: Bool & A | Bool = if False then 1 else False in a" | ||
let ast = parse tokens | ||
case checker ast of | ||
Right resultT -> do | ||
print resultT | ||
result <- eval ast | ||
case result of | ||
Right v -> print v | ||
Left err -> print err | ||
Left err -> do | ||
print ast | ||
print err | ||
let tokens = lexer "type A = Int in let a: Bool & A | Bool = if False then 1 else False in a" | ||
let ast = parse tokens | ||
case checker ast of | ||
Right resultT -> do | ||
print resultT | ||
result <- eval ast | ||
case result of | ||
Right v -> print v | ||
Left err -> print err | ||
Left err -> do | ||
print ast | ||
print err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.