nom-recursive
Extension of nom to handle left recursion.
Requirement
nom must be 5.0.0 or later. nom-recursive can be applied to function-style parser only.
The input type of nom parser must implement HasRecursiveInfo
trait.
Therefore &str
and &[u8]
can't be used.
You can define a wrapper type of &str
or &[u8]
and implement HasRecursiveInfo
.
Alternatively you can use nom_locate::LocatedSpan<T, RecursiveInfo>
.
This implements HasRecursiveInfo
in this crate.
Usage
[]
= "0.5.1"
Example
use *;
use *;
use IResult;
use LocatedSpan;
use ;
// Input type must implement trait HasRecursiveInfo
// nom_locate::LocatedSpan<T, RecursiveInfo> implements it.
type Span<'a> = ;
// Apply recursive_parser by custom attribute
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.