From a5d1617d15affc66b15274b6649b0bd21921b9a3 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Thu, 26 Jan 2023 16:32:55 +0200 Subject: [PATCH] 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 --- dub.json | 2 +- source/tlang/commandline/args.d | 7 ++----- source/tlang/commandline/commands.d | 23 +++++++++++++++++++---- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/dub.json b/dub.json index a10df2c..997c056 100644 --- a/dub.json +++ b/dub.json @@ -5,7 +5,7 @@ "copyright": "Copyright © 2021-2023, Tristan B. Kildaire", "dependencies": { "gogga": "~>0.1.0", - "jcli": "~>0.24.0" + "jcli": "0.25.0-beta.1" }, "description": "The official Tristan language compiler project", "license": "GPLv3", diff --git a/source/tlang/commandline/args.d b/source/tlang/commandline/args.d index a2fa970..fdac57d 100644 --- a/source/tlang/commandline/args.d +++ b/source/tlang/commandline/args.d @@ -1,12 +1,9 @@ module commandline.args; -import jcli; +import jcli.commandgraph.cli; 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 */ - commandLineSystem.parseAndExecute(arguments); + matchAndExecuteAcrossModules!(commandline.commands)(arguments[1..arguments.length]); } \ No newline at end of file diff --git a/source/tlang/commandline/commands.d b/source/tlang/commandline/commands.d index 50f7452..4efcb22 100644 --- a/source/tlang/commandline/commands.d +++ b/source/tlang/commandline/commands.d @@ -43,6 +43,7 @@ mixin template BaseCommand() string sourceFile; @ArgNamed("verbose|v", "Verbosity level") + @(ArgConfig.optional) VerbosityLevel debugLevel; void BaseCommandInit(Compiler compiler) @@ -61,20 +62,26 @@ mixin template EmitBase() @ArgGroup("Emit", "Options pertaining to the code emitter") { @ArgNamed("symbol-mapper|sm", "The symbol mapping technique to use") - @(ArgExistence.optional) + @(ArgConfig.optional) SymbolMappingTechnique symbolTechnique; @ArgNamed("prettygen|pg", "Generate pretty-printed code") - @(ArgExistence.optional) + @(ArgConfig.optional) bool prettyPrintCodeGen; @ArgNamed("output|o", "Filename of generated object file") - @(ArgExistence.optional) + @(ArgConfig.optional) string outputFilename = "tlangout.c"; @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 + + @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) @@ -90,6 +97,14 @@ mixin template EmitBase() } } +/** + * Base requirements for TypeChecker+ + */ +mixin template TypeCheckerBase() +{ + +} + /** * Compile the given source file from start to finish */