Skip to content

Commit

Permalink
chore(deps): use upstream winnow (#16981)
Browse files Browse the repository at this point in the history
Signed-off-by: TennyZhuang <[email protected]>
  • Loading branch information
TennyZhuang authored May 29, 2024
1 parent 2cc3703 commit 4bfb893
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
18 changes: 5 additions & 13 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions src/sqlparser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ normal = ["workspace-hack"]
itertools = { workspace = true }
serde = { version = "1.0", features = ["derive"], optional = true }
thiserror = "1.0.61"
tokio = { version = "0.2", package = "madsim-tokio" }
tokio = { version = "0.2", package = "madsim-tokio", features = [
"rt",
"rt-multi-thread",
"macros",
] }
tracing = "0.1"
tracing-subscriber = "0.3"
winnow = { version = "0.6.8", git = "https://github.com/TennyZhuang/winnow.git", rev = "a6b1f04" }
winnow = "0.6.9"

[target.'cfg(not(madsim))'.dependencies]
workspace-hack = { path = "../workspace-hack" }
Expand Down
14 changes: 10 additions & 4 deletions src/sqlparser/src/parser_v2/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,16 @@ fn data_type_stateful<S>(input: &mut StatefulStream<S>) -> PResult<DataType>
where
S: TokenStream,
{
repeat(0.., (Token::LBracket, cut_err(Token::RBracket)))
.fold1(data_type_stateful_inner, |mut acc, _| {
acc = DataType::Array(Box::new(acc));
acc
(
data_type_stateful_inner,
repeat(0.., (Token::LBracket, cut_err(Token::RBracket))),
)
.map(|(mut dt, depth)| {
let depth: usize = depth;
for _ in 0..depth {
dt = DataType::Array(Box::new(dt));
}
dt
})
.parse_next(input)
}
Expand Down

0 comments on commit 4bfb893

Please sign in to comment.