refactor(parser): use parse macro for inline_table
@@ -49,25 +49,16 @@ pub(crate) const KEYVAL_SEP: char = '=';
// inline-table-keyvals-non-empty =
// ( key keyval-sep val inline-table-sep inline-table-keyvals-non-empty ) /
// ( key keyval-sep val )
-parser!{
- fn inline_table_keyvals['a, I]()(I) -> (&'a str, Vec<(InternalString, KeyValue)>)
- where
- [I: RangeStream<Range = &'a str, Item = char>,]
- {
+parse!(inline_table_keyvals() -> (&'a str, Vec<(InternalString, KeyValue)>), {
(
sep_by(keyval(), char(INLINE_TABLE_SEP)),
ws(),
).map(|(v, w)| {
(w, v)
})
- }
-}
+});
-parser!{
- fn keyval['a, I]()(I) -> (InternalString, KeyValue)
- where
- [I: RangeStream<Range = &'a str, Item = char>,]
- {
+parse!(keyval() -> (InternalString, KeyValue), {
(
try((ws(), key(), ws())),
char(KEYVAL_SEP),
@@ -84,5 +75,4 @@ parser!{
}
)
})
- }
-}
+});
