-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Patch to fix Issue #230 #240
Conversation
…fferent execution points.
Oops, I didn't realize how the hpp file was generated. I will push my changes into re2c instead. |
No worries. If you have a hint how to improve the documentation for committers, please let me know! Looking forward to your fix! |
…made my changes to json.hpp.re2c as I should have. Tests back to green, with no direct edits to json.hpp
Hmm, Travis build is failing because it looks like the build machine can't find cmake. The builds on my machine and AppVeyor seem ok, though. Any ideas @nlohmann ? (sorry for being a pain!) |
The reason for the error is that you overwrote the project's Makefile locally and committed this change. Could you please restore the Makefile or just exclude it from your commit? |
@@ -7848,9 +7848,8 @@ class basic_json | |||
result.m_type.bits.parsed = true; | |||
|
|||
// 'found_radix_point' will be set to 0xFF upon finding a radix |
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 comment needs to be adjusted to the fact that found_radix_point is a Boolean now ("set to 0xFF" makes no sense).
@KAMTRON , I added some notes to the changes of |
The roundtrip feature is still buggy and will not make it into 2.0.0. Therefore, I close this PR. Thanks so much @KAMTRON for your work. I hope you understand that the this PR does not fix the problem of having "100%" correct roundtrip behavior. See #230 (comment) for the discussion. |
Files to change
There are currently two files which need to be edited:
src/json.hpp.re2c
(note the.re2c
suffix) - This file contains a comment section which describes the JSON lexic. This section is translated byre2c
into filesrc/json.hpp
which is plain "vanilla" C++11 code. (In fact, the generated lexer consists of some hundred lines ofgoto
s, which is a hint you never want to edit this file...).If you only edit file
src/json.hpp
(without the.re2c
suffix), your changes will be overwritten as soon as the lexer is touched again. To generate thesrc/json.hpp
file which is actually used during compilation of the tests and all other code, please executeTo run
re2c
and generate/overwrite filesrc/json.hpp
with your changes in filesrc/json.hpp.re2c
.test/unit.cpp
- This contains the Catch unit tests which currently cover 100 % of the library's code.If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled with
and can be executed with
The test cases are also executed with several different compilers on Travis once you open a pull request.
Please understand that I cannot accept pull requests changing only file
src/json.hpp
.Note
Please don't
src/json.hpp
-- please read the paragraph above and understand whysrc/json.hpp.re2c
exists.#ifdef
s or other means.