writeAroundPrecedence method Null safety

void writeAroundPrecedence(
  1. GenerationContext context,
  2. Precedence precedence
)

Writes this expression into the GenerationContext, assuming that there's an outer expression with precedence. If the Expression.precedence of this expression is lower, it will be wrap}ped in

See also:

Implementation

void writeAroundPrecedence(GenerationContext context, Precedence precedence) {
  if (this.precedence < precedence) {
    context.buffer.write('(');
    writeInto(context);
    context.buffer.write(')');
  } else {
    writeInto(context);
  }
}