withChildren method

  1. @override
LatexNode withChildren(
  1. List<LatexNode> newChildren
)
override

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) {
  int idx = 0;
  final newPreSup = preSuperscript != null ? newChildren[idx++] : null;
  final newPreSub = preSubscript != null ? newChildren[idx++] : null;
  final newBase = newChildren[idx];
  return PrescriptNode(
    newBase,
    preSuperscript: newPreSup,
    preSubscript: newPreSub,
    sourceRange: sourceRange,
  );
}