Use custom Arc backed input

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-06 12:40:02 +01:00
parent 1ea15f0e49
commit 1ee7611981
6 changed files with 283 additions and 77 deletions

View file

@ -5,11 +5,12 @@ use thiserror::Error;
use crate::Context;
use crate::emit::Instruction;
use crate::input::TempleInput;
#[derive(Debug, Error, Display)]
enum EvalError {
/// An unknown variable was encountered: .0
UnknownVariable(String),
UnknownVariable(TempleInput),
/// An explicit abort was requested
ExplicitAbort,
}
@ -25,7 +26,7 @@ fn execute(instructions: &[Instruction], global_context: &Context) -> Result<Str
Instruction::LoadFromContextToSlot { name, slot } => {
let value = global_context
.values
.get(name)
.get(name.as_str())
.ok_or(EvalError::UnknownVariable(name.clone()))?;
scopes.insert(*slot, value.clone());