From 30fdba4356683198a298eebb44e28cb8c191a0e1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 25 May 2022 14:13:01 +0200 Subject: Move deps from context to VM --- src/eval/machine.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/eval/machine.rs') diff --git a/src/eval/machine.rs b/src/eval/machine.rs index 14633978..904a64c8 100644 --- a/src/eval/machine.rs +++ b/src/eval/machine.rs @@ -13,6 +13,8 @@ pub struct Machine<'a> { pub ctx: &'a mut Context, /// The route of source ids at which the machine is located. pub route: Vec, + /// The dependencies of the current evaluation process. + pub deps: Vec<(SourceId, usize)>, /// The stack of scopes. pub scopes: Scopes<'a>, /// A control flow event that is currently happening. @@ -22,7 +24,13 @@ pub struct Machine<'a> { impl<'a> Machine<'a> { /// Create a new virtual machine. pub fn new(ctx: &'a mut Context, route: Vec, scopes: Scopes<'a>) -> Self { - Self { ctx, route, scopes, flow: None } + Self { + ctx, + route, + deps: vec![], + scopes, + flow: None, + } } /// Resolve a user-entered path to be relative to the compilation -- cgit v1.2.3