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

56 Commits

Author SHA1 Message Date
Zach Laine
23017af526 Remove support for direct use of null-terminated strings with the parser APIs.
Fixes #175.
Fixes #190.
2024-10-02 20:28:50 -05:00
Zach Laine
8e39ad067b Change tests from GTest to Boost.Test. Remove Goolge.{Test,Benchmark}.
Fixes #165.
2024-03-24 22:29:10 -05:00
Zach Laine
abbab9017f Address gaps in code coverage; fix a couple of small errors in the trace code. 2024-03-23 23:40:08 -05:00
Zach Laine
e129193296 Now that the library requires C++17, use std::any instead of any_copyable. 2024-03-08 21:19:37 -06:00
Zach Laine
64e76e7b58 GCC warning mitigation. 2024-03-08 21:19:36 -06:00
Zach Laine
27506af2f3 Constrain parse() overloads that take an out-attribute Attr & -- but no
skipper -- so that Attr is not derived from a specialization of
parser_interface.  This prevents this from being the best overload when using
a mutable skipper, and producing lots of diagnostics that say the skipper
(which would be mistakenly bound to Attr &) is not assignable from whatever
the attribute type is.

Fixes #105.
2024-03-08 21:19:36 -06:00
Zach Laine
4b59719e44 Add Unicode versions of most of the ascii namespace parsers; remove the ascii
namespace.
2024-01-29 23:36:03 -06:00
Zach Laine
ab4d708c30 Set the out-param to Attr() on parse failure (for the overloads taking an
out-param), making alls to parse() consistent with calls to parsers. Parsers
clear the attribute on failure. Add a section to rationale on why this is the
right choice.

Fixes #78.
2024-01-28 01:17:17 -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
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
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
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
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
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
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
Zach Laine
ffe3c522b5 Change the concepts for utf{8,32}_code_unit to be char/char8_t and
wchar_t/char32_t, respectively.  Obvs, the wchar_t bit only applies to
non-MSVC.
2023-12-02 14:19:57 -06:00
Zach Laine
e9893e7979 C++17 Clang warning mitigation. 2023-11-25 17:25:18 -06:00
Zach Laine
2de63708cc Update Boost.Text to 1ff99f926f. 2022-08-21 18:32:05 -05:00
Zach Laine
c437e98985 Fix int literal/long long literal confusion in parser_api.cpp tst. 2022-04-10 22:12:04 -05:00
Zach Laine
25b99b53cd Change the CMake build mode when BUILD_WITHOUT_BOOST is defined not to find
nor include Boost at all.  Fix several problems that this brought out.
2020-09-20 17:32:23 -05:00
Zach Laine
895224b214 Convert from Boost.Hana to Hana lite, part 5: Make some small adjustments to
the tests to get them building when Hana is not used; disable building the
examples when Boost.Hana is not in use, so that they can keep using the much
nicer hana::tuple::operator[] instead of parser::get().

This completes the changes to make Hana optional.
2020-09-20 17:05:57 -05:00
Zach Laine
71c697d23d Convert from Boost.Hana to Hana lite, part 2: introduce a template aliases for
constants like llong; provide a tuple accessor get(); use these throughout the
code.

Also, adapt the code in detail/hl.hpp to work with hana::tuple and std::tuple.
2020-09-20 16:05:52 -05:00
Zach Laine
c1205a419d Convert from Boost.Hana to Hana lite, part 1: introduce a template alias for
tuple, and use it throughout the code.
2020-09-20 14:07:49 -05:00
Zach Laine
969de5c23d Move all the text and stl_interface internal header code into
boost::parser::detail namespace.
2020-09-20 03:23:23 -05:00
Zach Laine
5bed6f9776 Make dependency on Boost.Preprocessor optional. 2020-09-19 21:37:45 -05:00
Zach Laine
113270d6f6 Remove dependency on Boost.Any. 2020-09-19 20:43:12 -05:00
Zach Laine
1ed37641e9 Remove dependency on the Spirit headers, via extensive copy/pasta. 2020-09-19 19:55:52 -05:00
Zach Laine
b88e33cc88 Fix narrowing conversion error. 2020-09-10 00:15:42 -05:00
Zach Laine
d8a323a5fb Fix VC2019 test failures. 2020-09-09 23:42:04 -05:00
Zach Laine
3ac30663b4 Add support for C++17. 2020-09-09 02:45:19 -05:00
Zach Laine
32ebd38270 Exercise the sentinel code path for every parser; fix errors.
Fixes #3.
2020-09-09 02:45:17 -05:00
Zach Laine
19d441743a Fix the constraints on {callback_,}parse() when called with a pointer to a
null-terminated string.
2020-09-09 02:45:15 -05:00
Zach Laine
322bb32b2b Warning mitigation. 2020-09-06 14:44:49 -05:00
Zach Laine
673fa56bc6 Remove hana::map as the implementation strategy for the parse context. Use a
plain ol' struct instead.

Fixes #13.
2020-09-06 01:54:17 -05:00
Zach Laine
f616d38642 Drop support for hna::map as a calblacks parameter to parse(), and change the
passing of tags to callbacks from hana::type<tag> to just tag.

Fixes #5.
2020-09-05 17:09:13 -05:00
Zach Laine
c8a0bab822 First draft of "The parse() API" section. 2020-09-03 00:56:59 -05:00
Zach Laine
852559ce67 static_assert inside the prase() overloads that take an attr out-param that
the parser generates an attribute.

Fixes #2.
2020-09-01 01:24:12 -05:00
Zach Laine
12c4f61a6b Add ill_formed.hpp. 2020-09-01 01:10:28 -05:00
Zach Laine
bf6c5c605f Add a test of code-point matching when using UTF-8. 2020-08-30 00:31:30 -05:00