diff options
Diffstat (limited to 'crates/rebel-parse')
-rw-r--r-- | crates/rebel-parse/src/grammar/recipe.rs | 6 | ||||
-rw-r--r-- | crates/rebel-parse/src/grammar/tokenize.rs | 1 | ||||
-rw-r--r-- | crates/rebel-parse/src/token.rs | 1 |
3 files changed, 3 insertions, 5 deletions
diff --git a/crates/rebel-parse/src/grammar/recipe.rs b/crates/rebel-parse/src/grammar/recipe.rs index 96ef61d..1c417d3 100644 --- a/crates/rebel-parse/src/grammar/recipe.rs +++ b/crates/rebel-parse/src/grammar/recipe.rs @@ -78,7 +78,7 @@ peg::parser! { / [Token::Keyword(Keyword::Map)] p('{') key:typ() p2('=', '>') value:typ() p('}') { typ::Literal::Map(Box::new(key), Box::new(value)) } - / [Token::Keyword(Keyword::Struct)] p('{') entries:delimited(<struct_field_typ()>, <p(',')>) p('}') { + / p('{') entries:delimited(<struct_field_typ()>, <p(',')>) p('}') { typ::Literal::Struct(entries) } @@ -147,8 +147,8 @@ peg::parser! { { Expr::IfElse { if_blocks, else_block } } - / p('{') block:block() p('}') { Expr::Block(block) } / lit:literal() { Expr::Literal(lit) } + / p('{') block:block() p('}') { Expr::Block(block) } / path:path() { Expr::Path(path) } rule cond_block() -> (Expr<'a>, ast::Block<'a>) @@ -184,7 +184,7 @@ peg::parser! { / [Token::Keyword(Keyword::Map)] p('{') entries:delimited(<map_entry()>, <p(',')>) p('}') { expr::Literal::Map(entries) } - / [Token::Keyword(Keyword::Struct)] p('{') entries:delimited(<struct_field()>, <p(',')>) p('}') { + / p('{') entries:delimited(<struct_field()>, <p(',')>) p('}') { expr::Literal::Struct(entries) } diff --git a/crates/rebel-parse/src/grammar/tokenize.rs b/crates/rebel-parse/src/grammar/tokenize.rs index a4e25b5..551f157 100644 --- a/crates/rebel-parse/src/grammar/tokenize.rs +++ b/crates/rebel-parse/src/grammar/tokenize.rs @@ -13,7 +13,6 @@ static KEYWORDS: phf::Map<&'static str, Keyword> = phf::phf_map! { "mut" => Keyword::Mut, "recipe" => Keyword::Recipe, "set" => Keyword::Set, - "struct" => Keyword::Struct, "task" => Keyword::Task, "true" => Keyword::True, }; diff --git a/crates/rebel-parse/src/token.rs b/crates/rebel-parse/src/token.rs index 59582c3..c86d13e 100644 --- a/crates/rebel-parse/src/token.rs +++ b/crates/rebel-parse/src/token.rs @@ -19,7 +19,6 @@ pub enum Keyword { Mut, Recipe, Set, - Struct, Task, True, } |