MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / kw_name

Method kw_name

compiler/src/modules/vm/helpers.rs:11–16  ·  view source on GitHub ↗

Interned keyword name behind a Val, or None when not a string.

(&self, k: Val)

Source from the content-addressed store, hash-verified

9
10 // Interned keyword name behind a Val, or None when not a string.
11 pub(crate) fn kw_name(&self, k: Val) -> Option<&str> {
12 match self.heap.try_get(k) {
13 Some(HeapObj::Str(s)) => Some(s.as_str()),
14 _ => None,
15 }
16 }
17
18 /* Byte offset of the last propagating error, or None on success / before `run()`. */
19 pub fn error_pos(&self) -> Option<usize> { self.error_byte_pos.map(|p| p as usize) }

Callers 5

exec_sortMethod · 0.80
dispatch_nativeMethod · 0.80
call_minmaxMethod · 0.80
call_printMethod · 0.80
call_enumerateMethod · 0.80

Calls 2

try_getMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected