interpreter first version

This commit is contained in:
Oleg Sobolev 2025-12-25 18:41:04 +03:00
parent 05d670817e
commit b5001499d7
4 changed files with 63 additions and 6 deletions

View file

@ -1,10 +1,12 @@
module Main where
import Lox.Scanner
import Lox.Parser
import Lox.Interpreter
run :: String -> IO ()
run source = mapM_ print tokens
where tokens = scanTokensFromSource source
run source = print result
where result = eval expr
expr = parse tokens
tokens = scanTokensFromSource source
main :: IO ()
main = getLine >>= run