writeAroundPrecedence method
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:
- Component.writeInto, which doesn't take any precedence relation into account.
Implementation
void writeAroundPrecedence(GenerationContext context, Precedence precedence) {
if (this.precedence < precedence) {
context.buffer.write('(');
writeInto(context);
context.buffer.write(')');
} else {
writeInto(context);
}
}