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

330 Commits

Author SHA1 Message Date
Zach Laine
06fb60c78f Add an intial sketch of a memoization system. 2024-03-17 20:09:39 -05:00
Zach Laine
24288a03a2 Add quoted_string, to automate probably the most commonly-written parser of
all time -- the quoted string.
2024-03-11 02:38:26 -05:00
Zach Laine
824a208133 Add a permutation parser.
Fixes #159.
2024-03-10 17:31:50 -05:00
Zach Laine
48d5cceb8f Add more tests of seq_parser and or_parser, to cover all the permutations of
different parsers that they might use.

Fixes #126.
2024-03-10 16:48:41 -05:00
Zach Laine
87b50154cf Fix incorrect attribute returned by a rule in some cases. The problem was
that the changes to support recursive rules made all rules use the out-arg
overload of parse_rule.  This is wrong.  Now, rules use the
attribute-returning overload unless asked explicitly to use the out-arg one,
*or* if the rule is being invoked recursively, and we are in an iteration
after the 0th.

Fixes #125.
2024-03-08 21:19:37 -06:00
Zach Laine
1e011a1fac Add transform(f)[p] attribute-transforming directive.
Fixes #153.
2024-03-08 21:19:37 -06:00
Zach Laine
cc9b74cb2d Add no_case support to symbol tabels.
Fixes #149.
2024-03-08 21:19:37 -06: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
9f46597ea9 Add --output-on-failure to make check. 2024-03-08 21:19:37 -06:00
Zach Laine
aea0ff8dab Removed the very small example of how to use rules with a much longer one
based on a real section of YAML.

Fixes #104.
2024-03-08 21:19:36 -06:00
Zach Laine
02c140a251 MSVC warning mitigation.
Fixes #120.
Fixes #121.
Fixes #122.
Fixes #123.
2024-03-08 21:19:36 -06:00
Zach Laine
64e76e7b58 GCC warning mitigation. 2024-03-08 21:19:36 -06:00
Zach Laine
9b47f3c551 Work around what looks like a Clang concept bug, in which two identical
declarations are parsed to be non-identical.

Fixes #130.
2024-03-08 21:19:36 -06:00
Zach Laine
9ebc984ff8 Add a type trait, "attribute", and associated alias attribute_t, that provide
the attribute type for a parser Parser used to parse range R.

Fixes #111.
2024-03-08 21:19:36 -06:00
Zach Laine
125ddf43c2 Change the way action_parser calls invocables, to make it easier to write
those invocables.

Fixes #106.
2024-03-08 21:19:36 -06:00
Zach Laine
a2b7afc3a0 Grooming. 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
27400587d5 Add Phil Endecott's example latlong parser from the Boost mailing list review
as a test.
2024-03-08 21:19:29 -06:00
Zach Laine
7a9126432a Fix an error in or_parser, which was clearing out-arg attributes when an
alternative failed.
2024-03-08 21:19:29 -06:00
Zach Laine
ca1ad064ff Use a more compelling example in the example code for replace().
Fixes #96.
2024-03-01 22:25:47 -06:00
Zach Laine
f99ae3b94a Use bp::get() instead of Hana literals in example, so as not to break non-Hana
builds.
2024-02-11 16:54:44 -06:00
Zach Laine
b6b77bac3c Explain more fully in More about Rules that you need to write a semantic
action sometimes for a rule, and under what cirumstances you do.

Fixes #93.
2024-02-11 16:46:47 -06:00
Zach Laine
e6b59a4784 Fix GCC 12 C++20 build. 2024-02-11 00:24:39 -06:00
Zach Laine
2f8270809c Disable transform_replace* for GCC < 12 in C++20 mode. 2024-02-11 00:24:39 -06:00
Zach Laine
cdb86d8c23 Add special-case logic for detail::range_utf_format() to recognize that
utf8_view is UTF-8-encoded in non-concpets mode.
2024-02-10 23:25:54 -06:00
Zach Laine
d0208fb12c Add transform_replace range adaptor and transform_replace_view. 2024-02-10 18:42:18 -06:00
Zach Laine
129a0ec531 Add a test to parser.cpp that covers #90. This just verifies that #90 is not
an issue.

Fixes #90.
2024-02-04 16:52:40 -06:00
Zach Laine
bb3f66db5f Document The incompatibility of tuple->aggregate conversions with assignment
to variants.

Fixes #91.
2024-02-04 16:16:47 -06:00
Zach Laine
c990799c51 Add spacing to some tests to make sure that raw[] functions correctly with a
skipper.
2024-02-01 22:55:42 -06:00
Zach Laine
7f287c5525 Fix error in no_case[] evaluation. 2024-02-01 20:38:41 -06:00
Zach Laine
d0cf708ef5 Address TODO about needed fix in compile_seq_attribute test. 2024-01-31 20:52:16 -06:00
Zach Laine
ec5fc2ed85 Turn detail::char_{set,subranges} into structs to fix MSVC build. 2024-01-30 23:31:01 -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
495a3fffbf Add another case similar to the failing case in compile_seq_attribute.cpp. 2024-01-28 21:24:53 -06:00
Zach Laine
3d528fa531 Remove mooted TODOs. 2024-01-28 21:23:06 -06:00
Zach Laine
68c33a0181 Address TODO about non-obviously ill-formed code using merge[]. 2024-01-28 20:54:28 -06:00
Zach Laine
b58b3a0779 Address TODO about documenting the unavailability of replace{,_view} on MSVC
in C++17 mode.
2024-01-28 20:54:24 -06:00
Zach Laine
5b7889df61 Address a TODO about documenting part of the loose attribute match behavior. 2024-01-28 20:54:22 -06:00
Zach Laine
f7d26dabae Remove moot TODO. 2024-01-28 20:54:18 -06:00
Zach Laine
4d14fba7fd Change concept can_utf_view to use the form MSVC uses in its std lib, and turn
off code relying on alias CTAD on MSVC.  Add test cases for {w,}string{,_view}
| as_utfN in C++20 builds.
2024-01-28 15:34:51 -06:00
Zach Laine
9d1a6aeeb3 Extend all_t test to test arrays; fix errors. 2024-01-28 14:03:02 -06:00
Zach Laine
33edb6c4e8 Add all_t, and use it in non-concepts builds.
Fixes #85.
2024-01-28 02:07:07 -06:00
Zach Laine
de74eecabe Fix broken macro guard on replace join_compat test. 2024-01-28 02:01:47 -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
e7efe90a03 In detail::assign, static_assert that the assignment is not arithmetic-type ->
std::string.

Fixes #76.
2024-01-28 01:17:06 -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
319b39a67b Fix MSVC build. 2024-01-23 02:44:30 -06:00
Zach Laine
edebfc3f57 Fix tests in C++20 mode on older GCCs. 2024-01-22 19:39:55 -06:00
Zach Laine
385a6a4ca6 Fix C++20 builds on older GCCs. 2024-01-22 19:28:48 -06:00
Zach Laine
a68d4f61b2 Add replace_view and range adaptor replace. 2024-01-22 01:11:17 -06:00