Skip to content

Commit

Permalink
Merge pull request #1 from Pyro569/1.0-Release-Candidate
Browse files Browse the repository at this point in the history
1.0 release candidate
  • Loading branch information
Pyro569 authored Nov 5, 2023
2 parents a3dd569 + 12c6d3f commit ac04eff
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
14 changes: 14 additions & 0 deletions ArgReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ namespace DawnLangCompiler
{
class ArgReader
{
private static List<string> PossibleArgs = new List<string>(){
"-d - Debug Mode (For development use only)",
"-b - Build File (input file name as next arg)",
"-br - Build and Run File (Compiles and then runs the compiled binary)",
"--version - Outputs the DawnLang version you have installed",
"--h - Prints out a list of possible arguments for the compiler",
"Example Compiler Usage: ./DawnLang \"-b\" \"hello_world.dl\" \"Hello_World\""
};
public static void Main(string[] args)
{
for (int i = 0; i < args.Length; i++)
Expand All @@ -18,6 +26,12 @@ public static void Main(string[] args)
Tokenization.BuildFile(args[i + 1], args[i + 2]);
Process.Start("./" + args[i + 2]);//is this platform independent?
}
if (args[i] == "--version")
//TODO: Change this to DawnLang Version 1.0 for the full release
Console.WriteLine("DawnLang Version 1.0rc");
if (args[i] == "--h")
for (int l = 0; l < PossibleArgs.Count; l++)
Console.WriteLine(PossibleArgs[l]);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions ErrorCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace DawnLangCompiler
{
class ErrorCodeIO
{
//TODO: Finish this up in the 1.1 release
public static void ErrorCodeOutput()
{
switch (Tokenization.ErrorOpCode)
Expand Down Expand Up @@ -89,6 +90,7 @@ private static void cf200()

//TODO: Engineer a good way to guess what the user was trying to type


File.Delete("Tokens.txt");
}
}
Expand Down
7 changes: 7 additions & 0 deletions Tokenization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ private static void ConvertTokens()
{
ConvertedTokens.Add("int main(");
if (Tokens[i + 2] == "args")
{
ConvertedTokens[ConvertedTokens.Count - 1] += "int argc, char** argv";
IntVars.Add("argc");
StringListNames.Add("argv");
}
ConvertedTokens[ConvertedTokens.Count - 1] += "){";
}
else
Expand Down Expand Up @@ -272,6 +276,9 @@ private static void ConvertTokens()
case "dawnlang.data.types":
ConvertedTokens[ConvertedTokens.Count - 1] += "<stdbool.h>";
break;
case "dawnlang.io.args":
ConvertedTokens[ConvertedTokens.Count - 1] += "<string.h>";
break;
}
break;
case "List":
Expand Down
2 changes: 1 addition & 1 deletion example files/booleans.dl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ function main(){
//set the boolean value to true
TrueFalse = true;

//to print if a boolean is true or false, print_int() should work, 0 = false, 1 = true
//to print if a boolean is true or false, print.int() should work, 0 = false, 1 = true
print.int(TrueFalse);
}
4 changes: 3 additions & 1 deletion example files/comments.dl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#import dawnlang.io;

function main(){
//to create a comment, make an empty line with a // at the beginning
//this file should do nothing!
print("There is a comment before this!\n");
}
21 changes: 1 addition & 20 deletions testfile.dl
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
#import dawnlang.io;

function main(){
int num = 12;
switch(num){
case 12:
print("Its 12!\n");
break;
case 13:
print("Its 13!\n");
break;
}
num = 13;
switch(num){
case 12:
print("Its 12!\n");
break;
case 13:
print("Its 13!\n");
break;
}

}

0 comments on commit ac04eff

Please sign in to comment.