move hide behind @ and specify with :

This commit is contained in:
2026-08-10 22:45:41 +02:00
parent 5244bfbf1b
commit ba6052eef3
27 changed files with 162 additions and 149 deletions
+10 -6
View File
@@ -208,14 +208,18 @@ mem :: import "@std/mem"
value :: math.sum(other_math.value, 1)
```
Top-level declarations are public by default. Prefix a declaration with bare `hide`
to make it package-local, or spell the scope explicitly with `hide(package)` or
`hide(file)`. Leading underscores have no visibility meaning. Imports are always
file-local and cannot use visibility modifiers or be re-exported:
Top-level declarations are public by default. Prefix a declaration with bare `@hide`
to make it package-local, or spell the scope explicitly with `@hide:package` or
`@hide:file`. The qualifier is contextual, so `hide`, `package`, and `file` remain
available as identifiers. Imports are always file-local and cannot use visibility
qualifiers or be re-exported:
```bro
hide shared_helper func() i32 { return 42 }
hide(file) implementation_detail func() i32 { return shared_helper() }
@hide
shared_helper func() i32 { return 42 }
@hide:file
implementation_detail func() i32 { return shared_helper() }
```
Current prototype features: