use std::rc::Rc;
extern crate string_parser;
use string_parser::Parser;
fn end_filter(c : Vec<char>) -> bool{
if c.last().unwrap()== &'\'' {
return true;
}
else {
return false;
}
}
//can also use closures
let callback = |s : String, line : usize, file : &str| {
assert_eq!(String::from("foo"), s);
};
let mut string_parser = Parser::new();
string_parser.add(String::from("'"), Rc::new(Box::from(end_filter)), Rc::new(Box::from(callback)));
string_parser.parse("./text");
-
Notifications
You must be signed in to change notification settings - Fork 0
ProbablyClem/string_parser
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Rust string parsing lcrate
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published