parse method Null safety

Future<RootNode> parse(
  1. RootNode rootNode
)

replaces all child Nodes in the RootNode according to the rules Note that this starts all over at the first rule when nodes where found and replaced. Throws a ParseWarning when there where warnings

Implementation

Future<RootNode> parse(RootNode rootNode) async {
  List<ParserWarning> warnings = [];
  rootNode.resetLastCompletedRuleIndexes();
  rootNode = await _findAndReplaceNodes(rootNode, warnings);
  if (warnings.isNotEmpty) throw new ParserWarning(warnings.join('\n'));
  return rootNode;
}