refactor(tvix/eval): move NumberPair struct definition to vm module
This isn't relevant to the value type itself. Change-Id: I678bc92a8a530b1081ed498bf3ff7925217bcc01 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6081 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
9c5a249b30
commit
0d2896519c
3 changed files with 8 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
|||
use rnix::{self, types::TypedNode};
|
||||
use std::fmt::Write;
|
||||
|
||||
use crate::errors::{Error, EvalResult};
|
||||
use crate::errors::EvalResult;
|
||||
|
||||
pub fn interpret(code: String) -> EvalResult<String> {
|
||||
let ast = rnix::parse(&code);
|
||||
|
|
|
@ -39,9 +39,3 @@ impl Value {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum NumberPair {
|
||||
Floats(f64, f64),
|
||||
Integer(i64, i64),
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
chunk::Chunk,
|
||||
errors::{Error, EvalResult},
|
||||
opcode::OpCode,
|
||||
value::{NumberPair, Value},
|
||||
value::Value,
|
||||
};
|
||||
|
||||
pub struct VM {
|
||||
|
@ -123,6 +123,12 @@ impl VM {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum NumberPair {
|
||||
Floats(f64, f64),
|
||||
Integer(i64, i64),
|
||||
}
|
||||
|
||||
pub fn run_chunk(chunk: Chunk) -> EvalResult<Value> {
|
||||
let mut vm = VM {
|
||||
chunk,
|
||||
|
|
Loading…
Reference in a new issue