-
Notifications
You must be signed in to change notification settings - Fork 262
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_parsert: construct with message handler #8137
Conversation
The removal of the static object may create expectations that won't be met -- you can still only have one parser, given the state in the scanner. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8137 +/- ##
========================================
Coverage 79.09% 79.09%
========================================
Files 1695 1695
Lines 196578 196583 +5
========================================
+ Hits 155488 155493 +5
Misses 41090 41090 ☔ View full report in Codecov by Sentry. |
Wouldn't the |
f8cd15a
to
c1b50c3
Compare
I don't seem to find that? But yes, if we add such a PRECONDITION, it would be good to remove the static object. |
Line 43 of json/scanner.l is what I am referring to. |
Apologies, I looked at the current version, not the diff. Yes, that precondition does the job. |
Apologies, I think I want to take that back. I am afraid the precondition is too weak. Those scanners maintain internal state between calls to |
A solution would be to do that sort of check in the constructor of the parser object. |
This both avoids an object of static lifetime as well as it fixes the (transitive) use of the deprecated messaget() constructor. Both the parser and lexer are now fully reentrant.
c1b50c3
to
63e5910
Compare
I have now chosen to use Flex' support for reentrant scanners, making both the parser and the scanner reentrant. Pending completion of CI to make sure this is supported on all platforms. |
This both avoids an object of static lifetime as well as it fixes the (transitive) use of the deprecated messaget() constructor.