parseUtf8Bytes method
TreeSitterTree
parseUtf8Bytes(
- Uint8List bytes, {
- TreeSitterTree? oldTree,
- Iterable<
TreeSitterInputEdit> edits = const [], - bool annotateLocals = true,
Parses exact UTF-8 bytes without normalizing malformed input through a
Dart String. Every public byte range remains relative to bytes.
Implementation
TreeSitterTree parseUtf8Bytes(
Uint8List bytes, {
TreeSitterTree? oldTree,
Iterable<TreeSitterInputEdit> edits = const [],
bool annotateLocals = true,
}) {
try {
final result = _parseSource(
utf8.decode(bytes, allowMalformed: true),
Uint8List.fromList(bytes),
oldTree: oldTree,
edits: edits,
annotateLocals: annotateLocals,
);
_hasOutstandingParse = false;
return result;
} on GeneratedTreeSitterParseHalted {
_hasOutstandingParse = true;
throw const TreeSitterParseHaltedException();
}
}