Skip to content

Commit

Permalink
Put stdlibPlaceHolder
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira authored and lukaszcz committed Sep 9, 2024
1 parent ab2d31a commit ae91997
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Juvix/Compiler/Nockma/Translation/FromTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ae91997

Please sign in to comment.