diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-30 18:04:08 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-30 18:49:19 +0200 |
| commit | 1ee1d078e2480ddd08d40915bc7a74a8352acff0 (patch) | |
| tree | 1e7ff367278a19fead3e404cf06d65bfb80a6cd9 /src/exec/mod.rs | |
| parent | 42a27b48df427edf8dbb624c51551a90ecf2e7ea (diff) | |
Fatal errors
- Makes errors fatal, so that a phase is only reached when all previous phases were error-free
- Parsing still recovers and can produce multiple errors
- Evaluation fails fast and can thus produce only a single error (except for parse errors due to an import)
- The single error that could occur during execution is removed for now
- Removes Value::Error variant
Diffstat (limited to 'src/exec/mod.rs')
| -rw-r--r-- | src/exec/mod.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/exec/mod.rs b/src/exec/mod.rs index 8bac76e8..762b555d 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -8,7 +8,6 @@ pub use state::*; use std::fmt::Write; -use crate::diag::Pass; use crate::eval::{ExprMap, Template, TemplateFunc, TemplateNode, TemplateTree, Value}; use crate::geom::Gen; use crate::layout::{LayoutTree, StackChild, StackNode}; @@ -18,7 +17,7 @@ use crate::util::EcoString; use crate::Context; /// Execute a template to produce a layout tree. -pub fn exec(ctx: &mut Context, template: &Template) -> Pass<LayoutTree> { +pub fn exec(ctx: &mut Context, template: &Template) -> LayoutTree { let mut ctx = ExecContext::new(ctx); template.exec(&mut ctx); ctx.finish() @@ -138,7 +137,6 @@ impl Exec for Value { Value::Float(v) => ctx.push_text(pretty(v)), Value::Str(v) => ctx.push_text(v), Value::Template(v) => v.exec(ctx), - Value::Error => {} // For values which can't be shown "naturally", we print the // representation in monospace. other => ctx.push_monospace_text(pretty(other)), |
