//! YAML Parser item = _{ (pair | comment | newline | other)+ } other = ${ !(pair) ~ ANY } /// Comment comment = ${ "#" ~ (!(NEWLINE) ~ ANY)* } indent = ${ (^" "+)? } newline = ${ "\n" | "\r" } /// Pair pair = _{ key_part ~ string } key = ${ (string_key | simple_key) ~ (":" ~ " "?) } /// String string = ${ string_value | simple_value } string_key = _{ "\"" ~ key_str* ~ "\"" } simple_key = _{ key_str* } key_str = _{ !(newline | ":" | "\"" | "'") ~ ANY } simple_value = _{ value_str* } string_value = _{ ("\"" ~ (!(newline | "\"") ~ ANY)* ~ "\"") | ("'" ~ (!(newline | "'") ~ ANY)* ~ "'") } value_str = _{ !(newline | "\"" | "'") ~ ANY } key_part = _{ indent ~ key }