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 by re2c into file src/json.hpp which is plain “vanilla” C++11 code. (In fact, the generated lexer consists of some hundred lines of gotos, 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 the src/json.hpp file which is actually used during compilation of the tests and all other code, please execute
make re2c
To run re2c and generate/overwrite file src/json.hpp with your changes in file src/json.hpp.re2c.
test/src/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
make
and can be executed with
./json_unit
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.
src/json.hpp -- please read the paragraph above and understand why src/json.hpp.re2c exists.#ifdefs or other means.