visitAttribute method

  1. @override
void visitAttribute(
  1. AttributeAst astNode, [
  2. StringBuffer? context
])

Visits all attribute ASTs.

Implementation

@override
void visitAttribute(AttributeAst astNode, [StringBuffer? context]) {
  if (astNode.mustaches != null && astNode.mustaches!.isNotEmpty) {
    CompileContext.current.reportAndRecover(BuildError.forSourceSpan(
      astNode.sourceSpan,
      "Interpolations aren't permitted in internationalized messages",
    ));
    return;
  }
  context!.write(' ${astNode.name}');
  if (astNode.quotedValue != null) {
    context.write('=${astNode.quotedValue}');
  }
}