replace leading _ for private symbols with keyword hide

This commit is contained in:
2026-07-14 20:19:01 +02:00
parent 5157cf3bcc
commit 267947e79d
31 changed files with 125220 additions and 122709 deletions
+9
View File
@@ -177,6 +177,15 @@ mem :: import "@std/mem"
value :: math.sum(other_math.value, 1)
```
Top-level declarations are public by default. Prefix a declaration with `hide`
to keep it local to its source file; leading underscores have no visibility
meaning. Imports are always file-local and cannot be hidden or re-exported:
```bro
hide helper func() i32 { return 42 }
hide State :: struct { value i32 }
```
Current prototype features:
- Newline-terminated, multiline statements; `}` may terminate a block's final statement