https://github.com/probablyclem/string_parser
Rust string parsing lcrate
https://github.com/probablyclem/string_parser
Last synced: 9 months ago
JSON representation
Rust string parsing lcrate
- Host: GitHub
- URL: https://github.com/probablyclem/string_parser
- Owner: ProbablyClem
- Created: 2020-07-10T11:26:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-18T17:27:32.000Z (almost 6 years ago)
- Last Synced: 2025-08-08T05:46:30.928Z (11 months ago)
- Language: Rust
- Size: 7.52 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# string_parser
## Rust string parsing crate
### Doc : https://crates.io/crates/string-parser
### Usage :
```Rust
use std::rc::Rc;
extern crate string_parser;
use string_parser::Parser;
fn end_filter(c : Vec) -> 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");
```