Annotations

Annotation = @( "@" QualifiedIdent ) [ "(" AnnotationArgs ")" ]
AnnotationArgs = {lexpr} { "," {lexpr} } [ "," ]
NoteTODO: document this

Declaration

NoteTODO: document this
Note

Since annotations are just shapes, that are stored in the type data, you can instantiate them just like normal shapes. To disable this behaviour, you can use multiple approaches:

  • Annotate the custom annotation or the constructor(s) with @not_instantiable

  • Enable the compiler option annotation_not_instantiable for the current file with {$push annotation_not_instantiable}

Builtin annotations

Some annotations are buildin into the compiler:

  • @annotation to declare a annotation

  • @not_instantiable to make a annotation (or constructor of them) not instantiable from normal code via new.

  • @no_mangle to not apply any name mangeling to a function

NoteTODO: document this

Accessing

NoteTODO: document this

Placement

NoteTODO: document this
AnnotatedTopLevelDecl = { Annotation } TopLevelDecl ;

AnnotatedStmnt = { Annotation } Statement ;

AnnotatedType = { Annotation } Type ;

Declaration Examples

Type examples

back to top