Skip to content

Parse a restricted subset of JSON strings

Choose a tag to compare

@rouson rouson released this 29 Oct 04:23
· 85 commits to main since this release
5ef0a88

This release adds several get_json_* type-bound procedures to the string_t type to provide some very limited handling of JSON-formatted information. These functions are intended only for temporary use to work around compiler bugs that prevent building rojff with the Intel ifx compiler. The JSON functions in this release repository are currently intended for use in Inference-Engine. The functions parse lines of the form

    "foo" : "bar",
    "var" : 1,
    "vars" : [1, 2, 3],
    "bool" : true,
    "e" : 2.7182818459045

with or without trailing commas and with or without whitespace.

  • The get_json_key() function result contains the unquoted string before the colon (e.g., foo) as the key
  • The get_json_value(key, mold) produces a result matching the type, kind, and rank of the mold argument.

An assertion in each specification function supporting get_json_value verifies the presence of the correct key before the colon. Current specific functions of the generic get_json_value accept mold arguments that are

  • A real scalar,
  • A integer scalar,
  • A logical scalar,
  • A string_t scalar, or
  • A integer rank-1 array

All functions are pure. All functions that take only scalar arguments are also elemental.

What's Changed

  • Parse a restricted subset of JSON strings by @rouson in #56

Full Changelog: 4.1.0...4.2.0