rascal
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
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.
Codecov Report
Merging #1862 (4c57b8d) into main (d55cb74) will decrease coverage by
1%. The diff coverage is10%.
@@ 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: |
this requires some tests to be added. other than that it seems to do the job.