parseNodes method

List<Node> parseNodes({
  1. required Set<String> stopAt,
})

Parses nodes until end-of-file or a directive named in stopAt.

Stop directives are not consumed, allowing the enclosing directive parser to handle them.

Implementation

List<Node> parseNodes({required Set<String> stopAt}) {
  final nodes = <Node>[];
  while (_current.type != _TokenType.eof) {
    if (_current.type == _TokenType.directive &&
        stopAt.contains(_current.name)) {
      break;
    }
    nodes.add(_parseNode());
  }
  return nodes;
}