Commit Graph

310 Commits

Author SHA1 Message Date
ToruNiina
06197605ba add link to toml-v0.5.0 official 2018-12-13 23:58:37 +09:00
ToruNiina
5c24cfd325 add example of multi-line error message 2018-12-13 23:47:32 +09:00
Toru Niina
abb6ae517d
Merge pull request from ToruNiina/toml-v050
WIP: major update: support TOML v0.5.0
2018-12-13 21:38:03 +09:00
ToruNiina
fd21d5dd95 add simplest copyright notice 2018-12-13 20:44:10 +09:00
ToruNiina
57de57a1de improve error message for empty value 2018-12-13 20:37:40 +09:00
ToruNiina
e86777d19c improve error message for conflicting tables 2018-12-13 20:17:57 +09:00
ToruNiina
e79069cc47 enable to show err msg for invalid insertion
like, with the following (invalid) toml file

> a.b = "value"
> a.b.c = 42

The error message becomes

> terminate called after throwing an instance of 'toml::syntax_error'
>   what():  [error] toml::insert_value: target (a.b) is neither table nor
> an array of tables
>  --> example.toml
>  1 | a.b = "value"
>    |       ~~~~~~~ actual type is string
>  ...
>  2 | a.b.c = 42
>    |         ~~ inserting this
2018-12-13 17:09:38 +09:00
ToruNiina
f60e93c36f enable to assign value keeping region info 2018-12-13 17:07:26 +09:00
ToruNiina
e5c29c2870 enable to show err msg for 2 different location 2018-12-13 17:07:03 +09:00
ToruNiina
acc7b7870f remove format_error_for_value and add get_region instead
it is convenient to have get_region function that can access region_info
in toml::value. get_region is placed in toml::detail and made friend of
toml::value because I don't want to make toml::value::region_info public
and keep it internal use only.
2018-12-13 16:13:05 +09:00
ToruNiina
06f04af375 fix typoes in README 2018-12-13 14:58:42 +09:00
ToruNiina
5125287ac7 fix datetime conversion
use internal duration type in std::chrono::system_clock::time_point
2018-12-13 14:57:42 +09:00
ToruNiina
56287803e7 update README a bit 2018-12-13 13:21:26 +09:00
ToruNiina
95d73a290f add test case for reading dotted-keys 2018-12-13 13:07:48 +09:00
ToruNiina
26e0d87d3b enable nanoseconds in datetimes 2018-12-13 12:49:53 +09:00
ToruNiina
fb6d51954a turn test_parse_unicode on; no change required 2018-12-13 02:28:52 +09:00
ToruNiina
4d7cfc9d1d turn test_parse_file on
the required change is;
- change Datetime -> offset_datetime and construct correctly.
2018-12-13 02:26:55 +09:00
ToruNiina
514f3c773f set test_from_toml 2018-12-13 02:24:03 +09:00
ToruNiina
77b237c53a update README 2018-12-13 02:00:42 +09:00
ToruNiina
27a80b1214 rename get(table, key) to find() 2018-12-13 02:00:13 +09:00
ToruNiina
f62bcb3077 update cmakelists 2018-12-13 01:30:25 +09:00
ToruNiina
be1a310ae5 move test for find to get_related 2018-12-13 01:30:06 +09:00
ToruNiina
affa159c82 add get_or(value, key, opt) 2018-12-13 01:29:23 +09:00
ToruNiina
901c299c40 add unwrap_or to result 2018-12-13 01:28:55 +09:00
ToruNiina
2080b30110 add test cases for test_to_toml 2018-12-13 00:38:36 +09:00
ToruNiina
c15cb15c4c simplify to_toml implementation 2018-12-13 00:38:04 +09:00
ToruNiina
d370ae7d0d set tm_isdst as negative value 2018-12-13 00:35:43 +09:00
ToruNiina
83b588a8c8 rename test code 2018-12-13 00:35:05 +09:00
ToruNiina
5bfbbe35a6 update README 2018-12-12 23:23:59 +09:00
ToruNiina
c69969733f use carriage return depending on env 2018-12-12 23:22:31 +09:00
ToruNiina
47cd6f5a41 remove redundant error message 2018-12-12 23:17:28 +09:00
ToruNiina
a19c9b4a39 add test case for find & get 2018-12-12 21:55:11 +09:00
ToruNiina
f64430af92 remove old test; individual test cases are added
test_parse_* is now available, old test_parser is not needed now
2018-12-12 20:55:58 +09:00
ToruNiina
8e154cdd74 add test case for parsing datetime 2018-12-12 20:55:30 +09:00
ToruNiina
65cfa9d06b remove unused file because its not stable
since toml::format is not stable now, remove once for the next release.
2018-12-12 20:35:21 +09:00
ToruNiina
cfd82c95f0 add test case for getting converted map 2018-12-12 20:32:26 +09:00
ToruNiina
18a22eb3c4 add test cases for datetime variants 2018-12-12 20:28:31 +09:00
ToruNiina
03be08a2e6 fix conversion from offset_datetime to system_clock::time_point 2018-12-12 20:28:11 +09:00
ToruNiina
27ad4e2d8f cleanup headers 2018-12-12 19:39:04 +09:00
ToruNiina
0924164f51 add a note about the error message 2018-12-12 19:36:57 +09:00
ToruNiina
d4a4865217 fix some errors in README 2018-12-12 19:35:33 +09:00
ToruNiina
1bc66f6c28 Merge branch 'toml-v050' of github.com:ToruNiina/toml11 into toml-v050 2018-12-12 19:33:13 +09:00
ToruNiina
b015e1ac5b update README for the next version 2018-12-12 19:33:01 +09:00
ToruNiina
5aae0b17c8 change error message; require unicode codepoint
before this, it recommends the range that can be represented by utf-8
but the range of valid unicode codepoint is narrower than that. for
error message, it is good to recommend valid unicode codepoint.
2018-12-12 19:14:27 +09:00
ToruNiina
0f83ee6039 change temporaly loc from token to copy of loc
location constructed from token string does not has correct line number
information. to show an informative error message about UTF-8 and escape
sequences, parse_(ml_)basic_string requires those information that can
only be given from root location<Container>.
2018-12-12 19:12:23 +09:00
ToruNiina
879b7d3bff improve format of error message for utf-8 2018-12-12 19:01:22 +09:00
ToruNiina
c33ad31981 split lexer for escape sequence for unicode 2018-12-12 18:59:20 +09:00
ToruNiina
5d29509d98 remove duplicated default argument for SFINAE 2018-12-12 18:58:54 +09:00
ToruNiina
717e03cd4a add find-get overload functions 2018-12-12 17:55:34 +09:00
ToruNiina
5a20d55dd0 add test for toml::get 2018-12-12 17:23:06 +09:00