summaryrefslogtreecommitdiff
path: root/src/eval/value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/value.rs')
-rw-r--r--src/eval/value.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/eval/value.rs b/src/eval/value.rs
index 51bc55ab..85ac2367 100644
--- a/src/eval/value.rs
+++ b/src/eval/value.rs
@@ -17,6 +17,8 @@ use crate::{DynFuture, Feedback, Pass};
/// A computational value.
#[derive(Clone, PartialEq)]
pub enum Value {
+ /// The result of invalid operations.
+ Error,
/// An identifier: `ident`.
Ident(Ident),
/// A boolean: `true, false`.
@@ -54,6 +56,7 @@ impl Value {
/// The natural-language name of this value for use in error messages.
pub fn name(&self) -> &'static str {
match self {
+ Self::Error => "error",
Self::Ident(_) => "identifier",
Self::Bool(_) => "bool",
Self::Int(_) => "integer",
@@ -111,6 +114,7 @@ impl Spanned<Value> {
impl Debug for Value {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self {
+ Self::Error => f.pad("<error>"),
Self::Ident(i) => i.fmt(f),
Self::Bool(b) => b.fmt(f),
Self::Int(i) => i.fmt(f),