From 050a0f987d4b0fabfe4adc8269df7c3886dd88db Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Fri, 4 Jul 2025 01:23:31 -0400 Subject: [PATCH] also put the new panic mod under version control --- src/panic.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/panic.rs diff --git a/src/panic.rs b/src/panic.rs new file mode 100644 index 0000000..1ffd944 --- /dev/null +++ b/src/panic.rs @@ -0,0 +1,19 @@ +use crate::value::Value; +use crate::vm::CallFrame; + +#[derive(Debug, Clone, PartialEq)] +pub enum PanicMsg { + NoLetMatch, + NoFnMatch, + NoMatch, + Generic(String), +} + +#[derive(Debug, Clone, PartialEq)] +pub struct Panic { + pub msg: PanicMsg, + pub frame: CallFrame, + pub scrutinee: Option, + pub ip: usize, + pub call_stack: Vec, +}