visitMatrix method

  1. @override
String visitMatrix(
  1. MatrixNode node
)
override

Implementation

@override
String visitMatrix(MatrixNode node) {
  final (open, close) = switch (node.type) {
    MatrixType.paren => ("(", ")"),
    MatrixType.bracket => ("[", "]"),
    MatrixType.brace => ("{", "}"),
    MatrixType.vbar => ("|", "|"),
    MatrixType.doubleVbar => ("‖", "‖"),
    MatrixType.plain => ("", ""),
  };

  final table = _buildTable(node.rows);
  return open.isNotEmpty
      ? _mrow("<mo>$open</mo>$table<mo>$close</mo>")
      : table;
}