rascal icon indicating copy to clipboard operation
rascal copied to clipboard

added optional storage of constructor names and datatype names while serializing to JSON. Wired this through the different webservers as well

Open jurgenvinju opened this issue 2 years ago • 2 comments

This adds explicitConstructorNames and explicitDataType as keyword parameters to the JSON readers and writers. An constructor foo(bar(), what()) will be printed as such when explicitConstructorNames=true:

{
   _constructor = "foo",
   lhs = { 
      _constructor = "bar"
   },
   rhs = {
      _constructor = "what"
   }
}

This facilitates mapping syntax trees to JSON.

jurgenvinju avatar Sep 12 '23 09:09 jurgenvinju

Codecov Report

Merging #1862 (4c57b8d) into main (d55cb74) will decrease coverage by 1%. The diff coverage is 10%.

@@           Coverage Diff           @@
##              main   #1862   +/-   ##
=======================================
- Coverage       49%     49%   -1%     
- Complexity    6105    6107    +2     
=======================================
  Files          670     670           
  Lines        58756   58807   +51     
  Branches      8555    8568   +13     
=======================================
+ Hits         28809   28816    +7     
- Misses       27753   27797   +44     
  Partials      2194    2194           
Files Changed Coverage Δ
...pl/library/lang/json/internal/JsonValueWriter.java 0% <0%> (ø)
src/org/rascalmpl/library/util/TermREPL.java 0% <0%> (ø)
src/org/rascalmpl/library/util/Webserver.java 0% <0%> (ø)
src/org/rascalmpl/repl/REPLContentServer.java 0% <0%> (ø)
...pl/library/lang/json/internal/JsonValueReader.java 16% <19%> (+<1%) :arrow_up:
src/org/rascalmpl/library/lang/json/IO.java 39% <25%> (-2%) :arrow_down:

... and 7 files with indirect coverage changes

codecov[bot] avatar Sep 12 '23 09:09 codecov[bot]

this requires some tests to be added. other than that it seems to do the job.

jurgenvinju avatar Sep 12 '23 12:09 jurgenvinju