Commit Graph

1400 Commits

Author SHA1 Message Date
ToruNiina
8e95891af1 fix: report an error if a table is inserted to aot 2022-06-22 21:48:37 +09:00
ToruNiina
2a987ac9ea chore: update toml-test to the latest release 2022-06-22 21:28:31 +09:00
ToruNiina
9e1bfcc962 doc: merge contributions from the same person 2022-06-22 21:24:22 +09:00
ToruNiina
4a0df22548 doc: update contributor list 2022-06-14 23:31:58 +09:00
ToruNiina
1ba3be38d0 fix: point the beginning of value in err msg 2022-06-08 01:33:10 +09:00
ToruNiina
5be587bb68 fix #190: Merge branch 'throw-when-overflow' 2022-06-08 01:27:30 +09:00
ToruNiina
d6efdf7d9e test: check if an exception is thrown by overflow 2022-06-08 00:40:28 +09:00
ToruNiina
12d0dbc6f4 fix: throw if number cannot be read losslessly
it throws when strtoll and strtof that are internally called fail
2022-06-08 00:39:04 +09:00
Toru Niina
6d9e533cf1
Merge pull request #189 from muggenhor/fix/avoid-fname-copy
fix: don't force a copy of std::string fname when moving is an option
2022-06-04 20:49:33 +09:00
Giel van Schijndel
aff6f0f574 fix: don't force a copy of std::string fname when moving is an option
Taking this parameter by const reference forces us to copy it (because
we know we're going to store it). Taking it by r-value reference would
suggest that we _might_ take ownership over it and would also force the
user to make a copy if they wish to retain the original value.

Taking this parameter by value however clearly gives us ownership of its
content without forcing a copy if it's implicit conversion from
`const char*` or explicitly handed over to us by the user via std::move.
2022-06-02 14:39:10 +02:00
ToruNiina
25be97dc39 refactor: style update 2022-05-29 00:37:39 +09:00
Toru Niina
846abd9a49
Merge pull request #188 from ken-matsui/support-changing-color-mode-at-runtime
Support changing color mode at runtime
2022-05-27 22:49:56 +09:00
Ken Matsui
9086b1114f
Support changing color mode at runtime 2022-05-27 00:01:28 +09:00
ToruNiina
e8f922a1b8 chore: use the latest release of toml-test on CI
The CI task that corresponds to toml-test HEAD is currently failing.
Using the latest stable release is safer.
2022-05-22 15:40:54 +09:00
Toru Niina
fdb228598d
Merge pull request #187 from ken-matsui/support-opting-out-of-error-prefix
Support opting out of the default `[error]` prefix
2022-05-22 15:22:01 +09:00
Ken Matsui
c26aa013cd
Support opting out of the default [error] prefix 2022-05-22 13:50:45 +09:00
ToruNiina
5924325652 doc: update unreleased TOML features section 2022-03-17 00:07:48 +09:00
ToruNiina
1836ddc129 test: test -DTOML11_USE_UNRELEASED_TOML_FEATURES 2022-03-16 22:46:21 +09:00
ToruNiina
1c82c7a1dc fix: move cmake option to toplevel cmakelists 2022-03-16 22:40:42 +09:00
ToruNiina
dde351ea40 feat: add escape sequence of ESC
as an unreleased feature
2022-03-16 22:39:52 +09:00
ToruNiina
dcfe39a783 chore: update version number 2022-03-13 01:44:29 +09:00
ToruNiina
2f07030d43 doc: update the list of contributors 2022-03-13 01:40:43 +09:00
ToruNiina
97cc0ef62b fix #166: reorder local/gmtime wrapper for MSVC 2022-03-13 00:20:00 +09:00
ToruNiina
0e80cabe65 Merge branch 'check-specialized-conversion' 2022-03-12 19:00:29 +09:00
ToruNiina
cd97dfcec1 Merge branch 'insertion-to-table-defined-by-dotted-key' 2022-03-12 19:00:07 +09:00
ToruNiina
e60442c6db fix: check if re-open dotkey by a table
like:
```
a.b.c = "foo"
[a.b] # this is invalid
d = "bar"
```
2022-03-12 18:22:01 +09:00
Toru Niina
d39fd88a17
Merge pull request #185 from ax3l/topic-installEmbed
CMake: Optional Install if Embedded
2022-03-07 23:12:33 +09:00
Axel Huebl
7fb8b84143
CMake: Optional Install if Embedded
When adding this library as embedded library with private
"target link", e.g., only used inside private source files, the
library does not need to be installed when the main project gets
installed.

This adds an additional option `toml11_INSTALL` similar to the
test-build control switch in order to skip installing headers and
CMake config files if requested.

Avoids using
```cmake
add_subdirectory(path/to/toml11 EXCLUDE_FROM_ALL)
```

which has further side-effects:
https://cmake.org/cmake/help/v3.0/command/add_subdirectory.html
2022-03-03 18:55:55 -08:00
ToruNiina
03259e2003 fix #177: check specific conversion function
when converting toml::value to array-like
2021-12-25 14:08:55 +09:00
ToruNiina
bf2384d8da fix #182: Merge branch 'workaround-msvc-cplusplus-macro' 2021-12-18 15:41:43 +09:00
ToruNiina
8ebf9c984b ci: check if it works w/o /Zc:__cplusplus 2021-12-18 14:23:58 +09:00
ToruNiina
7354e91924 fix: Allow MSVC to have old version 2021-12-18 00:36:20 +09:00
ToruNiina
4522070391 ci: check if MSVC 14 2015 (19.0.24241.7) (1900)
passes ci build if we skip _MSVC_LANG
2021-12-18 00:21:55 +09:00
ToruNiina
02fd8a577b feat: workaround __cplusplus problem on MSVC 2021-12-17 22:29:57 +09:00
ToruNiina
40777070ad fix: disallow dotkey and inline table migration 2021-12-16 22:16:24 +09:00
ToruNiina
cc1cc27613 fix: disallow merging dotted key and inline table
current code mistakenly allows the following TOML file.
```toml
a.b = 42       # table "a" is defined here, implicitly
a = {c = 3.14} # table "a" is overwritten here
```
But we need to allow the following (structually similar) TOML file.
```toml
a.b = 42   # table "a" is defined here, implicitly
a.c = 3.14 # table "a" is merged with {c = 3.14}
```
To distinguish those, we check whether the current table is defined as
an inline table or via dotted key. If the table we are inserting is
defined via dotted key, we accept it and merge the table. If the table
being inserted is defined as an inline table, then we report an error.
2021-12-16 01:11:47 +09:00
ToruNiina
75e297eb47 fix: Merge branch 'check-datetime'
Briefly check if a given date and time is valid
2021-12-15 22:35:56 +09:00
ToruNiina
0d0605e290 fix #181: Merge branch 'no-null-char' 2021-12-15 22:35:31 +09:00
ToruNiina
23f6c931e5 test: add valid/invalid datetime cases 2021-12-15 00:51:07 +09:00
ToruNiina
518e6d4ae2 feat: check date and time are valid or not 2021-12-15 00:31:41 +09:00
ToruNiina
db2aa55d20 fix: disallow null char at the end of input
since std::string and ""_toml literal actually does not include null
char, we don't need to check if the last char is null or not
2021-12-14 22:33:58 +09:00
ToruNiina
1b5107e5e3 fix #180: Merge branch 'linefeed-at-eof' 2021-12-11 23:13:42 +09:00
ToruNiina
2152c85cd1 test: add test_file_ends_without_lf 2021-12-10 23:46:47 +09:00
ToruNiina
2e4c7fb95e fix: line-feed is not required at the EOF 2021-12-10 23:39:54 +09:00
ToruNiina
2ddcfb4b61 doc: update constributors in README 2021-12-08 21:50:09 +09:00
Toru Niina
3f233d57be
Merge pull request #178 from marascio/lrm-resolve-173-free-nonheap-object
Resolve g++ warning: free-nonheap-object
2021-12-05 19:46:38 +09:00
Louis R. Marascio
21732fce45 Resolve g++ warning: free-nonheap-object
As described in issue #173, this warning is raised on various platforms
and in various build types. For example, g++ 11 in release mode will
cause this warning to be raised. This change fixes this warning.
2021-12-01 14:43:43 -06:00
Toru Niina
1dc09d0332
Merge pull request #176 from GMLC-TDC/fix_warnings
Fix warnings
2021-11-25 00:13:36 +09:00
Philip Top
9c1708c988
Update toml/traits.hpp
Co-authored-by: Toru Niina <niina.toru.68u@gmail.com>
2021-11-24 06:40:09 -08:00
Philip Top
84f61f7dc8 match the cmake condition to upstream 2021-11-23 16:16:16 -08:00