nom 0.1.2

A byte oriented, zero copy, parser combinators library
docs.rs failed to build nom-0.1.2
Please check the build logs and, if you believe this is docs.rs' fault, open an issue.

Nom, eating data byte by byte

The goal is to make a parser combinator library that is safe, supports streaming (push and pull), and as much as possible zero copy.

The code is available on Github

Example

 use std::str;
 fn local_print<'a,T: Debug>(input: T) -> IResult<T, ()> {
   println!("{:?}", input);
   Done(input, ())
 }
 // create a data producer from a file
 FileProducer::new("links.txt", 20).map(|producer: FileProducer| {
   let mut p = producer;

   // create the parsing function
   fn parser(par: IResult<(),&[u8]>) -> IResult<&[u8],()> {
     // convert byte array to a string, then print it
     par.map_res(str::from_utf8).flat_map(local_print);

     // return a dummy answer
     Done("".as_bytes(), ())
   }

   // adapt the parsing function to the producer
   pusher!(push, parser);
   // get started
   push(&mut p);
 });