1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-29 10:33:15 +03:00
juvix/app/Commands/Dev/Tree.hs
Jan Mas Rovira 65176a333d
refactor --target into subcommands for dev tree compile and other improvements (#2713)
- refactor `--target` into subcommands for `dev tree compile`.
- prepend `App` to all `CompileTarget` constructors to avoid name
clashes with `Target`.
- parameterize compile options type with the input kind. The input kind
indicates the expected file extension of the input file. If the input
file is a .juvix file, then it is optional, otherwise it is mandatory.
- Add `AppError MegaparsecError` instance and simplify some related
code.
2024-04-16 17:32:44 +02:00

19 lines
621 B
Haskell

module Commands.Dev.Tree where
import Commands.Base
import Commands.Dev.Tree.Compile as Compile
import Commands.Dev.Tree.Eval as Eval
import Commands.Dev.Tree.FromAsm as FromAsm
import Commands.Dev.Tree.Options
import Commands.Dev.Tree.Read as Read
import Commands.Dev.Tree.Repl as Repl
runCommand :: forall r. (Members '[EmbedIO, App, TaggedLock] r) => TreeCommand -> Sem r ()
runCommand = \case
Eval opts -> Eval.runCommand opts
Compile opts -> Compile.runCommand opts
CompileOld {} -> impossible
Read opts -> Read.runCommand opts
FromAsm opts -> FromAsm.runCommand opts
Repl opts -> Repl.runCommand opts