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.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/rebel-lang/examples/repl.rs b/crates/rebel-lang/examples/repl.rs
index e4c2550..185155b 100644
--- a/crates/rebel-lang/examples/repl.rs
+++ b/crates/rebel-lang/examples/repl.rs
@@ -96,6 +96,13 @@ fn main() -> rustyline::Result<()> {
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) => {
@@ -105,6 +112,13 @@ fn main() -> rustyline::Result<()> {
};
}
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) => {