make Expression Display using original string

This commit is contained in:
brevalferrari 2025-06-19 14:12:14 +02:00
parent b7933c966e
commit bbf182f762
Signed by: breval
GPG key ID: 913954DA013FAD4F
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "bliplib"
version = "0.2.4"
version = "0.2.5"
edition = "2024"
authors = ["Breval Ferrari <breval.ferrari@fish.golf>"]
description = "The Bizarre Language for Intermodulation Programming (BLIP)"

View file

@ -2,7 +2,7 @@ use std::{
any::{Any, TypeId, type_name},
collections::BTreeMap,
f64,
fmt::Debug,
fmt::{Debug, Display},
str::FromStr,
};
@ -289,6 +289,12 @@ impl FromStr for Expression {
}
}
impl Display for Expression {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Display::fmt(&self.from, f)
}
}
/// Compiler context which persists from one token to the other.
#[derive(Debug, Clone, new)]
#[cfg_attr(test, derive(PartialEq))]