withChildren method
Rebuilds itself with a new list of child nodes. The order and number of child nodes must match the return value of children. Leaf nodes return themselves.
Implementation
@override
LatexNode withChildren(List<LatexNode> newChildren) {
final beginSize = beginDef.length;
return NewEnvironmentNode(
envName,
numArgs,
newChildren.sublist(0, beginSize),
newChildren.sublist(beginSize),
defaultArg: defaultArg,
sourceRange: sourceRange,
);
}