visitLiteralExpr method

  1. @override
void visitLiteralExpr(
  1. LiteralExpr ast,
  2. EmitterVisitorContext context
)
override

Implementation

@override
void visitLiteralExpr(o.LiteralExpr ast, EmitterVisitorContext context) {
  var value = ast.value;
  if (value is String) {
    context.print(escapeSingleQuoteString(value, _escapeDollarInStrings)!);
  } else if (value is o.EscapedString) {
    context.print("'${value.value}'");
  } else if (value == null) {
    context.print('null');
  } else {
    context.print('$value');
  }
}