implement dynamic key; implement __curPos; other small changes
This commit is contained in:
@@ -3,7 +3,7 @@ use fix_common::StringId;
|
||||
use num_enum::TryFromPrimitive;
|
||||
use string_interner::Symbol as _;
|
||||
|
||||
use crate::{AttrKeyData, OperandData, VmRuntimeCtx};
|
||||
use crate::{OperandData, VmRuntimeCtx};
|
||||
|
||||
pub(crate) struct BytecodeReader<'a> {
|
||||
bytecode: &'a [u8],
|
||||
@@ -132,18 +132,6 @@ impl<'a> BytecodeReader<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn read_attr_key_data(&mut self) -> crate::AttrKeyData {
|
||||
use fix_codegen::AttrKeyType;
|
||||
let tag = self.read_u8();
|
||||
let ty = AttrKeyType::try_from_primitive(tag)
|
||||
.unwrap_or_else(|err| panic!("unknown key tag: {:#04x}", err.number));
|
||||
match ty {
|
||||
AttrKeyType::Static => AttrKeyData::Static(self.read_string_id()),
|
||||
AttrKeyType::Dynamic => AttrKeyData::Dynamic,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn pc(&self) -> usize {
|
||||
self.pc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user