2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-27 07:02:12 +00:00
Commit Graph

362 Commits

Author SHA1 Message Date
Zach Laine
fc6a643a99 Add a real no-format enumerator to text::format. 2024-01-27 20:35:56 -06:00
Zach Laine
c328a18121 Add a Doxygen comment description for replace_view. 2024-01-22 21:51:23 -06:00
Zach Laine
3549ad64a8 Disable replace/replace_view entirely in MSVC C++17 builds. 2024-01-23 03:36:38 -06:00
Zach Laine
275874f3c6 Fix misplaced #endif. 2024-01-23 03:08:34 -06:00
Zach Laine
4ce4d8ba0e Fix typo in stl_interfaces::adaptor (f/f_ confusion). 2024-01-22 01:35:26 -06:00
Zach Laine
a68d4f61b2 Add replace_view and range adaptor replace. 2024-01-22 01:11:17 -06:00
Zach Laine
d1309560df Add detail::maybe_const, and use it properly in search_all_view and
split_view.
2024-01-21 15:40:51 -06:00
Zach Laine
bbb1cba804 Fix the broken support for operating on C-style strings in search{(),_all} and
split.
2024-01-21 15:31:31 -06:00
Zach Laine
a6db478691 Add is_range_like trait to stand in for the new concept in C++17 code. 2024-01-21 15:31:31 -06:00
Zach Laine
9bd38a51f6 Concept parsable_code_unit -> code_unit; add range_like concept. 2024-01-21 15:31:31 -06:00
Zach Laine
8df56b083d Bring in fix for dangling temporaries from Boost.STLInterfaces. 2024-01-21 15:31:31 -06:00
Zach Laine
1aa95127f0 Only enable the previous fix in post-C++17 builds. Sigh. 2024-01-20 03:36:44 -06:00
Zach Laine
eb68bacfbb Fix improperly macro-disabled enable_borrowed_range specializations, to fix
MSVC builds.
2024-01-20 09:28:44 -06:00
Zach Laine
5adef16a4d Add split_view + split range adaptor. split produces a range of subranges,
each of which is a nonoveralpping match of the given parser.

Fixes #64.
2024-01-19 21:19:53 -06:00
Zach Laine
aa76e9f85e Add search() algorithm, and search_all_view + search_all range adaptor.
search() finds the first occurrence of a match of the given parser.
search_all produces a range of subranges, each of which is a nonoveralpping
match of the given parser.

Partially addresses #64.
2024-01-19 21:19:53 -06:00
Zach Laine
591ac9921b Remove BOOST_PARSER_DEFINE_RULE now that BOOST_PARSER_DEFINE_RULES is always
available.

Partially addresses #71.
2024-01-19 21:06:33 -06:00
Zach Laine
ce7804a003 Refer to the text asociated with a rule as diagnostic text rather than a name,
in the code and the docs.

Fixes #72.
2024-01-19 20:54:58 -06:00
Zach Laine
62002e886a Add support for parsing into an arbitrary class type T, as long as the default
attribute we're parsing is a tuple whose elements can be used to construct T.
Needs docs.

Fixes #49.
2024-01-19 01:00:39 -06:00
Zach Laine
ee00c0393a Put the default behaviors at the first of the constexpr if chains in
detail::{assign,move_back}().
2024-01-19 01:00:39 -06:00
Zach Laine
a7384b82ad Fix non-advancing iterator error in seq_parser, ue to first/first_ name
confusion(!).
2024-01-19 01:00:38 -06:00
Zach Laine
355d443650 Fix logic in trace_input_impl<Iter, Sentinel, 1> specialization, to account
for the case that Iter is utf_iterator<utf8, utf8, ...>.
2024-01-17 01:10:33 -06:00
Zach Laine
0d6f164964 std::is_array_v -> text::detail::is_bounded_array_v in
detail::make_input_subrange().
2024-01-17 00:07:36 -06:00
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
613bf0583a Cruft removal. 2024-01-16 23:39:04 -06:00
Zach Laine
1fd49842f0 In lexeme_parser, skip_parser, and expect_parser, don't adjust flags in the
overload of call() that just forwards to the other overload; let that other
overload do it.
2024-01-16 23:17:10 -06:00
Zach Laine
4b2c9bcf14 Fix the unconditional generation of attributes by raw_parser and
string_view_parser.  They now do so only when the enclosing context has
attribute generation enabled, and when their subparser succeeds.
2024-01-16 23:15:02 -06:00
Zach Laine
cced72dbcd std::{begin,end} -> detail::text::detail::{begin,end} 2024-01-15 23:09:00 -06:00
Zach Laine
92c16cbfae Add section about writing your own parsers.
Fixes #58.
2024-01-15 16:19:39 -06:00
Zach Laine
53e0f7c769 Fix misplaced #endif that broke most of our builds. 2024-01-14 20:15:31 -06:00
Zach Laine
d17db09303 Use the warning-provocation technique from boost/mpl/print.hpp to cause the
types to be printed in some places after a static_assert failure.

Partially addresses #56.
2024-01-14 18:32:35 -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
a956cd962e Comments on static_asserts to text in the static_asserts instead. 2024-01-14 16:43:58 -06:00
Zach Laine
92be502e79 Copy editing. 2024-01-14 16:18:19 -06:00
Zach Laine
02447e92a2 Remove template head from lambda, and just use auto param instead, to mollify
MSVC.
2024-01-14 04:54:32 -06:00
Zach Laine
93d3708010 Disable optional check on older GCCs. 2024-01-13 21:30:35 -06:00
Zach Laine
16cd1894e2 Work around GCC12 bug involving the use of declval. 2024-01-13 21:26:49 -06:00
Zach Laine
6a2a1229a4 GCC9 warning mitigation. 2024-01-13 21:16:24 -06:00
Zach Laine
1566dffe1f Fix GCC and Clang builds. 2024-01-13 21:11:43 -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
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
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
257dcd36aa Add a static_assert in seq_parser that indicates the most likely source of
compilation failure there -- attribute incompatibility.

Partially addresses #56.
2024-01-08 18:31: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
4becbe34ad Fix infinite loop when handling an optional of sequence attribute type in
repeat_parser.
2024-01-07 19:46:43 -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
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