decode static method

Implementation

static TreeSitterLanguageBundle decode(Uint8List bytes) {
  final reader = _BinaryReader(bytes);
  for (final expected in _magic) {
    if (reader.byte() != expected) {
      throw const FormatException(
        'Unsupported binary Tree-sitter table format',
      );
    }
  }
  final result = TreeSitterLanguageBundle(
    source: TreeSitterGrammarRevision(
      repository: reader.string(),
      revision: reader.string(),
      subpath: reader.nullableString(),
    ),
    parserSha256: reader.string(),
    language: _readLanguage(reader),
  );
  reader.expectEnd();
  return result;
}