summaryrefslogtreecommitdiff
path: root/DSL/Interpretation.hs
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-02-18 16:58:51 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-02-18 16:58:51 +1300
commit8c33b3d2c69b6800ca34155d62c000250980e47e (patch)
tree3e3b5a090de5e0bc5e73e0a81271361e1ffe4e3d /DSL/Interpretation.hs
parentf8a928d18371e0b67741f5d75b8154d1c105327b (diff)
Introduce stdlib and fix lexing bug
Diffstat (limited to 'DSL/Interpretation.hs')
-rw-r--r--DSL/Interpretation.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/DSL/Interpretation.hs b/DSL/Interpretation.hs
index e02bc74..02105f4 100644
--- a/DSL/Interpretation.hs
+++ b/DSL/Interpretation.hs
@@ -5,6 +5,7 @@ import Data.Foldable (foldlM)
import DSL.Types
import DSL.Util
import DSL.Intrinsics
+import DSL.StdLib (stdlib)
newMachine :: Machine
newMachine = Machine { ok=True, stack=[], pTable=[] }
@@ -103,5 +104,5 @@ evalBlocks (BIfElse c b1 b2:bs) m = applyIfElse c b1 b2 m >>= evalBlocks bs
evalBlocks (BWhile c b:bs) m = applyWhile c b m >>= evalBlocks bs
interpret :: ([ProcSpec], Program) -> IO ()
-interpret (t, p) = evalBlocks p newMachine{ pTable=t } >> return ()
+interpret (t, p) = evalBlocks p newMachine{ pTable=stdlib++t } >> return ()