mirror of
https://github.com/anoma/juvix.git
synced 2024-12-18 20:31:51 +03:00
830b3be304
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`
22 lines
513 B
Haskell
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 {..}
|