summaryrefslogtreecommitdiffstats
path: root/crates/rebel-parse/src/grammar
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-28 13:45:11 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-28 13:45:11 +0200
commit0795e76ae45b0479289acb2ee4be5ab29980f7a2 (patch)
treea4c3ce3f74b892d9a2390a2cf917e11ca8df609c /crates/rebel-parse/src/grammar
parentf9005692a1e2dba89274f39df762fdcfa59b739b (diff)
downloadrebel-0795e76ae45b0479289acb2ee4be5ab29980f7a2.tar
rebel-0795e76ae45b0479289acb2ee4be5ab29980f7a2.zip
rebel-parse: implement validation for statements
Diffstat (limited to 'crates/rebel-parse/src/grammar')
-rw-r--r--crates/rebel-parse/src/grammar/recipe.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/rebel-parse/src/grammar/recipe.rs b/crates/rebel-parse/src/grammar/recipe.rs
index 71c2733..393b12c 100644
--- a/crates/rebel-parse/src/grammar/recipe.rs
+++ b/crates/rebel-parse/src/grammar/recipe.rs
@@ -13,7 +13,7 @@ peg::parser! {
pub rule recipe_stmt() -> ast::RecipeStmt<'a>
= keyword_fetch() name:ident() p('{') body:body() p('}') {
- ast::RecipeStmt::Fetch { name, body: Vec::new() }
+ ast::RecipeStmt::Fetch { name, body: ast::Body(Vec::new()) }
}
/ keyword_task() name:ident() p('(') params:func_params() p(')')
p('{') body:body() p('}') {
@@ -24,7 +24,7 @@ peg::parser! {
}
pub rule body() -> ast::Body<'a>
- = body:body_stmt() ++ p(';') { body }
+ = body:body_stmt() ++ p(';') { ast::Body(body) }
pub rule body_stmt() -> ast::BodyStmt<'a>
= dest:typed_expr() op:assign_op() expr:expr() {