dispatch method

LatexNode? dispatch(
  1. String cmdName,
  2. LatexParserContext ctx,
  3. LatexTokenStream stream
)

Attempts to dispatch a command. If registered, calls the handler and returns the result; if unregistered, returns null (allowing the caller to fall back to default handling).

Implementation

LatexNode? dispatch(
  String cmdName,
  LatexParserContext ctx,
  LatexTokenStream stream,
) {
  final handler = _handlers[cmdName];
  if (handler == null) return null;
  return handler(cmdName, ctx, stream);
}