#pgn #lexer #chess #tokenizer

pgn-lexer

A lexer for PGN files for chess. Provides an iterator over the tokens from a byte stream.

3 unstable releases

0.2.0-alpha Dec 25, 2020
0.1.1 Sep 5, 2017
0.1.0 Sep 4, 2017

#2600 in Parser implementations

GPL-3.0

40KB
823 lines

PGN Tokenizer

Goals

  • Use zero-copy byte slices all the way through.
  • No heap allocations

API

  • A token based iterator that takes a byte slices and returns tokens that reference sub-slices

Example

This example counts the number of games in a PGN file.

Dependencies

~2MB
~45K SLoC