From 058853ef025b8b1b24982b98dee852ad0ec2fed7 Mon Sep 17 00:00:00 2001 From: nub31 Date: Fri, 27 Jun 2025 16:32:40 +0200 Subject: [PATCH] ... --- example/compile.sh | 8 -------- example/makefile | 8 ++++++++ src/compiler/CLI/Program.cs | 7 ++----- src/tools/syntax-highlighting/.gitignore | 1 - src/tools/syntax-highlighting/build.sh | 3 --- src/vscode/.gitignore | 1 + .../language-configuration.json | 0 src/vscode/makefile | 6 ++++++ src/{tools/syntax-highlighting => vscode}/package.json | 0 .../syntaxes/nub.tmLanguage.json | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) delete mode 100755 example/compile.sh create mode 100644 example/makefile delete mode 100644 src/tools/syntax-highlighting/.gitignore delete mode 100755 src/tools/syntax-highlighting/build.sh create mode 100644 src/vscode/.gitignore rename src/{tools/syntax-highlighting => vscode}/language-configuration.json (100%) create mode 100644 src/vscode/makefile rename src/{tools/syntax-highlighting => vscode}/package.json (100%) rename src/{tools/syntax-highlighting => vscode}/syntaxes/nub.tmLanguage.json (99%) diff --git a/example/compile.sh b/example/compile.sh deleted file mode 100755 index c3a2341..0000000 --- a/example/compile.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -object_files=$(dotnet run --project ../src/compiler/CLI/CLI.csproj src/main.nub src/c.nub) - -echo $object_files - -mkdir -p bin -gcc -o bin/out $object_files diff --git a/example/makefile b/example/makefile new file mode 100644 index 0000000..984c229 --- /dev/null +++ b/example/makefile @@ -0,0 +1,8 @@ +OBJECTS := $(shell dotnet run --project ../src/compiler/CLI/CLI.csproj src/main.nub src/c.nub) + +example: + mkdir -p bin + gcc -o bin/out $(OBJECTS) + +clean: + rm -r bin bin-int diff --git a/src/compiler/CLI/Program.cs b/src/compiler/CLI/Program.cs index 4bed8be..0c7eb8c 100644 --- a/src/compiler/CLI/Program.cs +++ b/src/compiler/CLI/Program.cs @@ -84,7 +84,7 @@ foreach (var file in files) return 1; } - var fileName = $"{Path.GetFileNameWithoutExtension(file)}_{StringRandomizer.GenerateUniqueHexString(8)}.o"; + var fileName = $"{StringRandomizer.GenerateUniqueHexString(8)}_{Path.GetFileNameWithoutExtension(file)}.o"; var objPath = Path.Combine(OUT_DIR, fileName); var asmSuccess = await GCC.Assemble(asm, objPath); if (!asmSuccess) @@ -95,10 +95,7 @@ foreach (var file in files) objectFiles.Add(objPath); } -foreach (var objectFile in objectFiles) -{ - Console.Out.WriteLine(objectFile); -} +Console.Out.WriteLine(string.Join('\t', objectFiles)); return 0; diff --git a/src/tools/syntax-highlighting/.gitignore b/src/tools/syntax-highlighting/.gitignore deleted file mode 100644 index c585e19..0000000 --- a/src/tools/syntax-highlighting/.gitignore +++ /dev/null @@ -1 +0,0 @@ -out \ No newline at end of file diff --git a/src/tools/syntax-highlighting/build.sh b/src/tools/syntax-highlighting/build.sh deleted file mode 100755 index 161b7dd..0000000 --- a/src/tools/syntax-highlighting/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -mkdir -p out -npx vsce package -o out/nub-lang.vsix \ No newline at end of file diff --git a/src/vscode/.gitignore b/src/vscode/.gitignore new file mode 100644 index 0000000..c5e82d7 --- /dev/null +++ b/src/vscode/.gitignore @@ -0,0 +1 @@ +bin \ No newline at end of file diff --git a/src/tools/syntax-highlighting/language-configuration.json b/src/vscode/language-configuration.json similarity index 100% rename from src/tools/syntax-highlighting/language-configuration.json rename to src/vscode/language-configuration.json diff --git a/src/vscode/makefile b/src/vscode/makefile new file mode 100644 index 0000000..f2b1655 --- /dev/null +++ b/src/vscode/makefile @@ -0,0 +1,6 @@ +vscode: + mkdir -p bin + npx vsce package -o bin/nub-lang.vsix + +clean: + rm -r bin \ No newline at end of file diff --git a/src/tools/syntax-highlighting/package.json b/src/vscode/package.json similarity index 100% rename from src/tools/syntax-highlighting/package.json rename to src/vscode/package.json diff --git a/src/tools/syntax-highlighting/syntaxes/nub.tmLanguage.json b/src/vscode/syntaxes/nub.tmLanguage.json similarity index 99% rename from src/tools/syntax-highlighting/syntaxes/nub.tmLanguage.json rename to src/vscode/syntaxes/nub.tmLanguage.json index 2c629c8..7b269e4 100644 --- a/src/tools/syntax-highlighting/syntaxes/nub.tmLanguage.json +++ b/src/vscode/syntaxes/nub.tmLanguage.json @@ -297,4 +297,4 @@ ] } } -} +} \ No newline at end of file