Skip to main content

fetchvalue

Function fetchvalue 

Source
pub fn fetchvalue<'a>(
    v: Option<&'a mut value>,
    pptr: &mut &str,
    bracks: i32,
    scanflags: i32,
) -> Option<&'a mut value>
Expand description

Direct port of Value fetchvalue(Value v, char **pptr, int bracks, int scanflags) from Src/params.c:2180-2282.

Walks the parameter expression starting at *pptr, consuming the identifier (or special-char like ?/#/$/!/@/*/ -) and updating *pptr to point past the name. Looks up the param in paramtab and populates the Value’s pm/start/end/ scanflags fields.

Currently a partial port: identifier + special-char + digit names are parsed and looked up. Nameref resolution (PM_NAMEREF path at c:2246-2270), bracket subscripts (getindex at c:2288), and the SCANPM_ARRONLY scanflags promotion for hash/array params are handled. The REFSLICE/upscope path for nameref-of-array-element is deferred pending the GETREFNAME/upscope ports.