crafting-interpreters-hs/app/Main.hs

13 lines
255 B
Haskell
Raw Normal View History

2025-12-09 17:23:54 +03:00
import Lox.Scanner
2025-12-25 18:41:04 +03:00
import Lox.Parser
import Lox.Interpreter
2025-12-09 17:23:54 +03:00
run :: String -> IO ()
2025-12-25 18:41:04 +03:00
run source = print result
where result = eval expr
expr = parse tokens
tokens = scanTokensFromSource source
2025-12-09 17:23:54 +03:00
2025-12-02 23:26:17 +03:00
main :: IO ()
2025-12-24 18:06:03 +03:00
main = getLine >>= run