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

925 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
262c19e441 Explain how seq_parser combining logic interacts with directives.
Fixes #161.
2024-03-09 20:54:10 -06:00
Zach Laine
f113d302de !success || !detail::gen_attrs(flags) -> !success in condition to reset
attribute in repeat_parser.  Looks like copy pasta.
2024-03-09 17:41:03 -06:00
Zach Laine
6d253beaac Cruft removal. 2024-03-09 17:41:03 -06:00
Zach Laine
2fa916530e Add missing optional<Container> overloads of detail::append. 2024-03-09 17:41:03 -06:00
Zach Laine
3ff6a575ad Add a TODO. 2024-03-08 21:19:37 -06:00
Zach Laine
a19af1b5ce Expanded the text and examples, plus provided cross-references to more
extended examples, in The Parse Context.

Fixes #145.
2024-03-08 21:19:37 -06:00
Zach Laine
4c0377a5ae Explicitly state that null-terminated string pointers are accepted by
*parse(), in the list of properties common to all the overloads.
2024-03-08 21:19:37 -06:00
Zach Laine
f55d3779de Define BOOST_PARSER_USE_CONCEPTS to be 1 when running Doxygen. This gets
concepts constraints on template parameters to show up.  Also explicitly state
requirements in the Doxygen strings for anything that adds constraints via
requires clauses, since those do not show up in Doxygen.

Fixes #109.
2024-03-08 21:19:37 -06: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
456a81155a When there are alternate implementations controlled by __has_include, put each
alternate implementation in its own inline namespace.

Fixes #151.
2024-03-08 21:19:37 -06:00
Zach Laine
947fd7782d Explicitly state that char_, cp, and cu can be used without args in their API
docs.

Fixes #150.
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
a07efbbd72 Add note to Memory Allocations that the symbol tables are implemented using a
trie, and that those have lots of allocated nodes.
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
5dc826c89d Explicitly state in the Semantic Actions page of the tutorial that attaching a
semantic action nullifies the attribute type.

Fixes #148.
2024-03-08 21:19:37 -06:00
Zach Laine
374cad3c35 Get specific about what RESOLVE() means, and link usage of it to the place
where it is defined.

Fixes #144.
2024-03-08 21:19:37 -06:00
Zach Laine
4a9a45f856 Warning mitigation. 2024-03-08 21:19:37 -06:00
Zach Laine
b7f6cd8dbf Add a section about when to use auto-generated attributes vs. using semantic
actions.

Fixes #110.
2024-03-08 21:19:36 -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
9af9b5e373 Use parser::get() instead of operator[] in the implementation of
param_t::operator().
2024-03-08 21:19:36 -06:00
Zach Laine
f05b25ea1d Use detail::print() to print the values in switch alternatives, instead of
printing them directly.
2024-03-08 21:19:36 -06:00
Zach Laine
f57de243a4 Put #ifndef BOOST_PARSER_DOXYGEN around all the structs in parser.hpp that
were forwrard declared in parser_fwd.hpp.  This was causing them to show up
without any documentation string, or default tempalte parameters!
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
0e2936e20d Fix broken constraint on 2-param utf_iterator ctor in C++17 mode. 2024-03-08 21:19:36 -06:00
Zach Laine
4235706764 Move DoCallbacks NTTP for all the parsers' call() members to the context as a
simplification.
2024-03-08 21:19:36 -06:00
Zach Laine
0056bd25d1 Add a DoTrace template parameter to the context, and to scoped_trace_t;
specialize scoped_trace_t for DoTrace == false to be empty.

This is an attempt to address #152.
2024-03-08 21:19:36 -06:00
Zach Laine
64e76e7b58 GCC warning mitigation. 2024-03-08 21:19:36 -06:00
Zach Laine
ed9fcc6f3a Don't construct or use a stringstream in every parser when tracing is
disabled(!).
2024-03-08 21:19:36 -06:00
Zach Laine
0a945decb6 Add a small section to the end of the Unidoce Support page indicating that
Parser is normalization-agnostic.
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
51d9b81927 Add USE_CONCEPTS guard around unguarded concept.
Fixes #129.
2024-03-08 21:19:36 -06:00
Zach Laine
3e047101f6 Doc copy editing.
Fixes #135.
Fixes #136.
Fixes #137.
Fixes #138.
Fixes #139.
Fixes #142.
2024-03-08 21:19:36 -06:00
Zach Laine
7ae0f9f817 Add missing #include <algorithm> to error_handling.hpp. 2024-03-08 21:19:36 -06:00
Zach Laine
40b495ae5d Add a note about which header includes the as_utfN adaptors to "Explicit
transcoding".

Fixes #119.
2024-03-08 21:19:36 -06:00
Zach Laine
e3c46c10c2 Use std::from_chars, if available; otherwise, use boost::charconv::from_chars,
if available; otherwise, use the Spirit X3 number parsers.

Fixes #113.
2024-03-08 21:19:36 -06:00
Zach Laine
42f66d9079 Use some of the examples and wording from the part of the intro where I talk
about X3 rules in the More About Rules section.

Fixes #117.
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
ed6e1b4a2c Create a Cheat Sheet page in the docs, right before the tutorial. This
contains all the tables from elsewhere in the docs, gathered in one spot.

Fixes #108.
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
112290f63e Cruft removal. 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
db79d00848 Remove the empty concepts.hpp file from the doc build, due to the way that
Doxygen+Quickbook seems not to handle concepts.

Fixes #102.
2024-03-08 21:19:36 -06:00
Zach Laine
eda6238180 Be more explicit in the reference nad tutorial descriptions of
BOOST_PARSER_DEFINE_RULES about what exactly it does and how to use it.

Fixes #101.
2024-03-08 21:19:36 -06:00