Skip to content

Commit

Permalink
Temporarily Remove C++ abilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyro569 committed Nov 13, 2023
1 parent bb5b345 commit f08de94
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ project-scripts/
testrun.sh
testrundebug.sh
build.sh
Main.cpp
Main.cpp
Main.c
3 changes: 1 addition & 2 deletions New-Compiler/ArgReader.dl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include Tokenization.dl;
#import dawnlang.io;
#import dawnlang.io.args;

#include Tokenization.dl;

function main(args){
C-Code[
for(int i = 1; i < argc; i++){
Expand Down
Binary file modified New-Compiler/DawnLang
Binary file not shown.
5 changes: 0 additions & 5 deletions New-Compiler/Tokenization.dl
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
#import dawnlang.io;

function ReadFile(string FilePath){

}
8 changes: 4 additions & 4 deletions Old-Compiler/Creation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static void CreateCFile(string FileName)
{
Tokenization.ErrorOpCode = "wc100"; //wc for writing c, 100 for first potential error spot

StreamWriter outputFile = new StreamWriter(FileName + ".cpp");
StreamWriter outputFile = new StreamWriter(FileName + ".c");

//write each converted token to the c file
foreach (string codeLines in Tokenization.ConvertedTokens)
Expand All @@ -25,7 +25,7 @@ public static void CompileCFile(string FileName, string OutputFileName)

Tokenization.ErrorOpCode = "cf200"; //cf for compile file, 200 for second potential error spot

Process.Start("gcc", FileName + ".cpp -w -lstdc++"); //-lstdc++ every time in case if c++ code sections are included
Process.Start("gcc", FileName + ".c -w -lstdc++"); //-lstdc++ every time in case if c++ code sections are included
Thread.Sleep(1500); //small micro sleep for program to not error moving file since it is so new
File.Move("./a.out", "./" + OutputFileName);
}
Expand All @@ -34,8 +34,8 @@ public static void Cleanup(string FileName)
{
Tokenization.ErrorOpCode = "cl100"; //cl for cleanup, 100 for first potential error spot

if (File.Exists("./" + FileName + ".cpp")) //delete the TempFile.c if it still exists (which it still should, if not, error)
File.Delete("./" + FileName + ".cpp");
if (File.Exists("./" + FileName + ".c")) //delete the TempFile.c if it still exists (which it still should, if not, error)
File.Delete("./" + FileName + ".c");
else
System.Environment.Exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion Old-Compiler/Tokenization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ private static void ConvertTokens()
switch (Tokens[i + 1])
{
case "dawnlang.io":
ConvertedTokens[ConvertedTokens.Count - 1] += "<stdio.h>\n#include <iostream>";
ConvertedTokens[ConvertedTokens.Count - 1] += "<stdio.h>";
break;
case "dawnlang.data.types":
ConvertedTokens[ConvertedTokens.Count - 1] += "<stdbool.h>";
Expand Down
10 changes: 5 additions & 5 deletions Old-Compiler/testfile.dl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import dawnlang.io;
#include print_number_function.dl;

function main(args){
List<int> intList = [12, 9, 7, 18];
list.element.add(intList, 47);
print.list.element(intList, 4);
function main(){
int twelve = 12;
//call the print_number function from the print_number_function.dl file
print_number(twelve);
}

0 comments on commit f08de94

Please sign in to comment.