summaryrefslogtreecommitdiff
path: root/app/Builtins.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2022-11-12 19:02:45 +0100
committerMirek Kratochvil <exa.exa@gmail.com>2022-11-12 19:02:45 +0100
commite248226f442f289f3b7399411cdfd127a0de4d1a (patch)
tree7dfbc33f3e49cf51f8f4616a245f633401326529 /app/Builtins.hs
parenta736c1e7b727876b0b05f0b413e2c914437df13a (diff)
downloadprlg-e248226f442f289f3b7399411cdfd127a0de4d1a.tar.gz
prlg-e248226f442f289f3b7399411cdfd127a0de4d1a.tar.bz2
o hello prlg
Diffstat (limited to 'app/Builtins.hs')
-rw-r--r--app/Builtins.hs15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/Builtins.hs b/app/Builtins.hs
index b4d6b8d..eb62526 100644
--- a/app/Builtins.hs
+++ b/app/Builtins.hs
@@ -6,6 +6,11 @@ import qualified Data.Map as M
import Env
import qualified Operators as O
+import Debug.Trace
+
+hello :: BuiltinFunc
+hello = BuiltinFunc $ trace "hllo prlg"
+
addBuiltins :: PrlgEnv ()
addBuiltins = do
a1 <- findStruct "a" 1
@@ -13,19 +18,21 @@ addBuiltins = do
b <- findAtom "b"
c <- findAtom "c"
b0 <- findStruct "b" 0
- any <- findStruct "any" 1
- eq <- findStruct "=" 2
+ any1 <- findStruct "any" 1
+ eq2 <- findStruct "=" 2
+ hello0 <- findStruct "hello" 0
modify $ \s ->
s
{ defs =
M.fromList
- [ (eq, [[U (LocalRef 0 Nothing), U (LocalRef 0 Nothing), NoGoal]])
+ [ (eq2, [[U (LocalRef 0 Nothing), U (LocalRef 0 Nothing), NoGoal]])
, (a1, [[U (Atom a), NoGoal], [U (Atom b), NoGoal]])
, ( b0
, [ [Goal, U (Struct a1), U (Atom c), LastCall]
, [Goal, U (Struct a1), U (Atom b), LastCall]
])
- , (any, [[U (VoidRef Nothing), NoGoal]])
+ , (any1, [[U (VoidRef Nothing), NoGoal]])
+ , (hello0, [[Builtin hello]])
]
, ops = [(O.xfy "," 1000), (O.xfx "=" 700)]
}