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
|
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
|
||||||
|
|||||||
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
|
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
|
.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
|
||||||
@@ -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": [
|
||||||
{
|
{
|
||||||
Reference in New Issue
Block a user