mirror of
https://gitee.com/openharmony/third_party_rust_nom
synced 2024-11-27 09:40:54 +00:00
remove main
This commit is contained in:
parent
c8f0ee7b66
commit
f5f535c0f2
42
src/main.rs
42
src/main.rs
@ -1,42 +0,0 @@
|
||||
#![feature(globs,macro_rules)]
|
||||
|
||||
use internal::IResult;
|
||||
use internal::IResult::*;
|
||||
use map::Mapper;
|
||||
use producer::{Producer, FileProducer};
|
||||
use producer::ProducerState::*;
|
||||
use nom::print;
|
||||
|
||||
mod internal;
|
||||
mod map;
|
||||
mod producer;
|
||||
mod nom;
|
||||
|
||||
fn main() {
|
||||
println!("Hello world!");
|
||||
|
||||
fn pr<'a>(res: IResult<(),&'a[u8]>) -> IResult<&'a[u8], ()> {
|
||||
//par.m2(print)
|
||||
Error(0)
|
||||
}
|
||||
|
||||
FileProducer::new("links.txt", 1024).map(|producer: FileProducer| {
|
||||
let mut p = producer;
|
||||
//p.push(|par| par.map(accline).mapf(|v2: &[u8]| str::from_utf8(v2.as_slice())).map(print));
|
||||
/*p.push(|res| {
|
||||
//let p2:IResult<&[u8],&str> = res.mapf(|v2: &[u8]| str::from_utf8(v2.as_slice()));
|
||||
Done((), ())
|
||||
});*/
|
||||
fn pr2(par: IResult<(),&[u8]>) -> IResult<&[u8],()> {
|
||||
par.flat_map(print)
|
||||
}
|
||||
pusher!(ps, pr);
|
||||
ps(&mut p);
|
||||
|
||||
//p.push(|res| { res.flat_map(print) });
|
||||
//p.push(|par| {println!("par: {}", par); par});
|
||||
//p.push(pr);
|
||||
//p.push(|par| { par.map(tag!("https://".as_bytes())).map(print) });
|
||||
});
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user