rascal
rascal copied to clipboard
`parseJSON` does not support `null` in JSON
Reproduce:
rascal>import lang::json::IO;
ok
rascal>parseJSON(#map[str,value], "{\"bla\": null}");
|std:///lang/json/IO.rsc|(2599,303,<49,0>,<52,144>): IO("NPE")
at *** somewhere ***(|std:///lang/json/IO.rsc|(2599,303,<49,0>,<52,144>))
at parseJSON(|std:///lang/json/IO.rsc|(2895,5,<52,137>,<52,142>)ok
As Rascal does not support null, we need a sentinel value, but this cannot be chosen by the implementation. Suggestion: a keyword parameter specifying a custom value to use in case of null.