Commit Graph

76 Commits

Author SHA1 Message Date
ToruNiina
5bea3508c6 feat: Merge branch 'main' into check-source-location-file-name-result 2025-01-05 15:38:28 +09:00
ToruNiina
8fcb759694 fix: check std::source_location::file_name result
encountered an error with nullptr from std::source_location::file_name
2024-11-26 02:42:51 +09:00
ToruNiina
869fdbdf8f feat: reduce memory consumption with long line
source_location stores the whole line. In case of short range in a long
line like:
```
array = [1, 2, 3, ... , 100, 101, ..., 10000]
                        ^^^- the region
```
It save the whole line as a `std::stirng`. It consumes a lot of memory
and slows down everything. We can omit most of the part of the line
because we only need the region, `100` here.
2024-10-21 03:03:13 +09:00
ToruNiina
42a2628924 feat: save column_number in location
instead of calculating it every time
2024-10-19 00:04:08 +09:00
ToruNiina
befe379241 refactor: restrict retrace dist == 1
to simplify the implementation
2024-10-18 02:24:11 +09:00
ToruNiina
f06ad06ad7 refactor: rm argument(same as default) of retrace 2024-10-18 02:21:38 +09:00
ToruNiina
5fbb86d989 refactor: rename adv_line_num -> adv_impl 2024-10-18 02:08:22 +09:00
ToruNiina
1ba90bc505 refactor: remove set_location 2024-10-18 00:35:13 +09:00
hayt
b0d9e81d85 fix: prevent size_t-max length string allocation
prevent an issue, where a string was created with size_t(0)-1 length.

When creating underlines for error output, the current column sometimes had cases
where it was set to 0 caused an underflow.
2024-09-22 10:15:47 +02:00
Aleš Matěj
9c7cef94a5 fix: add missing zero initialization to region 2024-08-19 14:18:29 +02:00
ToruNiina
cc0bee4fd4 feat: bump version 2024-08-12 12:47:30 +09:00
ToruNiina
5d74160df3 fix: do not use recursion in last_one(Ts...) 2024-08-10 14:19:11 +09:00
ToruNiina
834ec3a835 feat: include <exception> for terminate 2024-08-08 00:58:00 +09:00
ToruNiina
80c3e343e7 fix: if aot is empty, format as oneline
[[aot]] itself defines an empty table, so there is no way to format an
empty array-of-tables as table-like format. the only way to format an
empty array is: = [].
2024-08-06 01:28:59 +09:00
ToruNiina
12c0f379f2 fix: typo in format output 2024-07-25 01:41:21 +09:00
Ken Matsui
696335aaf7 Make thread_local for color_mode optional 2024-07-24 07:04:40 -07:00
Ken Matsui
6d4d953304 Support std::optional members for TOML11_DEFINE_CONVERSION_NON_INTRUSIVE 2024-07-23 10:03:58 -07:00
Pino Toscano
fe19e7ee0a fix: manually cast file size to std::streamsize
When reading a file to vector, manually cast the file size (represented
as std::streamoff hidden as auto) to std::streamsize, which is the type
for std::istream::read(); this avoids the warning/error

  error: conversion from ‘long long int’ to ‘std::streamsize’ {aka ‘int’} may change value [-Werror=conversion]

This means a truncation happens on 32bit architectures, however that
seems a limitation of the standard library.
2024-07-21 10:36:40 +02:00
ToruNiina
f33ca743fb chore: bump version 4.1.0 2024-07-21 14:48:47 +09:00
ToruNiina
96460a15d4 feat: support key string conversion in get<map> 2024-07-20 20:57:42 +09:00
ToruNiina
f3a1586a44 Merge branch 'u8string' into v4_1_0 2024-07-20 17:59:30 +09:00
ToruNiina
098569a96d Merge branch 'main' into v4_1_0 2024-07-20 17:57:05 +09:00
ToruNiina
43f5a74bf0 feat: support string_type in toml::format 2024-07-20 17:23:05 +09:00
ToruNiina
6085c53ea2 fix: skip null char in string literal 2024-07-20 17:21:56 +09:00
xep
b853860a8f Add: template-version into_toml (Github issue #255) 2024-07-20 10:44:45 +08:00
ToruNiina
eba1aa2fde feat: take string type itself when conversion 2024-07-20 04:36:32 +09:00
ToruNiina
8434a6b18b Merge branch 'u8string' into v4_1_0 2024-07-18 01:03:58 +09:00
ToruNiina
d9449747f3 fix: add constraint to array-like/table-like 2024-07-17 01:03:47 +09:00
ToruNiina
00e0ce12e7 feat: generalize ctor and remove feature macro 2024-07-16 23:48:15 +09:00
ToruNiina
d99f260c1a Merge branch 'origin/output-operator' into v4_1_0 2024-07-16 00:31:20 +09:00
ToruNiina
c0a8b60a5d feat: enable to convert generic string 2024-07-16 00:17:18 +09:00
ToruNiina
0f0f9cf3c1 feat: set upper/lowercase while serialization 2024-07-14 15:12:34 +09:00
ToruNiina
49b373d4f5 feat: parse hex int upper/lowercase 2024-07-14 15:12:18 +09:00
ToruNiina
acd6ed9a1e feat: add uppercase to integer fmt
for hex integer
2024-07-14 15:11:05 +09:00
ToruNiina
654ec0e013 feat: add stream operator to value 2024-07-14 14:20:04 +09:00
ToruNiina
f86d04f64d fix: toml::get<array-like> avoid u8string 2024-07-10 02:42:25 +09:00
ToruNiina
b78a37c826 feat: add u8string ctor 2024-07-10 02:39:51 +09:00
ToruNiina
29fbb6b695 feat: enable to convert key char type 2024-07-10 02:39:04 +09:00
ToruNiina
31810136d1 feat: generalize string converter 2024-07-10 02:37:29 +09:00
ToruNiina
a77516a2d0 feat: add string converter 2024-07-10 02:22:50 +09:00
ToruNiina
826e6414a0 feat: add detail::is_std_basic_string
to check if type T is a kind of std::basic_string<Char,...>
2024-07-10 02:04:31 +09:00
Andreas Keller
143437d309 Fix not checking for \\r\\n when parsing line comments 2024-07-09 09:50:31 +02:00
ToruNiina
5ac47b8983 chore: bump version to 4.0.3 2024-07-06 18:59:31 +09:00
ToruNiina
ed1604ca58 fix: ignore argument for NDEBUG build 2024-07-06 03:38:25 +09:00
ToruNiina
b2ea268d69 fix: unreachable code 2024-07-06 02:30:09 +09:00
ToruNiina
d72493a2fc fix: remove name of unused argument 2024-07-06 01:37:11 +09:00
ToruNiina
0eb9a90abf refactor: move HAS_CHAR8_T to version.hpp 2024-07-05 23:40:16 +09:00
ToruNiina
0cc0ef959b fix: directly access to member if type is the same 2024-07-05 23:32:00 +09:00
ToruNiina
d4742334ce fix: add detail::make_error_info_rec overload
that converts basic_value to location
2024-07-02 23:34:49 +09:00
ToruNiina
ccd941dc5b fix: remove default arg from fwd decl 2024-07-02 00:03:10 +09:00