-
Notifications
You must be signed in to change notification settings - Fork 77
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
json lazy parser unparser and support for reading NULL values. #1978
Conversation
jurgenvinju
commented
Jun 17, 2024
•
edited
Loading
edited
- read and write JSON null values, every type can register its preferred null representation in Rascal. Maybe[&T] is also builtin supported
- read and write JSON str values as algebraic data-typed, by providing your own parsers/unparsers for specific data types
- accurate line/colum, offset/lengths for parse and validation errors
- tests for the above
- application of the above to the cytoscape.js bridge to improve the Rascal import graph visualization
- fix Json random test failed #2098
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1978 +/- ##
========================================
Coverage 49% 49%
- Complexity 6317 6346 +29
========================================
Files 666 667 +1
Lines 59695 59836 +141
Branches 8670 8691 +21
========================================
+ Hits 29600 29725 +125
+ Misses 27863 27857 -6
- Partials 2232 2254 +22 ☔ View full report in Codecov by Sentry. |
…s. Have to bring that back somehow by expecting NULL in the specific loops for keyword parameters
@tvdstorm I added the null values here. Do you fancy the solution? |
Since this adds parameters to Java methods we have to wait until after the current release cycle to merge this. |
…and quoted strings with unbalanced quotes
A lot of things are happening in this PR, and I'm missing:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to JsonValueReader
are hard to oversee, it mostly looks fine, but I would want to take some time and test the impact on VS Code and it's use of the JsonValueReader
class.
pom.xml
Outdated
@@ -164,7 +164,7 @@ | |||
<configuration> | |||
<isPackageCourse>false</isPackageCourse> | |||
<enableStandardLibrary>false</enableStandardLibrary> | |||
<errorsAsWarnings>false</errorsAsWarnings> | |||
<errorsAsWarnings>true</errorsAsWarnings> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want this as part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary for bootstrapping the tutor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still going to see if we can minimize the number of failing pages before merging.
src/org/rascalmpl/library/lang/rascal/tests/library/lang/json/JSONIOTests.rsc
Show resolved
Hide resolved
The changes have been designed such that there can't be impact on existing uses of the JSON IO clients, unless they were waiting for NPEs for inputs with Recommend to focus on that distintion. Typically |
The other changes are only activated by providing new actual keyword parameters to |
…es based on the naming scheme arg<index>
…the representable range for JSON
Is there a way to increase the test coverage? Only 35% of the added lines for the JSONReader are covered according to codecov. |
The reason is that the IO tests use the @deprecated JSON readers and writers. To change this we need to simply replace the reader by the new parser and the writer by the new unparser in the "new" here is already 8 years (!!!), btw. It's really time to remove the deprecated functions and continue with the new ones |