Age | Commit message (Collapse) | Author |
|
|
|
|
|
Correct instances of >> as they failed compilation.
|
|
|
|
|
|
|
|
|
|
(fixes #528)
|
|
Report a single low surrogate as kParseErrorStringUnicodeSurrogateInvalid.
|
|
RAPIDJSON_CLZLL is defined as macro of __builtin_clzll when
using gcc to compile. This introduces two issues:
1. in gcc __builtin_clzll returns int, not uint32_t.
2. __builtin_clzll return is undefined when input x is 0
See: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
This patch removes RAPIDJSON_CLZLL, merges __builtin_clzll to
internal clzll with input check and return value explicit cast.
Change-Id: Iac4b355dc5e5b4ed9b3f35a640b6b5537e76f22c
Signed-off-by: Jun He <jun.he@arm.com>
Co-authored-by: Jun He <jun.he@arm.com>
|
|
* Allow escaped apostrophe in values
* Allow escaped apostrophe in values
* Canonical flag name
* Add translation for escaped apostrophe
Co-authored-by: Milo Yip <miloyip@gmail.com>
|
|
|
|
Sometimes, particularly when Microsoft's windows.h is included, min/max
are defined as macros, interfering with use of
std::numeric_limits::min() and the like.
To guard against this, the function name is wrapped in an extra set of
parenthesis, which inhibits function-style macro expansion.
This is a similar commit to 6e38649ec6, but fixes uses of
std::numeric_limits added after that commit, like those introduced in
2ea43433e2.
|
|
|
|
Do not use an approximation to do this. Instead check if the result is Inf.
|
|
When parsing negative exponents, the current implementation takes
precautions for |exp| to not underflow int.
But that is not sufficient: later on [1], |exp + expFrac| is also
stored to an int - so we must ensure that the sum stays within int
representable values.
Update the exp clamping logic to take expFrac into account.
[1] https://github.com/Tencent/rapidjson/blob/master/include/rapidjson/reader.h#L1690
|
|
Added const for Reader methods
|
|
|
|
|
|
Found via `codespell -q 3` in downstream https://github.com/BlueBrain/Brayns
|
|
|
|
Change-Id: Iaf210d029758723a7eeb7f28fc10cab7467889a9
Signed-off-by: Jun He <jun.he@arm.com>
|
|
|
|
|
|
|
|
A failed half-consume of “NaN” now returns “value invalid” instead of
attempting to consume an “Inf”.
|
|
Runs about 1-2% faster (original speed) by running in a tight loop, at
the expense of slight code duplication with IterativeParseNext.
|
|
Doesn’t seem to affect timings in perftest on my machine, but it may
help others.
|
|
Further improvement to perftest and hoping to make coveralls happy.
|
|
Slight performance improvement over previous submission
|
|
|
|
Refactored the iterative parser so that users can parse a single JSON
element at a time (invoking the handler one time) and then return
control to the calling code. Call IterativeParseInit to start, and then
call IterativeParseNext to retrieve one JSON element. Use
IterativeParseComplete to check for JSON document completion.
|
|
added assertion to help suppress clang warnings
|
|
Fix #781
|
|
|
|
Previously, os.Push(0) would do nothing as well. But with the newly added assertion, is the stack is empty, it will fail the assertion.
|
|
Older GCC versions fail compiling RapidJSON due to a warning
include/rapidjson/reader.h:578: error: suggest a space before ';' or explicit braces around empty body in 'while' statement
: warnings being treated as errors
|
|
|
|
This adds kWriteNanAndInfFlag to Writer to allow writing of nan,
inf and -inf doubles as "NaN", "Infinity" and "-Infinity",
respectively, and kParseNanAndInfFlag to Reader to allow parsing
of "NaN", "Inf", "Infinity", "-Inf" and "-Infinity". This is part
of issue #36, adding optional support for relaxed JSON syntax.
|
|
|
|
|
|
Fix #594
|
|
add precision. In the context of RapidJSON – especially with its float methods on GenericValue – I think this warning holds no water and should be ignored.
Trim whitespace off the end of various lines.
Added an additional NumberStream specialization that will always perform a TakePush() even when just Take() is called. This supports RawNumber parsing by pushing onto our StackStream particular parts of the number that currently aren't captured because of full precision double parsing, such as the negative sign, scientific number exponents, etc.
RawNumber parsing fails with input streams that don't have copy optimization, such as the BasicIStreamWrapper stream. To work around this, instead do the Transcode copy operation by reading from a UTF8 StringStream instead of the original InputStream. Since the NumberStream downcasts all input Ch into chars, we know we're dealing with UTF8/ASCII compatible stack characters during the Transcoding.
|
|
This also fixes cases where the iterative parser should have produced
kParseErrorValueInvalid rather than kParseErrorUnspecifiedSyntaxError
when expecting a value (after a colon in an object, after a comma in an
array, and at the start of an array.)
|
|
This adds kParseTrailingCommasFlag to allow a trailing comma at the
end of maps and arrays. This is part of issue #36, adding optional
support for relaxed JSON syntax.
|
|
|
|
|
|
|
|
|
|
|