Zach Laine
745b1b151d
Add a small example to the parser test that shows that you do not need Sprit
...
2's hold[] directve. Fix an error exercised by the example.
2024-01-07 15:11:47 -06:00
Zach Laine
3ebbd9e08c
Correct an error in repeat_parser's choice of attribute. Sometimes it is
...
necessary to use the value_type of the container out-param, rather than the
attribute generated by the subparser.
Fixes #52 .
2024-01-07 12:29:23 -06:00
Zach Laine
9e374f8cc3
Flesh out support for parsing into non-sequence containers.
2024-01-07 00:44:21 -06:00
Zach Laine
6ab2a9b6a4
Fix the parsing of attributes into nested aggregate types.
...
Fixes #50 .
2024-01-07 00:44:21 -06:00
Zach Laine
c7b9eb6eb5
Reimplement get() overloads as one publicly-facing function.
2024-01-06 14:21:07 -06:00
Zach Laine
e6cb3e4159
Add BOOST_PARSER_MAX_AGGREGATE_SIZE, to replace the hardcoded 50 in tuple.hpp.
...
Fixes #51 .
2024-01-06 13:22:58 -06:00
Zach Laine
2e4154dcba
Cruft removal.
2024-01-06 02:36:26 -06:00
Zach Laine
1e373378bd
Assert when an rvalue reference is detected in the char_parser::operator()
...
overlaod that takes a range, to prevent dangling references.
2024-01-06 01:17:32 -06:00
Zach Laine
7a98202845
Address TODO about not using sizeof() to detect char32_t/single-byte input
...
value type.
2024-01-06 01:01:48 -06:00
Zach Laine
f1190f6f59
Grooming.
2024-01-06 01:01:48 -06:00
Zach Laine
2b0053bf83
Add no_case[] directive, and associated changes to char, string, and boolean
...
parsers to make it work; uses the recently-added Unicode case-folding
operation. Needs docs.
Fixes #44 .
2024-01-06 01:01:48 -06:00
Zach Laine
3b5ea8717c
Lower the max number of supported struct elements from 100 to 50 so as not to
...
choke MSVC.
2024-01-04 19:26:47 -06:00
Zach Laine
f34f096c66
Add logic to repeat_parser analogous to the logic in seq_parser, to enable
...
implicit tuple <-> struct conversions.
Fixes #47 .
2024-01-04 18:38:44 -06:00
Zach Laine
e10cc0619c
Refactor detail::move_back() overloads to eliminate code duplication.
2024-01-04 17:58:57 -06:00
Zach Laine
e81035615b
Fix MSVC builds -- std::array::begin() is not necessarily a pointer!
2024-01-04 08:53:06 -06:00
Zach Laine
c37274c9a5
Fix broken build.
2024-01-04 02:40:33 -06:00
Zach Laine
d0fe18b61d
Add single-code point Unicode case folding function; data and tests are
...
generated from CaseFolding.txt.
Partially addressed #44 .
2024-01-04 02:26:36 -06:00
Zach Laine
fcd3a9fc7d
Gross hack to fix GCC < 12 builds.
...
Fixes #28 .
2024-01-03 23:44:51 -06:00
Zach Laine
d60d33e40b
Finish implementing support for parsing into structs as if they were tuples.
...
This makes it possible to map from sequence parsers onto structs with no
semantic actions. Also, add a doc section describing how parsing structs
works (including a couple of short example programs).
Fixes #45 .
Partially addresses #28 .
2024-01-03 23:24:37 -06:00
Zach Laine
8bad1f2963
detail::aggregate_to_tuple() -> detail::tie_aggregate(), and change
...
detail::tie_aggregate() to return a tuple of references.
Partially addresses #28 .
2024-01-03 02:28:10 -06:00
Zach Laine
0e78ea2d26
Remove the T >> T -> std::vector<T> attribute combining rule from seq_parser.
2024-01-03 02:04:04 -06:00
Zach Laine
0454d4dad0
Fix MSVC build.
2024-01-03 00:55:42 -06:00
Zach Laine
f08255cf94
Use a tuple instead of a pair in seq_parser::{make_temp_result,combine}. Add a
...
third tuple to the output of make_temp_result; this tuple is true/false values
indicating whether this parser's attribute was merged with an adjacent
parser's container of attributes of the same type.
Fixes #36 .
2024-01-02 17:58:03 -06:00
Zach Laine
e7daff5b26
Use std::move consistently when assigning/appending values.
2024-01-02 17:58:03 -06:00
Zach Laine
2020e44fda
Radically change the way that repeat_parser generates a sequence of
...
attributes. It now produces std::string when Attribute is char, and
std::vector<Attribute> otherwise (except for nope special-casing of course).
Partial fix for #36 .
2024-01-02 17:57:46 -06:00
Zach Laine
d34d4b7e6a
Remove the seq_parser C<T> >> C<T> -> C<T> collapsing rule. Add special logic
...
for recursive rules to make accumulating recursive parsers like
recursive_string_rule in the parser_rule test easier to write.
2024-01-01 15:29:45 -06:00
Zach Laine
dced620290
Remove mooted TODO.
2024-01-01 15:29:45 -06:00
Zach Laine
b02e9e32a6
Add preprocessor code from Boost.Describe instead of conditionally using
...
Boost.Preprocessor. Thanks, Peter!
Fixes #32 .
2023-12-30 17:00:23 -06:00
sehe
b7d1d3dba5
Fix spelling of hexadecimal
...
The library and documentation misspells it (consistently, which is good
:)) as hexidecimal. That makes it hard for (new) users to find out by
searching documentation.
The fifteen spots fixed:
example/callback_json.cpp|47 col 15| "four hexidecimal digits";
example/callback_json.cpp|49 col 18| "\\uXXXX hexidecimal escape sequence";
example/callback_json.cpp|51 col 38| escape_double_seq = "\\uXXXX hexidecimal escape sequence";
example/json.cpp|57 col 28| // like "expected four hexidecimal digits here:", instead of "expected
example/json.cpp|65 col 15| "four hexidecimal digits";
example/json.cpp|67 col 18| "\\uXXXX hexidecimal escape sequence";
example/json.cpp|69 col 38| escape_double_seq = "\\uXXXX hexidecimal escape sequence";
example/json.cpp|158 col 18| // declare a hexidecimal parser that matches exactly 4.
doc/tutorial.qbk|981 col 18| [ Matches a hexidecimal unsigned integral value. ]
doc/tutorial.qbk|986 col 28| [ Matches exactly the hexidecimal unsigned integral value `_RES_np_(arg0)`. ]
doc/tutorial.qbk|1118 col 42| So, if you wanted to parse exactly eight hexidecimal digits in a row in order
doc/tutorial.qbk|2729 col 18| "\\uXXXX hexidecimal escape sequence";
doc/tutorial.qbk|2731 col 38| escape_double_seq = "\\uXXXX hexidecimal escape sequence";
doc/tutorial.qbk|2741 col 9| put a hexidecimal escape sequence there.
include/boost/parser/parser.hpp|5622 col 13| /** The hexidecimal unsigned integer parser. Produces an `unsigned int`
The one spot that was inconsistent (outside the gtest subtree):
include/boost/parser/tuple.hpp|66 col 36| // 0xDEADBEEF (hexadecimal)
2023-12-30 15:13:04 -06:00
Zach Laine
fcb435df99
Add test for the struct <-> tuple assignment machinery; fix errors.
...
Partially addresses #28 .
2023-12-30 04:12:05 -06:00
Zach Laine
95374a7878
Add initial sketch of struct -> tuple assignment machinery.
...
Partially addresses #28 .
2023-12-30 02:58:50 -06:00
Zach Laine
669af7fa69
Add initial sketch of tuple -> struct assignment machinery.
...
Partially addresses #28 .
2023-12-30 01:40:43 -06:00
Zach Laine
7afc5e5ac3
Remove needless inclusion of <coroutine>.
...
Fixes #37 .
2023-12-29 19:55:25 -06:00
Zach Laine
2030e41bc5
Doc typo.
...
Fixes #31 .
2023-12-29 14:50:57 -06:00
Zach Laine
868b5854c0
MSVC warning mitigation.
...
Fixes #29 .
2023-12-29 14:00:27 -06:00
Zach Laine
b218bd78d7
Print diagnostics to cerr by default instead of cout.
...
Fixes #30 .
2023-12-29 13:27:52 -06:00
Zach Laine
88a965d9c5
Rename the {callback_,}parse() overloads that take an iterator/sentinel pair
...
to {callback,}prefix_parse().
Fixes #21 .
2023-12-23 04:05:54 -06:00
Zach Laine
fe23476eed
Get rid of phony Doxygen-only as_utf*, since they were not showing up in the
...
generated docs anyway, and let Doxygen see the real as_utf*s and utf*_views
instead.
2023-12-23 03:01:08 -06:00
Zach Laine
30d02167e1
Add an alias for boost::parser::detail::text::null_sentinel_t to
...
boost::parser, and add a Doxygen comment to document it.
2023-12-23 02:58:29 -06:00
Zach Laine
21cb1a2184
Half open ranges -> closed ranges in Doxygen comments in parser.hpp.
2023-12-23 02:57:19 -06:00
Zach Laine
88a7b39dc2
Fix MSVC 2022 in C++20 mode.
2023-12-21 23:29:59 -06:00
Zach Laine
9c0e07812f
Fix the VS2022 build.
2023-12-17 14:15:17 -06:00
Zach Laine
1bbad0a871
Address TODOs about the need to document an unexpected aspect of how out-param
...
attributes are assigned.
2023-12-16 16:37:06 -06:00
Zach Laine
449a964b23
Publicize the as_utfN and utfN_view templates/aliases in boost::parser, so
...
users can use them to drive Unicode-aware parsing.
Fixes #23 .
2023-12-15 22:35:28 -06:00
Zach Laine
14054ed1bf
Consolidate the two implementations of is_detected into one.
...
Fixes #25 .
2023-12-15 21:54:51 -06:00
Zach Laine
efaa7c8c08
Replace the half-assed subrange implementation in boost::parser with the more
...
robust one from boost::text.
Fixes #26 .
2023-12-15 21:23:31 -06:00
Zach Laine
869df54e36
Add the latest version of Boost.Text components used here. This comes from
...
2c9d55a8 of the Boost.Tet clang_support branch.
Fixes #24 .
2023-12-15 21:00:09 -06:00
Zach Laine
fbcc28a810
Doc tweak.
2023-12-03 16:58:08 -06:00
Zach Laine
ef3c90b552
view -> subrange
...
Fixes #20 .
2023-12-03 16:54:44 -06:00
Zach Laine
a33883d59b
symbols::add -> symbols::insert_for_next_parse
...
Fixes #19 .
2023-12-03 16:33:42 -06:00