Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jurgenvinju
Copy link
Member

@jurgenvinju jurgenvinju commented Sep 12, 2023

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.

…serializing to JSON. Wired this through the different webservers as well
@codecov
Copy link

codecov bot commented Sep 12, 2023

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%) ⬆️
src/org/rascalmpl/library/lang/json/IO.java 39% <25%> (-2%) ⬇️

... and 7 files with indirect coverage changes

@jurgenvinju
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant