Annotations & directives
An annotation is a @ line that attaches to the declaration below it. It
does not run. It tells the compiler a fact about that declaration: that it
is exported, that it is a command-line program, that a kernel, compiler
lane, or capability applies.
The generic shape is @ plus a name, optionally with fields in braces.
@ public marks a function an importer can see. @ cli names the binary
a package produces. The same family covers @ radix, @ call, and the
accepted legacy kernel annotation @ kernel — specialized directives most
source meets later. The table below lists the words those directives use.
@ public
fn saluta(string nomen) → string {
return "Salve, §!"(nomen)
}A command-line entry uses the same @ shape above main args:
@ cli { name = "echo" }
@ description "Prints text"
@ operand { rest = true, type = string, binding = words }
main args argv {
for from argv.words let word {
print word
}
}Return to the grammar overview.
Terms#
These are the words you write in this part of the language. Each links to its page. The second column names the grammar rule the word belongs to.
| Term | Grammar rule |
|---|---|
kernel | nucleum_sugar |
kernel | nucleum_braced |
false, true | nucleum_field |
mut, type | radix_directive |
call | ad_annotation |
unstable, unstable | nondum_annotation |
Formal grammar#
The rules for this part of the language are the parser's own definition of it. They are written for models and tools, so this page does not repeat them; the full list is at every production.