parseOrNull method
TreeSitterTree?
parseOrNull(
- String source, {
- TreeSitterTree? oldTree,
- Iterable<
TreeSitterInputEdit> edits = const [], - bool annotateLocals = true,
Native Parser::parse result semantics for an unbound parser.
The established non-null parse convenience remains available to code that constructs the parser with a language. This method returns null for the upstream no-language failure case instead of throwing.
Implementation
TreeSitterTree? parseOrNull(
String source, {
TreeSitterTree? oldTree,
Iterable<TreeSitterInputEdit> edits = const [],
bool annotateLocals = true,
}) {
_checkNotDisposed();
if (_grammar == null) return null;
return parse(
source,
oldTree: oldTree,
edits: edits,
annotateLocals: annotateLocals,
);
}