mirror of
https://github.com/anoma/juvix.git
synced 2025-01-05 22:46:08 +03:00
bcf1d0f779
* Adds an options to display the `_identifierArgsNum` field when printing Core definitions.
29 lines
836 B
Haskell
29 lines
836 B
Haskell
module Commands.Dev.Core.Repl.Options where
|
|
|
|
import CommonOptions
|
|
import Juvix.Compiler.Core.Pretty.Options qualified as Core
|
|
|
|
data CoreReplOptions = CoreReplOptions
|
|
{ _coreReplShowDeBruijn :: Bool,
|
|
_coreReplShowIdentIds :: Bool,
|
|
_coreReplShowArgsNum :: Bool
|
|
}
|
|
deriving stock (Data)
|
|
|
|
makeLenses ''CoreReplOptions
|
|
|
|
instance CanonicalProjection CoreReplOptions Core.Options where
|
|
project c =
|
|
Core.defaultOptions
|
|
{ Core._optShowDeBruijnIndices = c ^. coreReplShowDeBruijn,
|
|
Core._optShowIdentIds = c ^. coreReplShowIdentIds,
|
|
Core._optShowArgsNum = c ^. coreReplShowArgsNum
|
|
}
|
|
|
|
parseCoreReplOptions :: Parser CoreReplOptions
|
|
parseCoreReplOptions = do
|
|
_coreReplShowDeBruijn <- optDeBruijn
|
|
_coreReplShowIdentIds <- optIdentIds
|
|
_coreReplShowArgsNum <- optArgsNum
|
|
pure CoreReplOptions {..}
|