Skip to content

Commit

Permalink
chore(deps): update winnow to 0.5.19
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaka91 committed Nov 5, 2023
1 parent abcee05 commit 5042fc1
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/stef-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rustc-args = ["--cfg", "docsrs"]
miette.workspace = true
owo-colors.workspace = true
stef-derive = { path = "../stef-derive" }
winnow = "0.5.18"
winnow = "0.5.19"

[dev-dependencies]
indoc.workspace = true
Expand Down
8 changes: 5 additions & 3 deletions crates/stef-parser/src/parser/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Range;
use stef_derive::{ParserError, ParserErrorCause};
use winnow::{
ascii::space0,
combinator::{alt, cut_err, fold_repeat, opt, preceded, separated1, terminated},
combinator::{alt, cut_err, fold_repeat, opt, preceded, separated, terminated},
error::ErrorKind,
stream::Location,
token::{one_of, take_while},
Expand Down Expand Up @@ -70,7 +70,8 @@ fn parse_attribute<'i>(input: &mut Input<'i>) -> Result<Vec<Attribute<'i>>, Caus
"#[",
cut_err(terminated(
terminated(
separated1(
separated(
1..,
ws((parse_name, parse_value)).map(|(name, value)| Attribute { name, value }),
ws(','),
),
Expand Down Expand Up @@ -105,7 +106,8 @@ fn parse_multi_value<'i>(input: &mut Input<'i>) -> Result<Vec<Attribute<'i>>, Ca
'(',
cut_err(terminated(
terminated(
separated1(
separated(
1..,
ws((parse_name, parse_value)).map(|(name, value)| Attribute { name, value }),
ws(','),
),
Expand Down
4 changes: 2 additions & 2 deletions crates/stef-parser/src/parser/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Range;
use stef_derive::{ParserError, ParserErrorCause};
use winnow::{
ascii::{alphanumeric0, space0, space1},
combinator::{cut_err, opt, preceded, separated1, terminated},
combinator::{cut_err, opt, preceded, separated, terminated},
error::ErrorKind,
stream::Location,
token::one_of,
Expand Down Expand Up @@ -126,7 +126,7 @@ fn parse_variants<'i>(input: &mut Input<'i>) -> Result<Vec<Variant<'i>>, Cause>
preceded(
'{',
cut_err(terminated(
terminated(separated1(parse_variant, ws(',')), opt(ws(','))),
terminated(separated(1.., parse_variant, ws(',')), opt(ws(','))),
ws('}'),
)),
)
Expand Down
6 changes: 3 additions & 3 deletions crates/stef-parser/src/parser/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Range;
use stef_derive::{ParserError, ParserErrorCause};
use winnow::{
ascii::space0,
combinator::{cut_err, delimited, opt, peek, preceded, separated1, terminated},
combinator::{cut_err, delimited, opt, peek, preceded, separated, terminated},
dispatch,
error::ErrorKind,
stream::{Location, Stream},
Expand Down Expand Up @@ -90,7 +90,7 @@ fn parse_named<'i>(input: &mut Input<'i>) -> Result<Vec<NamedField<'i>>, Cause>
preceded(
'{',
cut_err(terminated(
terminated(separated1(parse_named_field, ws(',')), opt(ws(','))),
terminated(separated(1.., parse_named_field, ws(',')), opt(ws(','))),
ws('}'),
)),
)
Expand All @@ -101,7 +101,7 @@ fn parse_unnamed<'i>(input: &mut Input<'i>) -> Result<Vec<UnnamedField<'i>>, Cau
preceded(
'(',
cut_err(terminated(
terminated(separated1(parse_unnamed_field, ws(',')), opt(ws(','))),
terminated(separated(1.., parse_unnamed_field, ws(',')), opt(ws(','))),
ws(')'),
)),
)
Expand Down
4 changes: 2 additions & 2 deletions crates/stef-parser/src/parser/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Range;
use stef_derive::{ParserError, ParserErrorCause};
use winnow::{
ascii::alphanumeric0,
combinator::{cut_err, preceded, separated1, terminated},
combinator::{cut_err, preceded, separated, terminated},
error::ErrorKind,
stream::Location,
token::one_of,
Expand Down Expand Up @@ -50,7 +50,7 @@ pub enum Cause {
pub(super) fn parse<'i>(input: &mut Input<'i>) -> Result<Generics<'i>, ParseError> {
preceded(
'<',
cut_err(terminated(separated1(ws(parse_name), ws(',')), ws('>'))),
cut_err(terminated(separated(1.., ws(parse_name), ws(',')), ws('>'))),
)
.parse_next(input)
.map(Generics)
Expand Down
4 changes: 2 additions & 2 deletions crates/stef-parser/src/parser/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Range;
use stef_derive::{ParserError, ParserErrorCause};
use winnow::{
ascii::space1,
combinator::{alt, cut_err, opt, preceded, separated1, terminated},
combinator::{alt, cut_err, opt, preceded, separated, terminated},
error::ErrorKind,
stream::{Location, Stream},
token::{one_of, take_while},
Expand Down Expand Up @@ -69,7 +69,7 @@ pub(super) fn parse<'i>(input: &mut Input<'i>) -> Result<Import<'i>, ParseError>
("use", space1),
cut_err(terminated(
(
separated1(parse_segment, "::"),
separated(1.., parse_segment, "::"),
opt(preceded(
"::",
alt((
Expand Down
4 changes: 2 additions & 2 deletions crates/stef-parser/src/parser/literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use stef_derive::{ParserError, ParserErrorCause};
use winnow::{
ascii::{dec_uint, digit1, multispace1},
combinator::{
alt, cut_err, delimited, fail, fold_repeat, opt, peek, preceded, separated1, terminated,
alt, cut_err, delimited, fail, fold_repeat, opt, peek, preceded, separated, terminated,
},
dispatch,
error::ErrorKind,
Expand Down Expand Up @@ -222,7 +222,7 @@ fn parse_bytes(input: &mut Input<'_>) -> Result<Vec<u8>, Cause> {
preceded(
'[',
cut_err(terminated(
separated1(ws(dec_uint::<_, u8, _>), ws(',')),
separated(1.., ws(dec_uint::<_, u8, _>), ws(',')),
(opt(ws(',')), ws(']')),
)),
)
Expand Down
9 changes: 4 additions & 5 deletions crates/stef-parser/src/parser/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use stef_derive::{ParserError, ParserErrorCause};
use winnow::{
ascii::{dec_uint, space0},
combinator::{
alt, cut_err, fail, opt, preceded, separated0, separated1, separated_pair, success,
terminated,
alt, cut_err, fail, opt, preceded, separated, separated_pair, success, terminated,
},
dispatch,
error::ErrorKind,
Expand Down Expand Up @@ -129,7 +128,7 @@ fn parse_tuple<'i>(input: &mut Input<'i>) -> Result<DataType<'i>, Cause> {
preceded(
'(',
cut_err(terminated(
separated0(ws(parse.map_err(Cause::from)), ws(',')),
separated(0.., ws(parse.map_err(Cause::from)), ws(',')),
ws(')'),
)),
)
Expand All @@ -152,15 +151,15 @@ fn parse_array<'i>(input: &mut Input<'i>) -> Result<DataType<'i>, Cause> {
fn parse_external<'i>(input: &mut Input<'i>) -> Result<ExternalType<'i>, Cause> {
(
opt(terminated(
separated1(imports::parse_segment.map_err(Cause::from), "::"),
separated(1.., imports::parse_segment.map_err(Cause::from), "::"),
"::",
))
.map(Option::unwrap_or_default),
parse_external_name,
opt(preceded(
'<',
cut_err(terminated(
separated1(ws(parse.map_err(Cause::from)), ws(',')),
separated(1.., ws(parse.map_err(Cause::from)), ws(',')),
ws('>'),
)),
))
Expand Down

0 comments on commit 5042fc1

Please sign in to comment.