summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-07-30 18:04:08 +0200
committerLaurenz <laurmaedje@gmail.com>2021-07-30 18:49:19 +0200
commit1ee1d078e2480ddd08d40915bc7a74a8352acff0 (patch)
tree1e7ff367278a19fead3e404cf06d65bfb80a6cd9 /src/syntax
parent42a27b48df427edf8dbb624c51551a90ecf2e7ea (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/syntax')
-rw-r--r--src/syntax/node.rs4
-rw-r--r--src/syntax/visit.rs2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/syntax/node.rs b/src/syntax/node.rs
index 9294fecd..881752a6 100644
--- a/src/syntax/node.rs
+++ b/src/syntax/node.rs
@@ -1,5 +1,3 @@
-use std::rc::Rc;
-
use super::*;
/// A syntax node, encompassing a single logical entity of parsed source code.
@@ -52,7 +50,7 @@ pub struct HeadingNode {
/// The section depth (numer of equals signs).
pub level: usize,
/// The contents of the heading.
- pub body: Rc<SyntaxTree>,
+ pub body: SyntaxTree,
}
/// An item in an unordered list: `- ...`.
diff --git a/src/syntax/visit.rs b/src/syntax/visit.rs
index b6ee657a..c38e87aa 100644
--- a/src/syntax/visit.rs
+++ b/src/syntax/visit.rs
@@ -102,7 +102,7 @@ impl_visitors! {
}
visit_heading(v, heading: HeadingNode) {
- v.visit_tree(r!(rc: heading.body));
+ v.visit_tree(r!(heading.body));
}
visit_list(v, item: ListItem) {