operator [] method

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

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

Implementation

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;
  }
}