begin method

  1. @override
void begin(
  1. TagContext tc,
  2. String data
)
override

Called when the beginning of a tag is encountered.

Implementation

@override
void begin(TagContext tc, String data) {
  if (data.isEmpty)
    tc.error("The $name tag requires a condition");

  String beg, end;
  if (data.startsWith('(') && data.endsWith(')')) {
    beg = end = "";
  } else {
    beg = needsVar_ ? "(var ": "(";
    end = ")";
  }
  tc.writeln("\n${tc.pre}$name $beg$data$end {${tc.getLineNumberComment()}");
  tc.indent();
}