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
+7 -7
View File
@@ -14,7 +14,7 @@ types. C primitives use atomic target-dependent names and remain semantically
distinct from exact-width Brolang primitives:
```bro
strlen :: c_func(value *c_char) c_ulong
strlen c_func(value *c_char) c_ulong
```
Additional native inputs and libraries are passed to the final `zig cc`
@@ -35,7 +35,7 @@ Relative `.h` imports create synthetic package namespaces backed by libclang:
```bro
native :: import "../include/native.h"
main :: func() void {
main func() void {
_ = native.imported_add(20, 22)
}
```
@@ -63,11 +63,11 @@ from Brolang requires an explicit unwrap:
```bro
native :: import "../include/native.h"
double :: c_func(value c_int) c_int {
double 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)
}
```
@@ -75,16 +75,16 @@ call_mapper :: func(mapper native.Imported_Mapper) c_int {
Bodyless manual and imported C functions may be variadic:
```bro
log_values :: c_func(tag c_int, ...) c_int
log_values c_func(tag c_int, ...) c_int
```
Zero-terminated byte strings can be passed directly to immutable C character
pointers without making `u8` and `c_char` generally interchangeable:
```bro
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)
}
```