werediver / dart-reptr-rs

Fast code generation for Dart. Eventually. Maybe.
MIT License
5 stars 3 forks source link

Parse annotations #40

Closed werediver closed 1 year ago

werediver commented 1 year ago

From Intro to Dart, Metadata:

Metadata can appear before a library, class, typedef, type parameter, constructor, factory, function, field, parameter, or variable declaration and before an import or export directive.

From Dart lang spec, Metadata:

It is a compile-time error if [the annotation expression] e is not one of the following:

  • A reference to a constant variable.
  • A call to a constant constructor.

The expression e occurs in a constant context (17.3.2), which means that const modifiers need not be specified explicitly.