This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from StellarWitch7/dev
Update `main` with `dev` to keep the README up-to-date
- Loading branch information
Showing
151 changed files
with
17,886 additions
and
3,528 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"csharpier": { | ||
"version": "0.28.2", | ||
"commands": [ | ||
"dotnet-csharpier" | ||
], | ||
"rollForward": false | ||
} | ||
} | ||
} |
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 @@ | ||
use nix |
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 |
---|---|---|
@@ -1,58 +1,91 @@ | ||
using CommandLine; | ||
using System.ComponentModel.Design.Serialization; | ||
using System.ComponentModel.Design.Serialization; | ||
using CommandLine; | ||
|
||
namespace Moth.Compiler; | ||
|
||
internal class Options | ||
{ | ||
[Option('v', | ||
"verbose", | ||
Required = false, | ||
HelpText = "Whether to include extensive logging.")] | ||
[Option('v', "verbose", Required = false, HelpText = "Whether to include extensive logging.")] | ||
public bool Verbose { get; set; } | ||
|
||
[Option('n', | ||
[Option( | ||
'n', | ||
"no-meta", | ||
Required = false, | ||
HelpText = "Whether to strip metadata from the output file. WARNING: disables reflection!")] | ||
HelpText = "Whether to strip metadata from the output file. WARNING: disables reflection!" | ||
)] | ||
public bool NoMetadata { get; set; } | ||
|
||
[Option("no-advanced-ir-opt", | ||
[Option( | ||
"no-advanced-ir-opt", | ||
Required = false, | ||
HelpText = "Whether to forego advanced optimizations to the IR.")] | ||
HelpText = "Whether to forego advanced optimizations to the IR." | ||
)] | ||
public bool DoNotOptimizeIR { get; set; } | ||
|
||
[Option('o', | ||
[Option( | ||
'o', | ||
"output-file", | ||
Required = true, | ||
HelpText = "The name of the file to output. Please forego the extension.")] | ||
HelpText = "The name of the file to output. Please forego the extension." | ||
)] | ||
public string? OutputFile { get; set; } | ||
|
||
[Option('i', | ||
"input", | ||
Required = true, | ||
HelpText = "The files to compile.")] | ||
[Option('i', "input", Required = true, HelpText = "The files to compile.")] | ||
public IEnumerable<string>? InputFiles { get; set; } | ||
|
||
[Option('t', | ||
[Option( | ||
't', | ||
"output-type", | ||
Required = true, | ||
HelpText = "The type of file to output. Options are \"exe\" and \"lib\".")] | ||
HelpText = "The type of file to output. Options are \"exe\" and \"lib\"." | ||
)] | ||
public string OutputType { get; set; } | ||
|
||
[Option("moth-libs", | ||
|
||
[Option( | ||
'V', | ||
"module-version", | ||
Required = false, | ||
HelpText = "External Moth library files to include in the compiled program.")] | ||
HelpText = "The version of the compiled module." | ||
)] | ||
public string? ModuleVersion { get; set; } | ||
|
||
[Option( | ||
'g', | ||
"compression-level", | ||
Required = false, | ||
HelpText = "The type of compression to use for mothlib embedded metadata. Only really matters for huge projects. " | ||
+ "Options are: \"none\", \"low\", \"mid\", and \"high\"." | ||
)] | ||
public string CompressionLevel { get; set; } = "mid"; | ||
|
||
[Option( | ||
'm', | ||
"moth-libs", | ||
Required = false, | ||
HelpText = "External Moth library files to include in the compiled program." | ||
)] | ||
public IEnumerable<string>? MothLibraryFiles { get; set; } | ||
|
||
[Option("c-libs", | ||
|
||
[Option( | ||
'c', | ||
"c-libs", | ||
Required = false, | ||
HelpText = "External C library files to include in the compiled program.")] | ||
HelpText = "External C library files to include in the compiled program." | ||
)] | ||
public IEnumerable<string>? CLibraryFiles { get; set; } | ||
|
||
[Option( | ||
'e', | ||
"export-for", | ||
Required = false, | ||
HelpText = "Languages to @Export() functions for. Use the file extension for the language." | ||
)] | ||
public IEnumerable<string>? ExportLanguages { get; set; } | ||
} | ||
|
||
public enum OutputType | ||
{ | ||
Executable, | ||
StaticLib | ||
} | ||
} |
Oops, something went wrong.