1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-05 22:46:08 +03:00
juvix/app/Commands/Dev/Core/Repl/Options.hs
Łukasz Czajka bcf1d0f779
Option --show-args-num (#1946)
* Adds an options to display the `_identifierArgsNum` field when
printing Core definitions.
2023-03-30 12:23:40 +01:00

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 {..}