22 releases (12 breaking)

✓ Uses Rust 2018 edition

new 0.13.0 Dec 3, 2019
0.11.0 Jul 19, 2019
0.8.1 Feb 7, 2019
0.6.0 Nov 2, 2018

#158 in #parser

Download history 68/week @ 2019-08-27 72/week @ 2019-09-03 23/week @ 2019-09-10 222/week @ 2019-09-17 21/week @ 2019-09-24 50/week @ 2019-10-01 63/week @ 2019-10-15 64/week @ 2019-10-22 21/week @ 2019-10-29 23/week @ 2019-11-05 22/week @ 2019-11-12 22/week @ 2019-11-19 50/week @ 2019-11-26

216 downloads per month

MIT license

42KB
1K SLoC

tptp

A crate for reading files in the TPTP format.

Features

  • Streaming zero-copy parser on byte slices
  • Reasonably complete CNF/FOF dialect support

Wishlist

In order of urgency:

  • Complete annotation support
  • TFF/THF support?

Documentation

See docs.rs.


lib.rs:

A crate for reading files in the TPTP format. Supplies TPTP nom parsers for maximum flexibility.

Quickstart

use tptp::parsers::tptp_input_or_eof;

fn example(bytes: &[u8]) {
    let mut position = bytes;
    loop {
        // choose how to perform error handling
        let result: nom::IResult<_, _, ()> = tptp_input_or_eof(position);
        let (next, statement) = result.expect("parse error");

        // EOF
        if statement.is_none() {
            break;
        }
        else {
            // process `statement` as you see fit
        }
        position = next;
    }
}

Dependencies

~700KB
~14K SLoC