1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-18 20:31:51 +03:00
juvix/app/Commands/Dev/Core/Asm/Options.hs
Jonathan Cubides 830b3be304
Add FileExt type (#2467)
This PR introduces FileExt type, and consequently, one can generalise
methods and matches based on the file extension; for example,
`parseInputJuvixAsmFile` is now an app. `parseInputFile FileExtJuvixAsm`
2023-10-25 12:02:12 +02:00

22 lines
513 B
Haskell

module Commands.Dev.Core.Asm.Options where
import CommonOptions
data CoreAsmOptions = CoreAsmOptions
{ _coreAsmPrint :: Bool,
_coreAsmInputFile :: AppPath File
}
deriving stock (Data)
makeLenses ''CoreAsmOptions
parseCoreAsmOptions :: Parser CoreAsmOptions
parseCoreAsmOptions = do
_coreAsmPrint <-
switch
( long "print"
<> help "print the generated JuvixAsm code instead of running it"
)
_coreAsmInputFile <- parseInputFile FileExtJuvixCore
pure CoreAsmOptions {..}