no :: in func decls

This commit is contained in:
2026-06-30 19:31:26 +02:00
parent ae5af37b85
commit 07c560b750
107 changed files with 580 additions and 520 deletions
+3 -3
View File
@@ -3,8 +3,8 @@ Buffer :: c_struct {
length c_ulong
}
get_buffer :: c_func() @Buffer
verify :: c_func(
get_buffer c_func() @Buffer
verify c_func(
char_value c_char,
schar_value c_schar,
uchar_value c_uchar,
@@ -21,7 +21,7 @@ verify :: c_func(
longdouble_value c_longdouble,
) i32
main :: func() i32 {
main func() i32 {
buffer @Buffer :: get_buffer()
_ = buffer^.data
_ = buffer^.length
+5 -5
View File
@@ -1,22 +1,22 @@
native :: import "../include/native.h"
pass_alias :: func(value native.imported_int_alias) native.imported_int {
pass_alias func(value native.imported_int_alias) native.imported_int {
return value
}
double_value :: c_func(value c_int) c_int {
double_value c_func(value c_int) c_int {
return value + value
}
call_mapper :: func(mapper native.Imported_Mapper) c_int {
call_mapper func(mapper native.Imported_Mapper) c_int {
return mapper?(21)
}
enum_identity :: c_func(value native.Imported_Enum) native.Imported_Enum {
enum_identity c_func(value native.Imported_Enum) native.Imported_Enum {
return value
}
main :: func() void {
main func() void {
_ = native.imported_add(pass_alias(20), 22)
_ = native.imported_scalar(3, 4)
_ = native.child_value(7)
+1 -1
View File
@@ -1,4 +1,4 @@
first :: import "../header/include/native.h"
second :: import "../header/include/native.h"
main :: func() void {}
main func() void {}
+1 -1
View File
@@ -1,7 +1,7 @@
first :: import "first.h"
second :: import "second.h"
main :: func() void {
main func() void {
_ = first.conflict_global
_ = second.conflict_global
}
+1 -1
View File
@@ -1,7 +1,7 @@
native :: import "../header/include/native.h"
child :: import "../header/include/child.h"
main :: func() void {
main func() void {
_ = native.child_value(1)
_ = child.child_value(2)
native.child_shared_global = 7
@@ -1,5 +1,5 @@
native :: import "native.h"
main :: func() void {
main func() void {
_ = native.main
}
@@ -1,7 +1,7 @@
variable :: import "variable.h"
function :: import "function.h"
main :: func() void {
main func() void {
_ = variable.conflict_symbol
_ = function.conflict_symbol()
}
+5 -5
View File
@@ -1,11 +1,11 @@
native :: import "../header/include/native.h"
use_callback :: c_func(value native.Imported_Callback) void
use_union :: c_func(value native.Imported_Union) void
use_enum :: c_func(value native.Imported_Enum) void
use_opaque :: c_func(value native.Imported_Handle) void
use_callback c_func(value native.Imported_Callback) void
use_union c_func(value native.Imported_Union) void
use_enum c_func(value native.Imported_Enum) void
use_opaque c_func(value native.Imported_Handle) void
main :: func() void {
main func() void {
_ = native.IMPORTED_BAD_EXPR
_ = native.IMPORTED_REDEFINED_BAD
_ = native.IMPORTED_GONE
@@ -1,5 +1,5 @@
native :: import "native.h"
main :: func() void {
main func() void {
_ = native.write
}
+2 -2
View File
@@ -1,5 +1,5 @@
foreign_add :: c_func(a, b i32) i32
foreign_add c_func(a, b i32) i32
main :: func() i32 {
main func() i32 {
return foreign_add(20, 22)
}
+2 -2
View File
@@ -1,5 +1,5 @@
printf :: c_func(format *c_char, ...) c_int
printf c_func(format *c_char, ...) c_int
main :: func() void {
main func() void {
_ = printf("answer: %d\n", 42)
}
+4 -4
View File
@@ -4,21 +4,21 @@ Manual :: c_struct {
value c_int
}
mirror_manual :: c_func(value Manual) Manual {
mirror_manual c_func(value Manual) Manual {
return value
}
mirror_large :: c_func(value native.Large) native.Large {
mirror_large c_func(value native.Large) native.Large {
return value
}
native_pair :: func(value native.Pair) native.Pair {
native_pair func(value native.Pair) native.Pair {
return value
}
global_pair native.Pair :: native.Pair { left = 1, right = 2 }
main :: func() i32 {
main func() i32 {
pair native.Pair = native_pair(global_pair)
pair.left = 10
pair = native.echo_pair(pair)
+1 -1
View File
@@ -4,7 +4,7 @@ native :: import "../include/native.h"
# the importer must not recurse forever populating it, and the checker must accept the
# self-referential `?*mut Node` field as C-layout-compatible.
main :: func() i32 {
main func() i32 {
node native.Node = native.Node { next = none, value = 7 }
if node.next |_| {
return 1