2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-26 06:42:25 +00:00
Commit Graph

489 Commits

Author SHA1 Message Date
Zach Laine
647cec6683 Address similar concern to the one about closures with move-only callables,
but this time for adaptors.
2025-10-31 17:30:34 -05:00
Zach Laine
c2ddd6e116 Fix ill-formedness when using range_adaptor_closure with GCC14. 2025-10-31 17:22:36 -05:00
Andreas Buhr
f7246de9db Do not call skip parser if we are already in failed state in seq_parser 2025-10-31 15:41:26 -05:00
Andreas Buhr
703a8afafe Fix error in drone CI
error: call to implicitly-deleted copy constructor of [snip]
constexpr closure(F f) : f_(f) {}
2025-10-31 15:39:46 -05:00
Zach Laine
0eacce6080 Add special-casing of nope attributes in seq_parser, so that seq_parser does
not assign over valid values in a sequence's attribute after successfully
parsing a subsquent nope-attributes parser.

Test cases by Andreas Buhr.

Fixes #279
Fixes #285
2025-10-31 15:36:22 -05:00
Zach Laine
dc6144eeb4 Correct tuple/struct confusion in the logic of the if constexpr chain in
perm_parser.

Test case by Andreas Buhr.

Fixes #268.
2025-10-31 12:37:40 -05:00
Zach Laine
d873d7ea80 Provide failover empty symbol table tries for use inside of skippers, since
nothing prevents using a symbol_parser in a skipper, and the previous commit
introduced nullptr skipper data tables in some cases.

Related to #245
2025-10-13 18:43:08 -05:00
Zach Laine
1f5303c756 When creating the context object in detail::skip(), don't create empty structs
for symbol table tries, since they are never used.

Fixes #245
2025-10-13 18:19:04 -05:00
Zach Laine
41e891dc95 In opt_parser, don't forget to clear the attribute if the subparser fails.
Fixes #279
2025-10-13 17:46:27 -05:00
Zach Laine
159472ac6e Change moves to forwards where appropriate.
Addresses the same issues as PR #276.
2025-10-12 21:45:46 -05:00
Andreas Buhr
bfa3e33372 Reduce compilation time by using SkipParser when determining attribute type.
When using a large parser, the whole tree of parsers in instantiated with the
skip (whitespace) parser used. Then, it was instantiated again without a skip
parser, just to determine the attribute type.
This patch changes the code so the attribute type is determined *with* the
skip parser. That way, the number of template instantiations
required are halved for some use cases.

With gcc 14.2, the instantiations without the skip parser even ended up in the
binary. In that case, this patch reduces binary size.
This is most likely a compiler bug, as the usage is in decltype().
2025-10-12 21:31:32 -05:00
Andreas Buhr
8d7a64f7fe Performance improvement: Do not copy use_parser into lambda 2025-10-12 21:16:48 -05:00
Andreas Buhr
8c23054e07 Fix bug that ASCII code for z/Z was noch included in case_fold fast-path 2025-10-12 21:15:37 -05:00
Andreas Buhr
11a5d9a872 Add fast-path for lower case ASCII letters in case_fold
This improved the speed of my parser by approximately 20%
2025-10-12 21:15:37 -05:00
Andreas Buhr
d241bd7853 Make "transform" constexpr 2025-10-12 21:15:14 -05:00
ivanpanch
f20c4cfb02 Update parser.hpp 2025-10-12 21:00:47 -05:00
ivanpanch
fcbc53ddce Update parser.hpp 2025-10-12 21:00:47 -05:00
ivanpanch
fed0a883ad Update error_handling_fwd.hpp 2025-10-12 21:00:47 -05:00
ivanpanch
bfc61fa963 Update config.hpp 2025-10-12 21:00:47 -05:00
Zach Laine
c32d594d64 Eliminate double-instantiation of context templates (due to on a difference
between a nope and nope const GlobalState template arg) by using nope const by
default.

Fixes #250.
2025-10-12 20:00:05 -05:00
Zach Laine
c674e94c3d Don't reuse the attribute-generating path in rule_parser's out-param overload
of call.  Doing so was wiping out previous partial results, in cases like foo
>> bar, where foo produces a T, and bar is a rule that produces vector<T>.

Fixes #248.
2025-07-27 17:50:38 -05:00
Zach Laine
39faa9ddbe Pass the sentinel type as a template parameter to the iterator template in
project_view, as a workaround to the presence/absence of a disambiguating
template keyword in iterator's implementation.  Neither adding it nor temoving
it works for all builds.  Also, re-enable the C++17 MSVC 2022 Github build.

Fixes #252.
2025-07-26 21:12:37 -05:00
Zach Laine
5d6d2f7b84 Add missing special case for parsing a sequence of optional<T>s, writing the
results into a sequence container of Ts.

