rascal icon indicating copy to clipboard operation
rascal copied to clipboard

`parseJSON` does not support `null` in JSON

Open tvdstorm opened this issue 1 year ago • 5 comments

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.

tvdstorm avatar Jun 25 '24 14:06 tvdstorm