Skip to main content

decode_value

Function decode_value 

Source
pub fn decode_value(x: &Value) -> Result<Value, DecodeError>
Expand description

Decode the golden-vector JSON value representation into a runtime Value (expression-ir.md §2.3 inverse map).

  • bare JSON number: integral → int, otherwise → float.
  • {"int":"…"} → int (decimal string; may exceed the i64 safe range — the value is parsed as i64 here since the runtime is i64; literals beyond i64 are handled by the evaluator’s {int:…} literal path, not by the decoder — the decoder is only used for scope/params/expect where i64 is sufficient).
  • {"float":n} → float (explicit integral-valued float).
  • {"nan"} / {"inf":±1} → NaN / ±Inf (canonical Failure fixtures only).