MCPcopy Index your code
hub / github.com/endbasic/endbasic / parse

Method parse

core/src/bytecode.rs:226–239  ·  view source on GitHub ↗

Parses a tagged register reference from a raw `u64`, returning the absolute register index and the type of the value it holds. Panics if the type tag is invalid.

(self)

Source from the content-addressed store, hash-verified

224 ///
225 /// Panics if the type tag is invalid.
226 pub(crate) fn parse(self) -> (usize, ExprType) {
227 let vtype: ExprType = {
228 #[allow(unsafe_code)]
229 unsafe {
230 let v = unchecked_u64_as_u8(self.0 >> 32);
231 assert!(v <= ExprType::Text as u8);
232 std::mem::transmute(v)
233 }
234 };
235
236 let index = unchecked_u32_as_usize((self.0 & 0xffffffff) as u32);
237
238 (index, vtype)
239 }
240
241 /// Returns the raw `u64` encoding.
242 pub(crate) fn as_u64(&self) -> u64 {

Callers 5

default_headersMethod · 0.45
get_file_aclsMethod · 0.45
get_refMethod · 0.45
get_mut_refMethod · 0.45
split_display_messageMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected