Skip to content

Commit

Permalink
label_set(): emulate ws!() within elements of separated_list()
Browse files Browse the repository at this point in the history
  • Loading branch information
vthriller committed Sep 11, 2021
1 parent ca8f026 commit 853eb7d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use nom::character::complete::{
alphanumeric1,
digit1,
char,
multispace0,
};
use nom::multi::separated_list;
use nom::sequence::delimited;
Expand Down Expand Up @@ -39,9 +40,13 @@ fn label_set(input: &[u8]) -> IResult<&[u8], Vec<LabelMatch>> {
char('{'),
// TODO ws!
separated_list(char(','), |input: &[u8]| {
let (input, _) = multispace0(input)?;
let (input, name) = label_name(input)?;
let (input, _) = multispace0(input)?;
let (input, op) = label_op(input)?;
let (input, _) = multispace0(input)?;
let (input, value) = string(input)?;
let (input, _) = multispace0(input)?;
Ok((input, LabelMatch { name, op, value }))
}),
char('}')
Expand Down

0 comments on commit 853eb7d

Please sign in to comment.