mirror of https://github.com/tbklang/tlang.git
Commands
- Upgraded to jcli 0.25.1-beta - Added aggregate command-line arguments `library-link` to support future library linking - Added stub mixin template `TypeCheckerBase` - Made verbosity an optional flag
This commit is contained in:
parent
3f84020e22
commit
a5d1617d15
2
dub.json
2
dub.json
|
@ -5,7 +5,7 @@
|
||||||
"copyright": "Copyright © 2021-2023, Tristan B. Kildaire",
|
"copyright": "Copyright © 2021-2023, Tristan B. Kildaire",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"gogga": "~>0.1.0",
|
"gogga": "~>0.1.0",
|
||||||
"jcli": "~>0.24.0"
|
"jcli": "0.25.0-beta.1"
|
||||||
},
|
},
|
||||||
"description": "The official Tristan language compiler project",
|
"description": "The official Tristan language compiler project",
|
||||||
"license": "GPLv3",
|
"license": "GPLv3",
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
module commandline.args;
|
module commandline.args;
|
||||||
|
|
||||||
import jcli;
|
import jcli.commandgraph.cli;
|
||||||
|
|
||||||
void parseCommandLine(string[] arguments)
|
void parseCommandLine(string[] arguments)
|
||||||
{
|
{
|
||||||
/* Create an instance of the JCLI command-line parser */
|
|
||||||
CommandLineInterface!(commandline.commands) commandLineSystem = new CommandLineInterface!(commandline.commands)();
|
|
||||||
|
|
||||||
/* Parse the command-line arguments */
|
/* Parse the command-line arguments */
|
||||||
commandLineSystem.parseAndExecute(arguments);
|
matchAndExecuteAcrossModules!(commandline.commands)(arguments[1..arguments.length]);
|
||||||
}
|
}
|
|
@ -43,6 +43,7 @@ mixin template BaseCommand()
|
||||||
string sourceFile;
|
string sourceFile;
|
||||||
|
|
||||||
@ArgNamed("verbose|v", "Verbosity level")
|
@ArgNamed("verbose|v", "Verbosity level")
|
||||||
|
@(ArgConfig.optional)
|
||||||
VerbosityLevel debugLevel;
|
VerbosityLevel debugLevel;
|
||||||
|
|
||||||
void BaseCommandInit(Compiler compiler)
|
void BaseCommandInit(Compiler compiler)
|
||||||
|
@ -61,20 +62,26 @@ mixin template EmitBase()
|
||||||
@ArgGroup("Emit", "Options pertaining to the code emitter")
|
@ArgGroup("Emit", "Options pertaining to the code emitter")
|
||||||
{
|
{
|
||||||
@ArgNamed("symbol-mapper|sm", "The symbol mapping technique to use")
|
@ArgNamed("symbol-mapper|sm", "The symbol mapping technique to use")
|
||||||
@(ArgExistence.optional)
|
@(ArgConfig.optional)
|
||||||
SymbolMappingTechnique symbolTechnique;
|
SymbolMappingTechnique symbolTechnique;
|
||||||
|
|
||||||
@ArgNamed("prettygen|pg", "Generate pretty-printed code")
|
@ArgNamed("prettygen|pg", "Generate pretty-printed code")
|
||||||
@(ArgExistence.optional)
|
@(ArgConfig.optional)
|
||||||
bool prettyPrintCodeGen;
|
bool prettyPrintCodeGen;
|
||||||
|
|
||||||
@ArgNamed("output|o", "Filename of generated object file")
|
@ArgNamed("output|o", "Filename of generated object file")
|
||||||
@(ArgExistence.optional)
|
@(ArgConfig.optional)
|
||||||
string outputFilename = "tlangout.c";
|
string outputFilename = "tlangout.c";
|
||||||
|
|
||||||
@ArgNamed("entrypointTest|et", "Whether or not to emit entrypoint testing code")
|
@ArgNamed("entrypointTest|et", "Whether or not to emit entrypoint testing code")
|
||||||
@(ArgExistence.optional)
|
@(ArgConfig.optional)
|
||||||
bool entrypointTestEmit = true; // TODO: Change this later to `false` of course
|
bool entrypointTestEmit = true; // TODO: Change this later to `false` of course
|
||||||
|
|
||||||
|
@ArgNamed("library-link|ll", "Paths to any object files to ,ink in during the linking phase")
|
||||||
|
@(ArgConfig.optional)
|
||||||
|
@(ArgConfig.aggregate)
|
||||||
|
|
||||||
|
string[] bruh;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitBaseInit(Compiler compiler)
|
void EmitBaseInit(Compiler compiler)
|
||||||
|
@ -90,6 +97,14 @@ mixin template EmitBase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base requirements for TypeChecker+
|
||||||
|
*/
|
||||||
|
mixin template TypeCheckerBase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compile the given source file from start to finish
|
* Compile the given source file from start to finish
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue