processor / E

Core library for dscript (parser, expressions, etc)
1 stars 1 forks source link

Annotations Syntax #7

Open iamcarbon opened 7 years ago

iamcarbon commented 7 years ago

Annotations allow arbitrary metadata to be assigned to a property or type. They are defined after the formal type or property definition using an @ prefixed named. Each annotation may define a argument list within parenthesis. If parenthesis are used, at least one argument MUST be provided.

Arguments may be named.

Int32 type @primitive @size(4) { }

Point type : Vector3<Number> @size(32) { 
  w: Number @serializable(pack: true, index: 4)
}

Syntax & Expression representations:

AnnotationExpression { arguments: ArgumentSyntax[] ) AnnotationExpressionSyntax { arguments: IArguments }

Special annotations.