Fixes #223.
2025-07-26 20:15:15 -05:00
Zach Laine
fd6c56df1b Publicize project_view::{interator,sentinel} in attempt to fix VS 2022 build. 2025-07-13 15:56:35 -05:00
Zach Laine
af41e6a7c2 Add missing template keyword disambiguator in attempt to fix VS 2022 build. 2025-07-13 15:34:21 -05:00
Zach Laine
ed9a06123b Comment out unused dont_assign param in second overload defined by
BOOST_PARSER_DEFINE_IMPL.

Fixes #237.
2025-07-12 15:15:52 -05:00
Zach Laine
810adb43f6 Use a move asssignment instead of a copy assignment when returning a result
via detail::make_parse_result().

Supercedes PR #247.
2025-07-12 14:42:47 -05:00
Zach Laine
5788fb6967 Add missing 'template ' after dot when naming a dependent template
instantiation.

Fixes #221.
2025-05-06 01:55:23 -05:00
Zach Laine
927f35f115 Provide a way to specify radix, and min/max digits for {u,}int_parser, without
using the template parameters directly, since this also requires the user to
type parser_interface.

Fixes #220.
2025-04-12 19:59:46 -05:00
Zach Laine
a3ca1193b2 Add error reporting when encountering unexpected (left over) code points at
the end of an otherwise-successful parse, when doing non-prefix parsing.
2025-03-30 16:06:41 -05:00
Zach Laine
07153117ff Doc copy editing.
Fixes #217.
2025-03-30 16:06:02 -05:00
Zach Laine
6414f99e04 Remove space from declaration of UDLs, because apparently it matters?!
Fixes #216.
2025-03-13 19:03:14 -05:00
necessarily-equal
b253d9ca53 Add unicode symbols parser (#213)
* Add symb parser to handle unicode symbols

* Add documentation for symb

* Add tests for symb

* Fix typo in the documentation

---------

Contributed by: Antoine Fontaine <antoinefontaine@posteo.net>
2025-02-20 23:51:17 -06:00
Zach Laine
0a34acc42a Add new macro BOOST_PARSER_GCC that is defined in config.hpp only for real
(non-Clang-emulated) GCC builds; replace relevant uses of the __GNUC__ macro
with BOOST_PARSER_GCC.

See discussion in PR #211.
2025-02-20 23:38:09 -06:00
Zach Laine
56c81c0b57 Use gross pointer dereference expression to implement detail::whatever
converions operator, since 2/3 of the big three compilers reject the use of
declval() there.
2025-02-20 23:38:09 -06:00
Zach Laine
821d1d4c08 Fix longstanding mysterious ill-formedness in
detail::static_assert_merge_attributes.  It was down to unavailabilty of a
default ctor for certain parser types.
2025-02-20 23:38:09 -06:00
Zach Laine
57cdd78210 Properly sort the code point values in detail::char_set<punct_chars>.
Fixes #209.
2024-12-23 17:28:07 -06:00
Zach Laine
74bc8fc1bb Add the delimiter(p)[] directive proper (missing from previous commit).
Fixes #162.
2024-12-20 20:01:16 -06:00
Zach Laine
b42b052df4 Add the delimiter(p)[] directive, whic allows you to introduce a delimiter
into the parse of a permutation parser.

Fixes #162.
2024-12-19 22:26:08 -06:00
Zach Laine
42c9d82419 Add an optional char parser to quoted_string_parser, so that it can be made
fully general.

Fixes #196.
2024-12-17 00:17:54 -06:00
Zach Laine
305bba875b Grooming. 2024-12-09 01:57:04 -06:00
Zach Laine
6d7fa6f105 Add missing Docbook tag to fix broken reference in docs. 2024-11-29 16:20:14 -06:00
Zach Laine
3eb827dcd6 Fix error in seq_parser::append() that causes AllowBacktracking=false to be treated as =true. 2024-11-14 22:49:51 -06:00
Zach Laine
94a9daec40 Change the way that the pending operations are applied to symbol table
parsers.  Instead of trying to find all of them at the start of the top-level
parse, they are recorded in the context, and then applied at the end of the
top-level parse.  The previous technique did not work, simplt because the
top-level parse cannot see all the parser involded -- some are behind rule
firewalls, by design.

Related to #183.
Fixes #204.
2024-10-31 23:07:17 -05:00
Vernon Mauery
a7c7470bc1 Remove unused lambda capture
str is unused in the lambda; remove it from the capture

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2024-10-27 14:54:56 -05:00
Zach Laine
1e64b6e416 Add insert/erase/clear operations on symbol tables for the current parse and
subsequent parses both. Add better tests for the added API and the previous
subset of the operations already present. Fix errors revealed by the tests.

Fixes #183.
2024-10-03 17:56:00 -05:00
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
71eeb36272 Remove the broken use of alias CTAD from the transcoding views.
Fixes #193.
2024-09-30 18:06:46 -05:00
Martin Posch
e35d066f44 Avoid Compiler Warning. move declaration of 'buf' into region of #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS as it is only used there. 2024-09-30 12:48:12 -05:00
Martin Posch
b1b7b221c7 Avoid Compiler Warning. move declaration of 'buf' into region of #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS as it is only used there. 2024-09-30 12:48:12 -05:00