Decorators
The declaration forms and annotations rasc understands — unknown decorators are ignored rather than rejected.
| Decorator | Meaning |
|---|---|
struct | plain-old-data type with flattened representation — see Structs & Refs |
FixedArray<T, N> | fixed-size value elements embedded flat in a field’s owner — see Value Arrays |
@inline | guaranteed inlining under -O
regardless of size (recursion excluded); in every build, a call that
leaves out constant i32 defaults deciding an if,
or passes integer literals for them, reaches a copy with those
ifs folded, so code only other values reach never links,
and only rasc check type checks it until some call reaches
it. Any other argument keeps every branch |
@unchecked | every element access in the class
or function reads as unchecked() under -O, so hot
loops skip bounds checks; debug builds stay checked |
@unmanaged | raw struct: no GC header, no rtId; works
with changetype and pointer arithmetic. new takes
memory no frame boundary reclaims, until __free releases it,
so W3006 flags one a function
makes without storing, returning or freeing it. Nothing traces its
fields, so under the frame runtime new of one holding a
string, closure or managed reference is an error. Without an rtId it
has nothing to dispatch on, so it cannot extend or be extended by a
managed class, implement an interface, or override a method |
operator members | operator overloads are C++-style
members on classes and structs alike — operator[](i),
operator[]=(i, v), unchecked operator[] (the
unchecked() fast path), operator==,
static operator+(l, r). rasc has no @operator decorator — operators are ordinary
members; see Methods &
Constructors |
@external("mod", "name") | bind a declare to a specific import module and field — see Host Bindings |
@editTime | the declaration exists only when the
compiler runs with edit time on (rasc --edit-time, the editor
and rive --test); a runtime bake drops it before anything
registers, and runtime code that names it is an error (E3002). Valid on a
class, a function, or the whole module as a bare @editTime;
at file level; the bare form inside a namespace block marks that block
alone, not other blocks of the same namespace. A class extending an edit
time class is edit time too.
Rive’s test harness (rive/test, the Tests
base) is declared this way, so suites never ship in a
.riv |
@builtin | calls compile to compiler intrinsics (how the stdlib bottoms out) |
Unknown decorators are ignored rather than rejected.