2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-19 16:32:13 +00:00
Commit Graph

272 Commits

Author SHA1 Message Date
Zach Laine
471269a374 Define BOOST_PARSER_SUBRANGE, and use it consistently. subrange.hpp is now
only included in C++17 builds.

Fixes #69.
2024-01-17 00:02:28 -06:00
Zach Laine
2054eab1bd Disable string_view[] code in parser.cpp in pre-C++20 builds. 2024-01-15 00:51:00 -06:00
Zach Laine
9187bf851e Add section on raw[] and string_view[] to docs.
Fixes #59.
2024-01-14 20:57:43 -06:00
Zach Laine
7103755e59 Comment out test code that exercises spooky behavior on MSVC. 2024-01-15 02:55:30 -06:00
Zach Laine
b055b21f1f Address TODO about string_view_parser needing tests. 2024-01-14 17:41:38 -06:00
Zach Laine
bf06cfc57a Fix string_view_parser, broken by the most recent boost::text import. 2024-01-14 16:47:50 -06:00
Zach Laine
d17268dec7 Add section about merge[] and separate[] to the docs.
Partially addresses #55.
2024-01-14 02:45:05 -06:00
Zach Laine
251dcc9436 Implement the merge[] and separate[] directives that control attribute
generation.  Needs docs.

Fixes #55.
2024-01-13 20:57:01 -06:00
Zach Laine
e6a9763b86 Cruft removal. 2024-01-13 14:15:49 -06:00
Zach Laine
cf9545fa7c Remove mooted TODOs. 2024-01-12 22:35:04 -06:00
Zach Laine
3e7812ebe5 Simplify detail::is_variant and remove enable_variant. Turns out
detail::is_variant_v is not actually used, except in one place in the printing
code, and it's not even essential there.
2024-01-12 21:45:39 -06:00
Zach Laine
69e4f47bff Work around the busted-ass static_asserting op<< in boost::optional by
recognizing all enabled optionals, and printing them the same as we do
std::optional.  Applied the same logic to variants too, for consistency.
2024-01-12 21:45:39 -06:00
Zach Laine
03c7cc6bbb Fix broken enable_variant decls in tuple_aggregate test. 2024-01-12 21:45:39 -06:00
Zach Laine
c2dd86cc68 Remove generated parser tests (cruft). 2024-01-11 23:18:17 -06:00
Zach Laine
c8ce2cace5 Add a special seq_parser combining rule that makes a std::string ot of two
adjacent char/char32_t values.

Partially addresses #55.
2024-01-11 19:24:43 -06:00
Zach Laine
b6ffe5fbe3 Change detail::sequence_of and detail::container_and_value_type so that they
generate std::strings from repeated char32_ts and combine char32_ts with
adjacent strings.  Update docs accordingly.

Partially addresses #55.
2024-01-10 22:17:53 -06:00
Zach Laine
a8dc1f4cb8 Flesh out the More About Rules page.
Fixes #39.
2024-01-09 23:06:18 -06:00
Zach Laine
7b0327f167 Guard the operator<< defined in tuple_aggregate with TEST_BOOST_OPTIONAL. 2024-01-07 21:14:54 -06:00
Zach Laine
cd284572c9 Add support for parsing into attributes whose types are optionals or variants
other than the ones from std:: (e.g. boost::optional, boost::variant, and
boost::variant2::variant).

Fixes #53.
2024-01-07 20:44:34 -06:00
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
8caf4bea09 Cruft removal. 2024-01-07 15:10:11 -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
6f06bc4189 Add no_case[] docs. 2024-01-06 02:36:26 -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
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
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
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
7921f15ef8 Cruft removal. 2024-01-03 16:55:13 -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
7883b8ed1e Update docs to reflect the new detail::sequence_of<T> semantics (std::string
for sequence of char, std::vector<T> for everything else).  Also, update one
of the examples to match the associated test code.

Partially addresses #36.
2024-01-03 01:37:07 -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
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
24d18b4eaf Remove the documentation section "An Odd Case", which was obviated by the
previous commit.  Also remove the test cases that exercised that case.
2024-01-01 15:30:45 -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
f8fb63766e Fix aggr_tuple_assignment test for MSVC. 2023-12-30 15:24: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
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
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
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
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
Zach Laine
8f560956c4 Change the assumption in parser.hpp that a code point is a uint32_t; use
char32_t instead.

Fixes #18.
Fixes #22.
2023-12-03 16:10:25 -06:00
Zach Laine
72e5573505 Replace use of is_integral with parsable_code_unit, which is all the character
types.  Also slightly simplify the logic for parsable_code_unit.

Fixes #22.
2023-12-03 15:20:40 -06:00
Zach Laine
876056aa28 uint32_t -> char32_t in transcode_iterator. 2023-12-03 14:19:08 -06:00
Zach Laine
362542d688 Remove the char8_t-specific public concepts, and simplify code that was
previously the downstream use of those public concepts.
2023-12-03 13:40:50 -06:00