operator [] method

  1. @override
dynamic operator [](
  1. String attributeName
)

The AST node will have the attribute names as strings, so we translate between those and the fields of the class.

Implementation

@override
dynamic operator [](String attributeName) {
  switch (attributeName) {
    case 'desc':
      return description;
    case 'examples':
      return examples;
    case 'name':
      return name;
    // We use the actual args from the parser rather than what's given in the
    // arguments to Intl.message.
    case 'args':
      return [];
    case 'meaning':
      return meaning;
    case 'skip':
      return skip;
    default:
      return null;
  }
}