-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add typecheck and internal command (#270)
* Closes #269 * Add internal command * w.i.p * Fix shell tests. * Rename check command and add shell-tests
- Loading branch information
1 parent
329bec5
commit eb6819f
Showing
27 changed files
with
428 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
module Commands.Internal | ||
( module Commands.Internal, | ||
module Commands.Internal.MicroJuvix, | ||
module Commands.Internal.Parse, | ||
module Commands.Internal.Scope, | ||
module Commands.Internal.Termination, | ||
) | ||
where | ||
|
||
import Commands.Internal.MicroJuvix | ||
import Commands.Internal.Parse | ||
import Commands.Internal.Scope | ||
import Commands.Internal.Termination | ||
import Juvix.Prelude | ||
import Options.Applicative | ||
|
||
data InternalCommand | ||
= DisplayRoot | ||
| Highlight | ||
| MicroJuvix MicroJuvixCommand | ||
| MiniC | ||
| MiniHaskell | ||
| MonoJuvix | ||
| Parse ParseOptions | ||
| Scope ScopeOptions | ||
| Termination TerminationCommand | ||
|
||
parseInternalCommand :: Parser InternalCommand | ||
parseInternalCommand = | ||
hsubparser | ||
( mconcat | ||
[ commandHighlight, | ||
commandMicroJuvix, | ||
commandMiniC, | ||
commandMiniHaskell, | ||
commandMonoJuvix, | ||
commandParse, | ||
commandScope, | ||
commandShowRoot, | ||
commandTermination | ||
] | ||
) | ||
|
||
commandHighlight :: Mod CommandFields InternalCommand | ||
commandHighlight = | ||
command "highlight" $ | ||
info | ||
(pure Highlight) | ||
(progDesc "Highlight a Juvix file") | ||
|
||
commandMiniC :: Mod CommandFields InternalCommand | ||
commandMiniC = | ||
command "minic" $ | ||
info | ||
(pure MiniC) | ||
(progDesc "Translate a Juvix file to MiniC") | ||
|
||
commandMicroJuvix :: Mod CommandFields InternalCommand | ||
commandMicroJuvix = | ||
command "microjuvix" $ | ||
info | ||
(MicroJuvix <$> parseMicroJuvixCommand) | ||
(progDesc "Subcommands related to MicroJuvix") | ||
|
||
commandMiniHaskell :: Mod CommandFields InternalCommand | ||
commandMiniHaskell = | ||
command "minihaskell" $ | ||
info | ||
(pure MiniHaskell) | ||
(progDesc "Translate a Juvix file to MiniHaskell") | ||
|
||
commandMonoJuvix :: Mod CommandFields InternalCommand | ||
commandMonoJuvix = | ||
command "monojuvix" $ | ||
info | ||
(pure MonoJuvix) | ||
(progDesc "Translate a Juvix file to MonoJuvix") | ||
|
||
commandParse :: Mod CommandFields InternalCommand | ||
commandParse = | ||
command "parse" $ | ||
info | ||
(Parse <$> parseParse) | ||
(progDesc "Parse a Juvix file") | ||
|
||
commandScope :: Mod CommandFields InternalCommand | ||
commandScope = | ||
command "scope" $ | ||
info | ||
(Scope <$> parseScope) | ||
(progDesc "Parse and scope a Juvix file") | ||
|
||
commandShowRoot :: Mod CommandFields InternalCommand | ||
commandShowRoot = | ||
command "root" $ | ||
info | ||
(pure DisplayRoot) | ||
(progDesc "Show the root path for a Juvix project") | ||
|
||
commandTermination :: Mod CommandFields InternalCommand | ||
commandTermination = | ||
command "termination" $ | ||
info | ||
(Termination <$> parseTerminationCommand) | ||
(progDesc "Subcommands related to termination checking") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/Commands/Termination.hs → app/Commands/Internal/Termination.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.