This allows users to parse json without raising exceptions but still get
full exception details. This is very similar to how std::networking and
std::filesystem work. In that if the overload with std::error_code& is used
then no exceptions are raised.
- Removed static create functions from exceptions. Replaced with normal constructor so that it can be created on heap for assignment to std::unique_ptr.
- Removed bool allow_exceptions, no longer necessary with the &ex overload.
You can now pass a boolean "allow_exceptions" to the parse functions. If it is false, no exceptions are thrown in case of a parse error. Instead, parsing is stopped at the first error and a JSON value of type "discarded" (check with is_discarded()) is returned.
This commit removed the re2c lexer and replaced it by a manual version.
Its integration is not yet complete: number parsing does not respect
locales or overflows. Furthermore, parsing does not need to end with
EOF. Therefore, a lot of test cases fail. The idea is to push this
branch forward so we can conduct performance comparisons. So far, a
nice side effect are better diagnosis messages in case of parse errors.
Added class hierarchy for user-defined exceptions (#244). Integrated
parse exceptions 101-103. Parse exceptions include the byte count of
the last read character to locate the position of the error (#301).