-
Since commit 2f2d8cf, efforts have begun to completely redesign the existing lexer and parser, with the new code currently residing in the `nix-parser2` directory.
## Existing pain points
### Le…
-
nom 7.1.2 provides a `map_res` combinator but I ended up with a common pattern not ideally handled by `map_res(parser, f)`:
* `parser` deals with the context-free syntactic parse
* `f` does some val…
-
You can fail a parse by providing a closure to map_parser that returns
```
Err(nom::Err::Failure(nom::error::Error {
input: i,
code: nom::error::ErrorKind::Permutation,
}))
```
B…
-
This issue aims to implement a unified parser that replaces `nom` and `syn::parse`:
1. Accepts both `proc_macro2::TokenStream` and `String` as input
2. Preserves location information in both `proc…
-
Hello, first of all thank you, nom is a great tool!
I have tried to migrate to a new nom version (7.0.0) and encountered some unexpected behavior.
- parsing of floating point numbers (`float`, `do…
-
[Henlo](https://phaazon.net/media/uploads/hello_i_am_dog.gif),
In [glsl](https://crates.io/crates/glsl), I had to add several useful combinators and pretty _primitive_ parsers in order to completel…
-
`nom::traits` is private. In order to implement generic parsers, it would be helpful to have access to the type defs.
Or there is another way that I don't know?
## Prerequisites
Here are a fe…
-
Combinators such as `many1` explicitly state they fail if the input parser accepts empty inputs. For this reason, most parsers like `is_not` fail on empty inputs.
However, `escaped` immediately ret…
-
If you write a parser that returns a constant string in the first tuple position, and you pass that to recognize, you can crash in a very strange way. The reason is pretty obvious now that I tracked i…
mullr updated
2 years ago
-
Code
```
fn check_file(path: &str) {
let content = match fs::read(&path) {
Ok(content) => content,
Err(e) => {
println!("{e}");
return;
}
…