diff options
Diffstat (limited to 'crates/rebel-parse/src/grammar/recipe.rs')
-rw-r--r-- | crates/rebel-parse/src/grammar/recipe.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/crates/rebel-parse/src/grammar/recipe.rs b/crates/rebel-parse/src/grammar/recipe.rs index c9fe1e2..b1ac32f 100644 --- a/crates/rebel-parse/src/grammar/recipe.rs +++ b/crates/rebel-parse/src/grammar/recipe.rs @@ -72,24 +72,13 @@ peg::parser! { / p('(') elements:(typ() ** p(',')) p(',')? p(')') { typ::Literal::Tuple(elements) } - / p('[') typ:typ() len:array_len() p(']') { - typ::Literal::Array(Box::new(typ), len) + / p('[') typ:typ() p(']') { + typ::Literal::Array(Box::new(typ)) } / p('{') entries:delimited(<struct_field_typ()>, <p(',')>) p('}') { typ::Literal::Struct(entries) } - rule array_len() -> typ::ArrayLen - = p(';') len:number() { ? - Ok(typ::ArrayLen::Fixed(len.try_into().or(Err("Invalid array length"))?)) - } - / p(';') [Token::Ident(name) if *name == "_"] { - typ::ArrayLen::Free - } - / { - typ::ArrayLen::Dynamic - } - rule pat() -> Pat<'a> = path:path() { Pat::Path(path) } |