runtime, macros: unify NaN-boxed value API under ValueVariant trait
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use bumpalo::Bump;
|
||||
use fix_bytecode::{Const, InstructionPtr, Op, Continuation};
|
||||
use fix_bytecode::{Const, Continuation, InstructionPtr, Op};
|
||||
use fix_error::{Error, Result, Source};
|
||||
use fix_lang::{StringId, Symbol};
|
||||
use fix_runtime::{StaticValue, VmCode, VmRuntimeCtx};
|
||||
@@ -148,11 +148,11 @@ impl<'a, R: VmRuntimeCtx> BytecodeContext for CompilerCtx<'a, R> {
|
||||
fn add_constant(&mut self, val: Const) -> u32 {
|
||||
use Const::*;
|
||||
let val = match val {
|
||||
Smi(x) => StaticValue::new_inline(x),
|
||||
Smi(x) => StaticValue::new(x),
|
||||
Float(x) => StaticValue::new_float(x),
|
||||
Bool(x) => StaticValue::new_inline(x),
|
||||
String(x) => StaticValue::new_inline(x),
|
||||
Path(x) => StaticValue::new_inline(fix_runtime::Path(x)),
|
||||
Bool(x) => StaticValue::new(x),
|
||||
String(x) => StaticValue::new(x),
|
||||
Path(x) => StaticValue::new(fix_runtime::Path(x)),
|
||||
PrimOp {
|
||||
id,
|
||||
arity,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use fix_bytecode::{Const, InstructionPtr, Op, OperandType, Continuation};
|
||||
use fix_bytecode::{Const, Continuation, InstructionPtr, Op, OperandType};
|
||||
use fix_lang::{BUILTINS, StringId};
|
||||
use hashbrown::HashMap;
|
||||
use rnix::TextRange;
|
||||
|
||||
Reference in New Issue
Block a user