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
2054eab1bd
Disable string_view[] code in parser.cpp in pre-C++20 builds.
2024-01-15 00:51:00 -06:00
Zach Laine
9187bf851e
Add section on raw[] and string_view[] to docs.
...
Fixes #59 .
2024-01-14 20:57:43 -06:00
Zach Laine
7103755e59
Comment out test code that exercises spooky behavior on MSVC.
2024-01-15 02:55:30 -06:00
Zach Laine
b055b21f1f
Address TODO about string_view_parser needing tests.
2024-01-14 17:41:38 -06:00
Zach Laine
e6a9763b86
Cruft removal.
2024-01-13 14:15:49 -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
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
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
Zach Laine
9e374f8cc3
Flesh out support for parsing into non-sequence containers.
2024-01-07 00:44:21 -06:00
Zach Laine
6ab2a9b6a4
Fix the parsing of attributes into nested aggregate types.
...
Fixes #50 .
2024-01-07 00:44:21 -06:00
Zach Laine
7921f15ef8
Cruft removal.
2024-01-03 16:55:13 -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
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
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
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
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
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
113270d6f6
Remove dependency on Boost.Any.
2020-09-19 20:43:12 -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
711bc9e2b3
- eol_parser -> ws_parser
...
- ws_parser does all whitespace (according to the Unicode White_Space
property) or just eol, depending on parameterization.
- Add ws, a parser object that uses the all-whitespace mode of ws_parser.
- Fix an error in the constraints on *parse(); iterators over char8_t (and not
just pointers) now properly fall under the Unicode parsing path.
Fixes #4 .
2020-09-01 21:52:28 -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
950065b5d2
Range-parse overloads now indicated failure when the entire input is not
...
consumed.
2020-08-29 21:09:50 -05:00
Zach Laine
678f666785
Remove "skip_" from all parse function names, and reorder the parse API
...
functions for clarity. Also, drive-by cleanups in parser_{,api}.cpp.
2020-08-29 19:17:04 -05:00
Zach Laine
c2374adf12
Warning mitigation in test/.
2020-08-29 19:17:04 -05:00
Zach Laine
4b516b9047
Make parser::range a proper view (called "parser::view"), via
...
view_interface. Some drive-by grooming.
2020-08-28 19:09:58 -05:00
Zach Laine
f39e309118
Add Windows-only support for std::wstring_view file names.
2019-11-16 14:06:18 -06:00
Zach Laine
89e08daec7
string_view -> range in the parse API.
2019-11-16 13:44:33 -06:00
Zach Laine
5f33a6a1e9
Upgrade to the latest version of Boost.Text transcoding code.
2019-11-16 08:14:30 -06:00
Zach Laine
f802b967da
boost::optional -> std::optional
2019-10-30 20:24:30 -05:00
Zach Laine
af7f88b677
Make parse API 4x smaller by:
...
- making trace (formerly debug) mode a runtime parameter; and
- adding a with_error_handler() (a la with_globals()) fundiotn, and using that
instead of passing an optional error_handler parameter to the parse
functions.
2019-10-28 21:13:07 -05:00
Zach Laine
489f8f69d9
Zach Laine -> T. Zachary Laine
2018-10-23 23:52:05 -05:00
Zach Laine
a6a0826f22
Add bool_parser case to parser.cpp test.
2018-10-22 23:42:19 -05:00
Zach Laine
04dbec39dc
Add parser tests.
2018-10-10 19:34:29 -05:00
Zach Laine
7e208d7085
First half of a largish refactor that allows BOMs to be handled correctly.
2017-05-06 14:29:10 -05:00
Zach Laine
ec1d3d5a76
Switch parse test to using new parser.
2017-04-26 21:25:50 -05:00
Zach Laine
dc36d8dbed
Comment out failing tests.
2017-04-21 23:23:04 -05:00
Zach Laine
6137003e7f
Build parser into its own TU.
2017-04-20 21:01:47 -05:00