feat(registry): checkpoint PLN-0176 foundations and validated partial integrations
This commit is contained in:
@@ -360,6 +360,34 @@ pub fn assemble(src: &str) -> Result<Vec<u8>, AsmError> {
|
||||
emit_u32(parse_u32_any(ops)?, &mut out);
|
||||
}
|
||||
|
||||
"DYN_PACK" | "DYN_UNPACK" | "DYN_CAN_UNPACK" => {
|
||||
if ops.is_empty() {
|
||||
return Err(AsmError::MissingOperand(line.into()));
|
||||
}
|
||||
let opcode = match mn {
|
||||
"DYN_PACK" => CoreOpCode::DynPack,
|
||||
"DYN_UNPACK" => CoreOpCode::DynUnpack,
|
||||
_ => CoreOpCode::DynCanUnpack,
|
||||
};
|
||||
emit_u16(opcode as u16, &mut out);
|
||||
emit_u32(parse_u32_any(ops)?, &mut out);
|
||||
}
|
||||
"REF_IS_EXACT" | "REF_IMPLEMENTS" | "REF_TO_TRAIT" | "REF_CAST" => {
|
||||
if ops.is_empty() {
|
||||
return Err(AsmError::MissingOperand(line.into()));
|
||||
}
|
||||
let (a, b) = parse_keyvals(ops)?;
|
||||
let (source, target) = parse_pair(a, "source", b, "target")?;
|
||||
let opcode = match mn {
|
||||
"REF_IS_EXACT" => CoreOpCode::RefIsExact,
|
||||
"REF_IMPLEMENTS" => CoreOpCode::RefImplements,
|
||||
"REF_TO_TRAIT" => CoreOpCode::RefToTrait,
|
||||
_ => CoreOpCode::RefCast,
|
||||
};
|
||||
emit_u16(opcode as u16, &mut out);
|
||||
emit_u32(source, &mut out);
|
||||
emit_u32(target, &mut out);
|
||||
}
|
||||
other => return Err(AsmError::UnknownMnemonic(other.into())),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user