@@ -23,8 +23,8 @@ impl Annotation {
2323 Components :: list_separator ( ) . padded_by ( Components :: blank_with_comments ( ) . or_not ( ) ) ;
2424
2525 let annotation_list = annotation
26- . separated_by ( separator)
27- . allow_trailing ( )
26+ . then_ignore ( separator. or_not ( ) )
27+ . repeated ( )
2828 . collect :: < Vec < Annotation > > ( )
2929 . padded_by ( Components :: blank_with_comments ( ) . or_not ( ) ) ;
3030
@@ -65,7 +65,7 @@ mod tests {
6565 ) ;
6666
6767 let input = r#"(
68- cpp.type = "DenseFoo",
68+ cpp.type = "DenseFoo"
6969 python.type ="DenseFoo",
7070 go.type ="DenseFoo";
7171 java.final=""
@@ -84,7 +84,7 @@ mod tests {
8484 let input = r#"(
8585 // comment before first annotation
8686 cpp.type = "DenseFoo"; // cpp.type
87- python.type ="DenseFoo", go.type ="DenseFoo";
87+ python.type ="DenseFoo" go.type ="DenseFoo";
8888 java.final="")"# ;
8989 let res = Annotation :: get_parser ( ) . parse ( input) . unwrap ( ) ;
9090 assert_eq ! ( res. len( ) , 4 ) ;
@@ -106,6 +106,19 @@ mod tests {
106106 assert_eq ! ( res[ 0 ] . key, "cpp.type" ) ;
107107 assert_eq ! ( res[ 0 ] . value. to_string( ) , "DenseFoo" ) ;
108108
109+ let input = r#"(
110+ cpp.type = "DenseFoo" go.type ="DenseFoo"
111+ python.type = "DenseFoo"
112+ )"# ;
113+ let res = Annotation :: get_parser ( ) . parse ( input) . unwrap ( ) ;
114+ assert_eq ! ( res. len( ) , 3 ) ;
115+ assert_eq ! ( res[ 0 ] . key, "cpp.type" ) ;
116+ assert_eq ! ( res[ 0 ] . value. to_string( ) , "DenseFoo" ) ;
117+ assert_eq ! ( res[ 1 ] . key, "go.type" ) ;
118+ assert_eq ! ( res[ 1 ] . value. to_string( ) , "DenseFoo" ) ;
119+ assert_eq ! ( res[ 2 ] . key, "python.type" ) ;
120+ assert_eq ! ( res[ 1 ] . value. to_string( ) , "DenseFoo" ) ;
121+
109122 let input = r#"(
110123 cpp.type = "DenseFoo";
111124 python.type ="DenseFoo", go.type ="DenseFoo"; /* go.type */
0 commit comments