register static method

void register(
  1. String name,
  2. dynamic creator(
    1. List<ASTNode>,
    2. List<Filter>
    )
)

Registers a new tag with the given name and creator function.

If the created tag implements CustomTagParser, it's also added to _customTagParsers.

Implementation

static void register(
    String name, Function(List<ASTNode>, List<Filter>) creator) {
  _tags[name] = creator;

  final creatorInstance = creator([].cast<ASTNode>(), [].cast<Filter>());
  if (creatorInstance is CustomTagParser) {
    _customTagParsers[name] = creatorInstance;
  }
}