parse method

TreeSitterTree parse(
  1. String source, {
  2. TreeSitterTree? oldTree,
  3. Iterable<TreeSitterInputEdit> edits = const [],
  4. bool annotateLocals = true,
})

Implementation

TreeSitterTree parse(
  String source, {
  TreeSitterTree? oldTree,
  Iterable<TreeSitterInputEdit> edits = const [],
  bool annotateLocals = true,
}) {
  try {
    final result = _parseSource(
      source,
      Uint8List.fromList(utf8.encode(source)),
      oldTree: oldTree,
      edits: edits,
      annotateLocals: annotateLocals,
    );
    _hasOutstandingParse = false;
    return result;
  } on GeneratedTreeSitterParseHalted {
    _hasOutstandingParse = true;
    throw const TreeSitterParseHaltedException();
  }
}