cleanup repo

This commit is contained in:
nub31
2025-06-10 22:09:45 +02:00
parent fb391c9fb2
commit 9f48f2cd9b
12 changed files with 59 additions and 27 deletions

View File

@@ -1,3 +0,0 @@
BasedOnStyle: Chromium
IndentWidth: 4
ColumnLimit: 120

4
.gitignore vendored
View File

@@ -1 +1,3 @@
tools/syntax-highlighting/out src/tools/syntax-highlighting/out
bin
bin-int

BIN
a.out

Binary file not shown.

View File

@@ -3,12 +3,13 @@ set -e
dotnet build src/lang/Nub.Lang.CLI dotnet build src/lang/Nub.Lang.CLI
nub example | qbe > out.s mkdir -p bin-int bin
rm -rf bin-int/* bin/*
gcc -nostartfiles -no-pie \ nub example | qbe | as -o bin-int/out.o
out.s \
src/runtime/baseline/entry.s \ find src/runtime -name '*.s' | while read -r file; do
src/runtime/baseline/nub_memcpy.s \ as "$file" -o "bin-int/$(basename "${file}" .s).o"
src/runtime/baseline/nub_memset.s \ done
src/runtime/baseline/nub_panic.s \
src/runtime/baseline/nub_strcmp.s \ gcc -nostartfiles -o bin/out bin-int/*.o

View File

@@ -1,5 +0,0 @@
#!/bin/bash
set -e
./clean.sh
./build.sh
gdb -tui ./out/program

4
run.sh
View File

@@ -1,4 +0,0 @@
#!/bin/bash
set -e
./build.sh
bash -c './out/program; echo "Process exited with status code $?"'

View File

@@ -3,9 +3,9 @@
.section .text .section .text
core_syscall: core_syscall:
movq rax, rdi mov rax, rdi
movq rdi, rsi mov rdi, rsi
movq rsi, rdx mov rsi, rdx
movq r10, rcx mov r10, rcx
syscall syscall
ret ret

View File

@@ -74,9 +74,12 @@
}, },
"types": { "types": {
"patterns": [ "patterns": [
{
"include": "#function-type"
},
{ {
"name": "storage.type.primitive.nub", "name": "storage.type.primitive.nub",
"match": "\\b(i8|i16|i32|i64|u8|u16|u32|u64|f32|f64|bool|void|any)\\b" "match": "\\b(i8|i16|i32|i64|u8|u16|u32|u64|f32|f64|bool|string|void|any)\\b"
}, },
{ {
"name": "storage.type.array.nub", "name": "storage.type.array.nub",
@@ -88,6 +91,44 @@
} }
] ]
}, },
"function-type": {
"patterns": [
{
"begin": "\\b(func)\\s*\\(",
"beginCaptures": {
"1": {
"name": "storage.type.function.nub"
}
},
"end": "(?<=\\))(?:\\s*:\\s*([^\\s,;{}()]+))?",
"endCaptures": {
"1": {
"name": "storage.type.nub"
}
},
"patterns": [
{
"include": "#function-type-parameters"
}
]
}
]
},
"function-type-parameters": {
"patterns": [
{
"match": "\\.\\.\\.",
"name": "keyword.operator.variadic.nub"
},
{
"include": "#types"
},
{
"match": ",",
"name": "punctuation.separator.nub"
}
]
},
"strings": { "strings": {
"patterns": [ "patterns": [
{ {