summaryrefslogtreecommitdiffstats
path: root/crates/rebel-lang/examples/repl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rebel-lang/examples/repl.rs')
-rw-r--r--crates/rebel-lang/examples/repl.rs22
1 files changed, 8 insertions, 14 deletions
diff --git a/crates/rebel-lang/examples/repl.rs b/crates/rebel-lang/examples/repl.rs
index 4a7b755..914f318 100644
--- a/crates/rebel-lang/examples/repl.rs
+++ b/crates/rebel-lang/examples/repl.rs
@@ -85,15 +85,16 @@ fn main() {
}
};
+ match stmt.validate() {
+ Ok(()) => (),
+ Err(err) => {
+ println!("Validation error: {err:?}");
+ continue;
+ }
+ };
+
match &stmt {
rebel_parse::ast::BodyStmt::Assign { dest: _, expr } => {
- match expr.validate() {
- Ok(_) => (),
- Err(err) => {
- println!("Validation error: {err:?}");
- continue;
- }
- };
match Type::ast_expr_type(&ctx, expr) {
Ok(_) => (),
Err(err) => {
@@ -103,13 +104,6 @@ fn main() {
};
}
rebel_parse::ast::BodyStmt::Expr { expr } => {
- match expr.validate() {
- Ok(_) => (),
- Err(err) => {
- println!("Validation error: {err:?}");
- continue;
- }
- };
match Type::ast_expr_type(&ctx, expr) {
Ok(_) => (),
Err(err) => {