Skip to content

Commit

Permalink
remove printing unit values in repl output
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon authored and rsoeldner committed Feb 6, 2025
1 parent 9cc8f57 commit bf851ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion pact-repl/Pact/Core/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ renderLocatedPactErrorFromState rstate err = rendered
Nothing -> rstate ^. replCurrSource
rendered = replError originFile err


runRepl :: IO ()
runRepl = do
pdb <- mockPactDb serialisePact_repl_fileLocSpanInfo
Expand Down
8 changes: 5 additions & 3 deletions pact-repl/Pact/Core/Repl/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import Pact.Core.Errors
import Pact.Core.Interpreter
import Pact.Core.Pretty hiding (pipe)
import Pact.Core.Serialise
import Pact.Core.PactValue


import Pact.Core.IR.Eval.Runtime
Expand Down Expand Up @@ -263,6 +264,8 @@ interpretReplProgram interpreter sc@(SourceCode sourceFp source) = do
parseSource lexerOutput
| sourceIsPactFile = (fmap.fmap) (Lisp.RTLTopLevel) $ Lisp.parseProgram lexerOutput
| otherwise = Lisp.parseReplProgram lexerOutput
displayValue :: FileLocSpanInfo -> ReplCompileValue -> ReplM ReplCoreBuiltin ReplCompileValue
displayValue _info v@(RCompileValue (InterpretValue PUnit _)) = pure v
displayValue info p = p <$ replPrintLn info p
sliceCode = \case
Lisp.TLModule{} -> sliceFromSource
Expand Down Expand Up @@ -290,10 +293,9 @@ interpretReplProgram interpreter sc@(SourceCode sourceFp source) = do
throwExecutionError varI $ EvalError "repl invariant violated: resolved to a top level free variable without a binder"
_ -> do
let sliced = sliceCode toplevel source (view spanInfo tlInfo)
v <- evalTopLevel interpreter (RawCode sliced) ds deps
v <- RCompileValue <$> evalTopLevel interpreter (RawCode sliced) ds deps
emitWarnings
replPrintLn tlInfo v
pure (RCompileValue v)
displayValue tlInfo v
where
tlInfo = view Lisp.topLevelInfo toplevel
_ -> do
Expand Down

0 comments on commit bf851ab

Please sign in to comment.