104 Commits

Author SHA1 Message Date
ToruNiina
0c7dba2d0a feat: bump version.hpp to v4.4.0 2025-02-15 23:41:59 +09:00
ToruNiina
c4637a4222 feat: keep only 1 scanner in a cache
while parsing, thread_local cache will not use scanners constructed from
multiple toml::spec. we don't need to keep multiple scanners
2025-02-13 20:57:07 +09:00
ToruNiina
405fd8e2ca feat: cache syntax scanner to speedup 2025-02-10 20:01:41 +09:00
ToruNiina
37359d42e6 feat: directly use sub-scanners in special scanner 2025-02-08 00:59:08 +09:00
ToruNiina
46db8643c1 feat: Merge branch 'main' into refactor-scanner 2025-02-08 00:30:37 +09:00
ToruNiina
dda740281e fix: add missing include file 2025-02-07 01:26:58 +09:00
ToruNiina
d7aae40365 feat: add compare operators to spec 2025-02-07 01:06:23 +09:00
ToruNiina
7c94ae1500 feat: use escaped_uUx in parse_escape_sequence 2025-02-07 00:55:39 +09:00
ToruNiina
0e734cb3b6 feat: add syntax for each escape seqs 2025-02-07 00:49:26 +09:00
ToruNiina
122b8a2e74 refactor: use literal instead of seq(char,char) 2025-02-07 00:49:04 +09:00
ToruNiina
4fc4d7fd75 fix: escape backslash 2025-02-05 01:31:28 +09:00
ToruNiina
63e4e6fdab refactor: remove push_back from scanners 2025-02-05 00:28:14 +09:00
ToruNiina
7f6913dafe feat: use character literal in character_either
using `std::vector` for this scanner requires many times of memory
allocation and free.
2025-02-04 23:57:12 +09:00
ToruNiina
942eadef5c fix: guard access check funcs by macro 2025-01-30 00:35:36 +09:00
ToruNiina
d2b66ba2e3 feat: unset access flag before returning 2025-01-30 00:26:53 +09:00
ToruNiina
8ec9257f26 feat: enable to unset flag 2025-01-30 00:13:26 +09:00
ToruNiina
074e3507aa feat: consider type check is also access 2025-01-30 00:13:10 +09:00
ToruNiina
bb082bc0bb feat: add accessed() flag 2025-01-29 01:31:15 +09:00
Toru Niina
9d55c4361c Merge pull request #283 from SunPodder/main
feat: add erase methods to ordered_map
2025-01-28 01:32:13 +09:00
Sun Podder
c20968d1dd feat: add erase methods to ordered_map 2025-01-26 14:00:07 +06:00
Ken Matsui
2485f8fe03 Use is_void<T> instead of is_same<T, void>
The original code incorrectly accepts cv-qualified void types for
success.
2025-01-18 22:23:34 -05:00
Ken Matsui
4ceba3a8ce Implement find_or_default 2025-01-18 01:16:54 -05:00
ToruNiina
5396847979 chore: bump version 2025-01-13 19:46:24 +09:00
ToruNiina
f69f7ae9f4 feat: Merge branch 'visit-multi' 2025-01-13 02:05:22 +09:00
ToruNiina
844e8fd4e0 fix(#279): fix compilation with older msvc
by avoiding known SFINAE problem in msvc 2017
2025-01-13 00:47:58 +09:00
ToruNiina
04c55d0b0f feat: toml::visit takes multiple values 2025-01-12 16:08:43 +09:00
ToruNiina
0f6e08fe69 feat: Merge branch 'main' into find-optional 2025-01-05 18:34:52 +09:00
ToruNiina
5bea3508c6 feat: Merge branch 'main' into check-source-location-file-name-result 2025-01-05 15:38:28 +09:00
ToruNiina
7bfbfcab95 feat: add find<optional<T>> 2025-01-05 14:27:09 +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