From ae91997ddaee82e0c6c6a190cafa3ba0e813b831 Mon Sep 17 00:00:00 2001 From: Jan Mas Rovira Date: Mon, 9 Sep 2024 09:46:13 +0200 Subject: [PATCH] Put stdlibPlaceHolder --- .../Compiler/Nockma/Translation/FromTree.hs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Juvix/Compiler/Nockma/Translation/FromTree.hs b/src/Juvix/Compiler/Nockma/Translation/FromTree.hs index 56db41b343..3caa4aa51d 100644 --- a/src/Juvix/Compiler/Nockma/Translation/FromTree.hs +++ b/src/Juvix/Compiler/Nockma/Translation/FromTree.hs @@ -690,7 +690,7 @@ compile = \case FunctionsLibrary -> OpQuote # functionsLibraryPlaceHolder RawCode -> opAddress "allocClosureFunPath" (fpath <> closurePath RawCode) TempStack -> remakeList [] - StandardLibrary -> OpQuote # stdlib + StandardLibrary -> OpQuote # stdlibPlaceHolder ClosureTotalArgsNum -> nockNatLiteral farity ClosureArgsNum -> nockIntegralLiteral (length args) ClosureArgs -> remakeList args @@ -958,7 +958,7 @@ runCompilerWith opts constrs moduleFuns mainFun = makeAnomaFun FunctionsLibrary -> ("functionsLibrary-" <> funName) @ functionsLibraryPlaceHolder RawCode -> ("rawCode-" <> funName) @ c TempStack -> ("tempStack-" <> funName) @ nockNilHere - StandardLibrary -> ("stdlib-" <> funName) @ stdlib + StandardLibrary -> ("stdlib-" <> funName) @ stdlibPlaceHolder ClosureTotalArgsNum -> ("closureTotalArgsNum-" <> funName) @ nockNilHere ClosureArgsNum -> ("closureArgsNum-" <> funName) @ nockNilHere ClosureArgs -> ("closureArgs-" <> funName) @ nockNilHere @@ -1001,6 +1001,19 @@ runCompilerWith opts constrs moduleFuns mainFun = makeAnomaFun { _anomaClosure = mainClosure } +stdlibPlaceHolder :: Term Natural +stdlibPlaceHolder = + TermAtom + Atom + { _atomInfo = + AtomInfo + { _atomInfoLoc = Irrelevant Nothing, + _atomInfoTag = Nothing, + _atomInfoHint = Just AtomHintFunctionsPlaceholder + }, + _atom = 0 :: Natural + } + functionsLibraryPlaceHolder :: Term Natural functionsLibraryPlaceHolder = TermAtom