diff --git a/Cargo.lock b/Cargo.lock index 3594894..e9c368e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -884,7 +884,7 @@ dependencies = [ [[package]] name = "pilota-thrift-parser" -version = "0.11.2" +version = "0.11.3" dependencies = [ "nom", ] diff --git a/pilota-thrift-parser/Cargo.toml b/pilota-thrift-parser/Cargo.toml index 5106bc7..6d88345 100644 --- a/pilota-thrift-parser/Cargo.toml +++ b/pilota-thrift-parser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pilota-thrift-parser" -version = "0.11.2" +version = "0.11.3" edition = "2021" description = "Pilota thrift Parser." documentation = "https://docs.rs/pilota" diff --git a/pilota-thrift-parser/src/parser/annotation.rs b/pilota-thrift-parser/src/parser/annotation.rs index a395c47..139226d 100644 --- a/pilota-thrift-parser/src/parser/annotation.rs +++ b/pilota-thrift-parser/src/parser/annotation.rs @@ -51,5 +51,14 @@ mod tests { #[test] fn test_annotations() { let _a = Annotations::parse(r#"(go.tag = "json:\"Ids\" split:\"type=tenant\"")"#).unwrap(); + + let input = r#"( + cpp.type = "DenseFoo", + python.type = "DenseFoo", + java.final = "", + )"#; + let (remain, a) = Annotations::parse(input).unwrap(); + assert!(remain.is_empty()); + assert_eq!(a.len(), 3); } } diff --git a/pilota-thrift-parser/src/parser/mod.rs b/pilota-thrift-parser/src/parser/mod.rs index da1e557..e14f0e2 100644 --- a/pilota-thrift-parser/src/parser/mod.rs +++ b/pilota-thrift-parser/src/parser/mod.rs @@ -49,7 +49,7 @@ impl Parser for Path { } pub(crate) fn list_separator(input: &str) -> IResult<&str, char> { - one_of(",;")(input) + map(tuple((one_of(",;"), opt(blank))), |(sep, _)| sep)(input) } fn comment(input: &str) -> IResult<&str, &str> {