• Philipp A. Hartmann's avatar
    reader.h: prepare "early return path" for exception support · 3c1d4bc2
    Philipp A. Hartmann authored
    In case of a user-defined RAPIDJSON_PARSE_ERROR_NORETURN that throws
    an exception instead of using the Rapidjson ParseError API, the early
    return paths performing the stack unwinding manually can be omitted as
    well.
    
    This patch provides a customizable RAPIDJSON_PARSE_ERROR_EARLY_RETURN
    macro to remove these (then unneeded) control paths from the parsing
    implementation (with and without a return value).
    
    Secondly, clearing the parse stack is moved to a small helper struct
    that calls stack_.Clear() from its destructor.  This avoids the need
    for the 'goto' in the ParseStream function and ensures proper cleanup
    even if e.g. a user-defined Allocator throws an exception.
    3c1d4bc2
Name
Last commit
Last update
bin Loading commit data...
build Loading commit data...
doc Loading commit data...
example Loading commit data...
include/rapidjson Loading commit data...
test Loading commit data...
thirdparty Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
license.txt Loading commit data...
readme.md Loading commit data...