cleanup repo
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
BasedOnStyle: Chromium
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 120
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
tools/syntax-highlighting/out
|
||||
src/tools/syntax-highlighting/out
|
||||
bin
|
||||
bin-int
|
||||
|
||||
17
build.sh
17
build.sh
@@ -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
|
||||
|
||||
5
debug.sh
5
debug.sh
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
./clean.sh
|
||||
./build.sh
|
||||
gdb -tui ./out/program
|
||||
@@ -40,4 +40,4 @@ export func main(args: []^string): i64 {
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
4
run.sh
4
run.sh
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
./build.sh
|
||||
bash -c './out/program; echo "Process exited with status code $?"'
|
||||
@@ -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
|
||||
@@ -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": [
|
||||
{
|
||||
Reference in New Issue
Block a user