Skip to content

Loara-crates/minparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minparser

Simple parsing functions

This crate is a collection of objects and algorithms shared among different crates that needs to implement a parser.

Usage example

use minparser::prelude::*;
let view = ViewFile::new_default("My string   value");
let (step, mtc) = view.match_tool_string("My string").unwrap();
assert_eq!(mtc, "My string");
assert_eq!(step.get_view(), "   value"); 
let step = step.match_tool(minparser::utils::WhiteTool).unwrap();   // Use the WhiteTool tool to
assert_eq!(step.get_view(), "value");                               //match a sequence of whitespaces
assert!(step.match_tool('a').is_err()); // A missing match is an error

Links

About

Simple parsing functions shared between multiple projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages