visitLiteralSetExpression method

  1. @override
StringSink visitLiteralSetExpression(
  1. LiteralSetExpression expression, [
  2. StringSink? output
])
inherited

Implementation

@override
StringSink visitLiteralSetExpression(
  LiteralSetExpression expression, [
  StringSink? output,
]) {
  final out = output ??= StringBuffer();

  return _writeConstExpression(output, expression.isConst, () {
    if (expression.type != null) {
      out.write('<');
      expression.type!.accept(this, output);
      out.write('>');
    }
    out.write('{');
    visitAll<Object?>(expression.values, out, (value) {
      _acceptLiteral(value, out);
    });
    if (expression.values.length > 1) {
      out.write(', ');
    }
    return out..write('}');
  });
}