mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
Add support for stripping_comments from json. Update documentation of primop
This commit is contained in:
parent
d95ff93e70
commit
00921f6e3c
2 changed files with 4 additions and 1 deletions
|
|
@ -204,7 +204,8 @@ public:
|
|||
void parseJSON(EvalState & state, const std::string_view & s_, Value & v)
|
||||
{
|
||||
JSONSax parser(state, v);
|
||||
bool res = json::sax_parse(s_, &parser);
|
||||
bool res = json::sax_parse(
|
||||
s_, &parser, nlohmann::detail::input_format_t::json, /* strict= */ true, /* ignore_comments= */ true);
|
||||
if (!res)
|
||||
throw JSONParseError("Invalid JSON Value");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2492,6 +2492,8 @@ static RegisterPrimOp primop_fromJSON({
|
|||
```
|
||||
|
||||
returns the value `{ x = [ 1 2 3 ]; y = null; }`.
|
||||
|
||||
This function supports JSON with comments.
|
||||
)",
|
||||
.fun = prim_fromJSON,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue