Encodes deterministic JSON literals and escaped C++ string-literal bodies for generated Verilator wrapper sources.
json/1 intentionally supports only the value shapes emitted by the wrapper
generator: nil, booleans, integers, strings, lists, and maps. Map keys are
stringified and sorted so generated metadata is deterministic.
cpp_string/1 escapes a string body for insertion inside an existing C++
string literal. It does not add surrounding quotes.
Summary
Functions
Escapes a string body for insertion inside a C++ string literal.
Encodes a deterministic compact JSON literal.
Types
@type json_value() :: nil | boolean() | integer() | String.t() | [json_value()] | %{optional(term()) => json_value()}
Functions
Escapes a string body for insertion inside a C++ string literal.
The returned value is not surrounded with quotes.
@spec json(json_value()) :: String.t()
Encodes a deterministic compact JSON literal.