nom Questions

2

Solved

I'd like to parse both of these with nom: [ a, b, c ] [ a, b, c, ] Currently I have this code which parses the first but not the second (the first function is a recipe from the nom docs...
Spirketing asked 3/1, 2022 at 8:6

2

Solved

A CSV style quoted string, for the purposes of this question, is a string in which: The string starts and ends with exactly one ". Two double quotes inside the string are collapsed to one double ...
Rufous asked 7/6, 2018 at 11:55

3

Solved

I've created a few non-trivial parsers in nom, so I'm pretty familiar with it at this point. All the parsers I've created until now always provide the entire input slice to the parser. I'd like to...
Guesstimate asked 22/10, 2017 at 17:6

3

Solved

Using the nom crate, I'm trying to write a parser that can recognize signed i32 number from a String, i.e. can transform the string -42 into the i32 representation. So far I've come up with the fo...
Laryngo asked 17/2, 2019 at 17:16

2

It's easy to use nom to parse a string until a character is found. How to use nom to gobble a string until a delimiter or the end? deals with this. How do I do the same with a string (multiple char...
Pushup asked 22/12, 2021 at 15:28

1

Solved

How should I parse a quoted string similar to rust's raw strings using nom? I want to parse the following: "A standard string" #"A string containing ["] a quote"# ##"A string containing ["#] a quo...
Classieclassification asked 24/5, 2020 at 4:32

2

Solved

Everything I try gives me Incomplete(Size(1)). My best guess right now is: named!(my_u64(&str) -> u64, map_res!(recognize!(nom::digit), u64::from_str) ); Test: #[cfg(test)] mod test { ...
Beedon asked 10/7, 2018 at 3:54

2

Solved

I have this Rust program using nom 4.2.2. (I have taken the liberty of expanding the nom parser function.) extern crate failure; extern crate nom; use failure::Error; use std::fs::File; use std::...
Weaks asked 15/3, 2019 at 14:30

1

I'm writing a parser for a text-based format in nom 4.2.2, and I'm using the whitespace facility to skip whitespace. I have to use a custom parser because this format treats some unusual characters...
Kuopio asked 5/3, 2019 at 18:54

1

Solved

I'm learning nom, and as a test example I'm trying to parse a string until a delimiter. If my delimiter is /, then I want to match everything until that delimiter. For that, a parser like this work...
Medullated asked 2/1, 2019 at 16:13

2

Solved

I'm trying to split a log line on space and commas in order to create a Vector of Tokens of Field and Separator as shown in the code below. My problem is that nom doesn't seem to consume the entir...
Homocyclic asked 9/10, 2018 at 11:33

1

Solved

I'm trying to understand how Rust macro captures work and am looking at the nom parser library. Location nom/src/bytes.rs declares macro tag! which captures with ($i:expr, $tag: expr). However t...
Yockey asked 16/7, 2018 at 18:8
1

© 2022 - 2024 — McMap. All rights reserved.