on master help sign in
make sure the entry is added to the generated src code for /repl
commitdbf582aa14575cc88774595e692f2943aeaa4660 authorEvan Czaplicki <evancz@users.noreply.github.com> dateThu 19 Sep 2019, 11:09 (7 years ago) parent2a8b005
1 file changed+6−7
worker/src/Endpoint/Repl.hs+6−7
worker/src/Endpoint/Repl.hs+6−7
@@ -158,15 +158,14 @@ data EntryType
158158
159159
160160compile :: A.Artifacts -> Repl.State -> EntryType -> Outcome
161−compile (A.Artifacts interfaces objects) state entryType =
161+compile (A.Artifacts interfaces objects) state@(Repl.State imports types decls) entryType =
162162 let
163163 source =
164− Repl.toByteString state $
165− case entryType of
166− ImportEntry _ _ -> Repl.OutputNothing
167− TypeEntry _ _ -> Repl.OutputNothing
168− DeclEntry name _ -> Repl.OutputDecl name
169− ExprEntry src -> Repl.OutputExpr src
164+ case entryType of
165+ ImportEntry name src -> Repl.toByteString (state { Repl._imports = Map.insert name (B.byteString src) imports }) Repl.OutputNothing
166+ TypeEntry name src -> Repl.toByteString (state { Repl._types = Map.insert name (B.byteString src) types }) Repl.OutputNothing
167+ DeclEntry name src -> Repl.toByteString (state { Repl._decls = Map.insert name (B.byteString src) decls }) (Repl.OutputDecl name)
168+ ExprEntry src -> Repl.toByteString state (Repl.OutputExpr src)
170169 in
171170 case
172171 do modul <- mapLeft Error.BadSyntax $ Parse.fromByteString Parse.Application source