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
nub example | qbe > out.s
mkdir -p bin-int bin
rm -rf bin-int/* bin/*
gcc -nostartfiles -no-pie \
out.s \
src/runtime/baseline/entry.s \
src/runtime/baseline/nub_memcpy.s \
src/runtime/baseline/nub_memset.s \
src/runtime/baseline/nub_panic.s \
src/runtime/baseline/nub_strcmp.s \
nub example | qbe | as -o bin-int/out.o
find src/runtime -name '*.s' | while read -r file; do
as "$file" -o "bin-int/$(basename "${file}" .s).o"
done
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

View File

@@ -40,4 +40,4 @@ export func main(args: []^string): i64 {
return 0
}
}

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
core_syscall:
movq rax, rdi
movq rdi, rsi
movq rsi, rdx
movq r10, rcx
mov rax, rdi
mov rdi, rsi
mov rsi, rdx
mov r10, rcx
syscall
ret

View File

@@ -74,9 +74,12 @@
},
"types": {
"patterns": [
{
"include": "#function-type"
},
{
"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",
@@ -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": {
"patterns": [
{