mirror of
https://github.com/anoma/juvix.git
synced 2024-12-26 09:04:18 +03:00
a091a7f63d
Builtin information needs to be propagated from stored modules to REPL artifacts to avoid "The builtin _ has not been defined" errors. This PR adds a test suite for the REPL in the Haskell test code. This means some of the slow smoke tests can be moved to fast haskell unit tests. In future we should refactor the REPL code by putting in the main src target and unit testing more features (e.g :doc, :def). * Closes https://github.com/anoma/juvix/issues/2638
25 lines
579 B
Haskell
25 lines
579 B
Haskell
module Repl.Value where
|
|
|
|
import Base
|
|
import Juvix.Compiler.Core qualified as Core
|
|
import Juvix.Compiler.Core.Language.Value qualified as Core
|
|
import Juvix.Extra.Strings qualified as Str
|
|
|
|
mkInteger :: Integer -> Core.Value
|
|
mkInteger = Core.ValueConstant . Core.ConstInteger
|
|
|
|
mkBool :: Bool -> Core.Value
|
|
mkBool b =
|
|
Core.ValueConstrApp
|
|
( Core.ConstrApp
|
|
{ _constrAppName = name,
|
|
_constrAppFixity = Irrelevant Nothing,
|
|
_constrAppArgs = []
|
|
}
|
|
)
|
|
where
|
|
name :: Text
|
|
name = case b of
|
|
True -> Str.true
|
|
False -> Str.false
|