Merge pull request #8 from birth-software/arguments

Primitive function calls
This commit is contained in:
David 2024-07-06 16:18:20 +02:00 committed by GitHub
commit f6ddf827f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 991 additions and 425 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
build/ build/
*.data

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ function compile()
mkdir -p $build_dir mkdir -p $build_dir
compile_command="time clang++ -o $build_dir/$exe_name $debug_info $optimizations -std=gnu++20 -Wall -Wextra -Wpedantic -Wno-nested-anon-types -pedantic -fno-exceptions -fno-stack-protector -ferror-limit=1 -MJ $build_dir/compile_commands.json" compile_command="clang++ -o $build_dir/$exe_name $debug_info $optimizations -std=gnu++20 -Wall -Wextra -Wpedantic -Wno-nested-anon-types -pedantic -fno-exceptions -fno-stack-protector -ferror-limit=1 -MJ $build_dir/compile_commands.json"
case "$OSTYPE" in case "$OSTYPE" in
darwin*) ;; darwin*) ;;
@ -18,6 +18,6 @@ function compile()
esac esac
compile_command="$compile_command bootstrap/main.cpp" compile_command="$compile_command bootstrap/main.cpp"
echo $compile_command echo -e "\x1b[36m$compile_command\x1b[0m"
eval $compile_command eval "time $compile_command"
} }

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -ex set -e
source ./compile.sh source ./compile.sh
compile "build" "nest" "-g" ""; compile "build" "nest" "-g" "";
build/nest build/nest

View File

@ -0,0 +1,10 @@
fn foo(arg: s32) s32
{
return arg;
}
fn[cc(.c)] main [export] () s32
{
>arg: s32 = 6;
return foo(arg) - arg;
}