Skip to content

ProbablyClem/string_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

string_parser

Rust string parsing crate

Usage :

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");

About

Rust string parsing lcrate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published