whitehole 0.8.0

A simple, fast, intuitive parser combinator framework for Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::common::{number, string, whitespaces};
use in_str::in_str;
use whitehole::{
  action::Action,
  combinator::{next, Combinator},
};

pub fn lexer_entry() -> Combinator<impl Action<Text = str, State = (), Heap = (), Value = ()>> {
  let boundary = next(in_str!("[]{}:,"));

  whitespaces() | boundary | number() | string() | "true" | "false" | "null"
}