162 Commits

Author SHA1 Message Date
Patrick Cheng
95224aff7d When length is 0, the code does nothing, so skip it completely.
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.
2016-09-30 13:44:15 -07:00
Eli Fidler
89f6b8a380 Clang doesn't like the C-style casts in nmmintrin.h 2016-06-13 07:24:26 -07:00
Michael Thon
135da7ab34 Allow options for writing and parsing NaN/Infinity
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.
2016-05-20 23:54:55 +02:00
Milo Yip
01aeebf9bf Improve reader coverage by removing a default case 2016-04-17 09:47:29 +08:00
Milo Yip
fdd443120f Move break into same line to make coverage happy 2016-04-16 22:09:23 +08:00
Milo Yip
75d0e4ff65 Use single Peek() in SkipWhitespace
Fix #594
2016-04-07 00:47:26 +08:00
Jarred Nicholls
926d7ffcc8 Later clang compilers will warn on float -> double promotion because it can 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.
2016-03-29 15:44:30 -04:00
Nicholas Fraser
68217548f3 Added trailing comma support to iterative parser
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.)
2016-03-20 12:52:48 -04:00
Nicholas Fraser
3e21bb429d Added optional support for trailing commas
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.
2016-03-20 01:10:33 -04:00
Sergey Kosarevsky
6e70e3521a Removed commented code and added an explanatory comment instead 2016-03-05 13:47:32 +01:00
Milo Yip
d9cf99baf6 Normalize all line endings 2016-03-04 09:44:01 +08:00
Sergey Kosarevsky
b5966c3290 Added missing static_cast 2016-03-02 03:07:53 +01:00
Sergey Kosarevsky
bea3790a74 Don't insert terminating zero 2016-03-02 02:08:58 +01:00
Sergey Kosarevsky
3dba370486 Added IterativeParsingReaderHandler::RawNumber() 2016-02-29 17:51:32 +01:00
Sergey Kosarevsky
43a2c5694e Play nice with different encodings 2016-02-29 17:42:48 +01:00
Sergey Kosarevsky
9b13eacdf1 Add 0-character during in-situ numbers-as-strings parsing 2016-02-29 17:40:43 +01:00
Sergey Kosarevsky
f83b2c09e8 Fixed warning unused parameter ‘c’ 2016-02-29 16:31:54 +01:00
Sergey Kosarevsky
e23bc0d1a5 Fixed numbers-as-strings for in-situ streams 2016-02-29 16:12:30 +01:00
Sergey Kosarevsky
7d4891e243 Added NumberStream::Push() 2016-02-29 16:11:31 +01:00
Sergey Kosarevsky
a214bdff4d Removed unnecessary kParseInsituFlag check in ParseNumber() 2016-02-29 10:54:55 +01:00
Sergey Kosarevsky
6143f97b45 BaseReaderHandler::RawNumber() calls String() by default 2016-02-29 10:52:36 +01:00
Sergey Kosarevsky
f76174422d Fixed Ch type 2016-02-28 21:29:16 +01:00
Sergey Kosarevsky
2bbfe0d8a8 Number() -> RawNumber() to avoid name clashes with the union Number 2016-02-28 18:50:04 +01:00
Sergey Kosarevsky
d2d5f6f919 ParseNumber() handles kParseNumbersAsStringsFlag 2016-02-28 17:58:34 +01:00
Sergey Kosarevsky
4abcfd1e28 Added Number() to rapidjson::Handler 2016-02-28 17:58:01 +01:00
Sergey Kosarevsky
ba2b751b4d Added kParseNumbersAsStringsFlag 2016-02-28 17:33:49 +01:00
Milo Yip
48378b751e Optimize the new Parse() interfaces 2016-02-15 20:21:36 +08:00
Milo Yip
ab250d21bc Rectify parsing error offsets 2016-02-09 17:33:49 +08:00
Milo Yip
8cb978dc15 Add fwd.h and extract stream.h 2016-02-02 18:20:36 +08:00
Milo Yip
968a666acd Merge pull request #513 from miloyip/optimization
Make whitespace array more compact
2016-01-22 20:13:58 +08:00
Milo Yip
f183282b64 Fix warning 2016-01-22 19:03:00 +08:00
Milo Yip
a202d82339 Make whitespace array more compact 2016-01-22 18:42:50 +08:00
Milo Yip
4f4aff329f Fix clang compilation 2016-01-22 18:33:08 +08:00
Milo Yip
a5990f3eea Optimize ScanCopyUnescapedString for insitu parsing 2016-01-22 18:26:24 +08:00
Milo Yip
6863f7b24c Fix warning 2016-01-22 15:39:07 +08:00
Milo Yip
ae5cf58878 Fix ScanCopyUnescapedString performance issue 2016-01-22 15:33:08 +08:00
Milo Yip
69d0f41c4b Implemented ScanCopyUnescapeString optimization
Some performance issues to be fixed
2016-01-22 12:18:05 +08:00
Milo Yip
78c7d54aba Fix #498 VC2015 warnings 2016-01-20 22:29:50 +08:00
Milo Yip
df76c0d6d7 Apply LIKELY/UNLIKELY in Reader 2015-12-31 18:10:17 +08:00
Milo Yip
81c07721cb Try to fix clang and gcc warnings problems again x10 2015-12-18 20:38:08 +08:00
Milo Yip
efdbdc6016 Try to fix clang and gcc warnings problems again x8 2015-12-18 20:26:34 +08:00
Milo Yip
17f2ca6913 Try to fix clang and gcc warnings problems 2015-12-18 19:04:09 +08:00
Milo Yip
74c8dcfd57 Fix clang -Weverything 2015-12-18 18:34:04 +08:00
etiennebatise
74a021346d Add break at default switch case statements
fix issue #444
2015-10-14 15:46:26 +02:00
Andrey
f7960ac0e8 Comments parsing fixes.
* Comments parsing function correctly handles EOF.
* Since SkipWhitespaceAndComments can generate errors, its calls should be followed by RAPIDJSON_PARSE_ERROR_EARLY_RETURN macro.
* Some tests to make the bug never appear again.
2015-10-14 00:04:29 +03:00
Andrey
5ce78b135d Introduce support of comments. 2015-10-11 15:09:58 +03:00
Milo Yip
a326314a61 Fix #538 2015-06-18 15:40:39 +08:00
miloyip
ce0184e73b Add and fix -Wimplicit-fallthrough for clang, revert #350 2015-06-03 23:53:14 +08:00
Kal Conley
013b71b92f Fix warnings when compiling with clang and -Wimplicit-fallthrough 2015-05-31 20:35:55 +02:00
miloyip
1a570c342d Fix the undefined behaviour when negating the minimum value integers in Reader 2015-05-21 16:00:32 +08:00