visitPassiveSequence method

  1. @override
Parser visitPassiveSequence(
  1. PassiveSequenceExpression node
)
override

Implementation

@override
Parser visitPassiveSequence(PassiveSequenceExpression node) {
  final expressions = node.expressions;
  if (expressions.length == 1) {
    final child = expressions.first;
    final parser = child.accept(this);
    return parser;
  }

  final parsers = <Parser>[];
  for (var i = 0; i < expressions.length; i++) {
    final child = expressions[i];
    final parser = child.accept(this);
    parsers.add(parser);
  }

  return PassiveSequenceParser(parsers, source: '$node');
}