#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

#2490 in Parser implementations

41 downloads per month

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
~42K SLoC