Chen
08aa252611
Support kinds of emitter format-setting for YAML::Null. ( #906 )
...
* Support kinds of emitter format-setting for YAML::Null.
* update the code and test cases
* add the comment //fallthrough
2020-06-28 23:31:53 -05:00
Chen
5a9ab177ba
tag_null ( #897 )
2020-06-17 12:49:09 -05:00
Chen
72fe73a104
fix issue752: generate right long keys ( #879 )
...
* fix issue752: generate right long keys
* Improve the readability of test cases
* update to raw string literal
2020-06-17 00:57:28 -05:00
Rosen Penev
b2cd008717
partially fix clang compilation ( #893 )
...
* partially fix clang compilation
Missing header and mistaken algorithm usage.
Also removed it name from range loops. It's not correct.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* run through clang's -Wrange-loop-analysis
Some range loops should not use references as they need to copy.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* manual range loop conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 16:59:27 -05:00
Chen
4dbfeb0bbc
Support as<uint8_t>/as<int8_t>.
...
Fix issue 844/848.
2020-06-15 10:31:59 -05:00
Chen
33316d531b
Add tests for some interfaces of emitter ( #875 )
2020-05-31 09:16:16 -05:00
Raúl Gutiérrez Segalés
f05b2577ad
Fix crash when parsing {x:
( #865 )
2020-05-23 12:17:20 -05:00
Chen
d9c35b6079
Throw an exception when trying to parse a negative number as an unsigned.
...
Fixing issue 859.
2020-05-19 11:48:22 -05:00
Chen
4b98aedc16
Supplement test cases for 2.19 ~ 2.22 schema tags. ( #857 )
...
Add test cases for the event handler for schema tags; does not include test cases for Node because specialized tag handling is not implemented yet.
2020-05-12 13:20:45 -05:00
Ted Lyngmo
ce056acab7
Add IsNull() check in test after reassignment ( #814 )
2020-02-07 10:52:43 -06:00
Jesse Beder
c9460110e0
Fix reading empty token stack with a node with properties but no scalar.
...
E.g. `!2`.
2020-01-20 18:16:08 -06:00
Jeppe Blicher Tarp
e0e01d53c2
Make sure output of NaN, Infinity and -Infinity is identical on all platforms ( #717 )
...
Specifically, printing `.nan`, `.inf`, and `-.inf`, respectively, as per the spec section 10.2.1.4.
2019-08-03 21:41:45 -04:00
bedapisl
0122697561
Improve error messages on operator[] or as<> ( #656 )
...
Invalid access via operator[] or as<> will now print the offending key, if possible.
For example:
a:
x: 1
y: 2
node["a"]["z"].as<int>()
will say that the key "z" was invalid.
2019-04-17 08:44:09 -05:00
caryoscelus
eca9cfd648
Add optional OnAnchor method to EventHandler ( #530 )
...
ref #110
2019-03-12 15:24:32 -07:00
Simon Gene Gottlieb
abf941b20d
Fix float precision ( #649 )
...
The issue is that numbers like
2.01 or 3.01 can not be precisely represented with binary floating point
numbers.
This replaces all occurrences of 'std::numeric_limits<T>::digits10 + 1' with
'std::numeric_limits<T>::max_digits10'.
Background:
Using 'std::numeric_limits<T>::digits10 + 1' is not precise enough.
Converting a 'float' into a 'string' and back to a 'float' will not always
produce the original 'float' value. To guarantee that the 'string'
representation has sufficient precision the value
'std::numeric_limits<T>::max_digits10' has to be used.
2018-12-21 09:05:19 -05:00
Stefan Reinhold
45d9035a33
Skip newlines in binary decoding ( Fix #387 ) ( #616 )
...
* Skip newlines in binary decoding
This fixes #387
* Skip all whitespace characters
This also removes spaces and tabs in addition to newlines.
2018-09-03 15:55:45 -05:00
Denis Gladkikh
cfb7606a84
Fix tag parsing with () ( #532 )
2018-01-28 10:18:55 -06:00
butataatawa
d025040049
Fix input strings with quotes giving "!" tagging artifacts.
2016-12-02 08:58:48 -06:00
Jesse Beder
086fec5c35
Fix formatting when writing \ as a character.
2016-10-11 23:58:03 -05:00
Jesse Beder
7d2873ce9f
Fix scalar parsing when a line starts with a comment.
2016-04-02 16:02:26 -05:00
Jesse Beder
bfb5703ce9
Add test to verify that ~ is loaded as null.
2016-04-01 20:01:01 -05:00
Jesse Beder
178c8d1f27
Add test for parser exceptions for incomplete JSON.
2016-03-26 16:01:00 -04:00
Jesse Beder
36fd93a8d5
Fix formatting when writing " as a character.
2016-01-10 12:08:42 -06:00
Jesse Beder
25b2ed0787
Fix operator bool() exception on zombie node
2015-03-29 14:31:22 -05:00
Jesse Beder
f9ff72dee7
Add test for an empty string not being null
2015-01-24 17:30:12 -06:00
Jesse Beder
899b6614c1
Merge from core
2015-01-24 16:07:36 -06:00
Jesse Beder
bc86fd4aec
Force null to be quoted if written as a string
2015-01-24 16:07:10 -06:00
Jesse Beder
391111c055
Merge core
2015-01-24 14:40:55 -06:00
Jesse Beder
570ab9d3fb
Fix unused arg warnings for EmitterStyle
2015-01-24 14:39:17 -06:00
Jesse Beder
0c280724e9
Add flow/block style setting on Nodes
2015-01-24 13:11:43 -06:00
Jesse Beder
9880b608b9
Merge from core
2015-01-24 12:26:16 -06:00
Jesse Beder
ad712c4f2d
Add EmitterStyle, which will allow sequence or map style (i.e., flow or block) to be preserved between parsing and emitting
2015-01-24 12:19:20 -06:00
Jesse Beder
98a181c7a7
Merge from core
2014-03-23 22:25:53 -05:00
Jesse Beder
fcfd6635b0
Removed unicode control sequence from test, since it's not guaranteed that the source code is UTF-8
2014-03-23 22:25:25 -05:00
Jesse Beder
3bd412ccc3
Merge from core
2014-03-23 20:25:13 -05:00
Jesse Beder
114db22335
Fix UTF16 parsing for multi-byte characters
2014-03-23 20:24:36 -05:00
Jesse Beder
253c80d09e
Merge from core
2014-03-23 20:17:34 -05:00
Jesse Beder
06bf012d81
clang-format
2014-03-23 20:08:54 -05:00
Jesse Beder
ad0a3311a7
Convert node tests to gtest
2014-03-23 19:21:13 -05:00
Jesse Beder
33424ecb65
Merge from core
2014-03-23 18:14:51 -05:00
Jesse Beder
d508a7cb0d
Import encoding test from old-api
2014-03-23 18:12:23 -05:00
Jesse Beder
2e8841c6fa
Merge from core
2014-03-23 16:39:33 -05:00
Jesse Beder
ad2953f660
Converted gen emitter tests to gtest, and removed the old testing framework from core
2014-03-23 16:35:26 -05:00
Jesse Beder
ebf14ec83a
Factored out HandlerTest as a base class
2014-03-23 16:26:44 -05:00
Jesse Beder
066b71a755
Factored out mock event handler
2014-03-23 16:17:16 -05:00
Jesse Beder
f946473437
Merge from core
2014-03-23 15:01:08 -05:00
Jesse Beder
90d7562be3
Fixed uninteresting mock
2014-03-23 14:50:58 -05:00
Jesse Beder
1327ce6d73
Convert core parser tests to gtest
2014-03-23 14:47:30 -05:00
Jesse Beder
05834520e5
Merge from core
2014-03-23 14:06:56 -05:00
Jesse Beder
dfa32c7f44
Renamed SpecTest to HandlerSpecTest
2014-03-23 14:06:37 -05:00