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

42 Commits

Author SHA1 Message Date
ivanpanch
68c306bf66 Update json.cpp 2025-10-12 21:00:47 -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
063291b78c Correct the parser used in the second half of the "Parse Into a Class"
example.

Fixes #206.
2024-11-24 22:55:21 -06:00
Zach Laine
d88e47cf17 Fix deficiencies in the CMake build:
- Clone minimal Boost dependencies so that the minimal Boost.Test header is
  available.

- Add boostdep-generated CMake code to the top of the top-level
  CMakeLists.txt.

Fixes #127.
2024-03-24 22:29:10 -05:00
Zach Laine
64e76e7b58 GCC warning mitigation. 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
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
ffdc3f967b Add docs for the new automatic subitutability of non-aggregate class types for
tuples.

Partially addresses #49.
2024-01-19 20:15:07 -06:00
Zach Laine
d59e0528b2 Consolidate documentation on eror handlers into the Error Handling and
Debugging section, and add an example of how to write your own error handler.

Fixes #43.
2024-01-15 02:28:50 -06:00
Zach Laine
a6c4cb14b1 Introduce op% early, and use it instead of its long-form equivalent in the
rest of the docs.

Fixes #46.
2024-01-07 01:15:24 -06:00
Zach Laine
c7b9eb6eb5 Reimplement get() overloads as one publicly-facing function. 2024-01-06 14:21:07 -06:00
Zach Laine
d60d33e40b Finish implementing support for parsing into structs as if they were tuples.
This makes it possible to map from sequence parsers onto structs with no
semantic actions.  Also, add a doc section describing how parsing structs
works (including a couple of short example programs).

Fixes #45.
Partially addresses #28.
2024-01-03 23:24:37 -06:00
Zach Laine
2fd5248be5 Remove stray uses of ascii::space.
Partially addresses #34.
2024-01-01 15:29:35 -06:00
Zach Laine
e88d819122 Change the trivial_skipper example to use ws instead of ascii::space, and add
text to the tutorial to explain why this is a better choice.

Fixes #34.
2023-12-30 17:22:55 -06:00
sehe
b7d1d3dba5 Fix spelling of hexadecimal
The library and documentation misspells it (consistently, which is good
:)) as hexidecimal. That makes it hard for (new) users to find out by
searching documentation.

The fifteen spots fixed:

    example/callback_json.cpp|47 col 15| "four hexidecimal digits";
    example/callback_json.cpp|49 col 18| "\\uXXXX hexidecimal escape sequence";
    example/callback_json.cpp|51 col 38| escape_double_seq = "\\uXXXX hexidecimal escape sequence";
    example/json.cpp|57 col 28| // like "expected four hexidecimal digits here:", instead of "expected
    example/json.cpp|65 col 15| "four hexidecimal digits";
    example/json.cpp|67 col 18| "\\uXXXX hexidecimal escape sequence";
    example/json.cpp|69 col 38| escape_double_seq = "\\uXXXX hexidecimal escape sequence";
    example/json.cpp|158 col 18| // declare a hexidecimal parser that matches exactly 4.
    doc/tutorial.qbk|981 col 18| [ Matches a hexidecimal unsigned integral value. ]
    doc/tutorial.qbk|986 col 28| [ Matches exactly the hexidecimal unsigned integral value `_RES_np_(arg0)`. ]
    doc/tutorial.qbk|1118 col 42| So, if you wanted to parse exactly eight hexidecimal digits in a row in order
    doc/tutorial.qbk|2729 col 18| "\\uXXXX hexidecimal escape sequence";
    doc/tutorial.qbk|2731 col 38| escape_double_seq = "\\uXXXX hexidecimal escape sequence";
    doc/tutorial.qbk|2741 col 9| put a hexidecimal escape sequence there.
    include/boost/parser/parser.hpp|5622 col 13| /** The hexidecimal unsigned integer parser.  Produces an `unsigned int`

The one spot that was inconsistent (outside the gtest subtree):

    include/boost/parser/tuple.hpp|66 col 36| // 0xDEADBEEF (hexadecimal)
2023-12-30 15:13:04 -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
2416d0d966 Doc copy editing. 2023-12-23 03:06:28 -06:00
Zach Laine
3b8c74c990 Use boost::parser::as_utf32 instead of boost::parser::detail::text::as_utf32
in the examples.
2023-12-23 02:55:26 -06:00
Zach Laine
876056aa28 uint32_t -> char32_t in transcode_iterator. 2023-12-03 14:19:08 -06:00
Zach Laine
fb47fdc0f1 Make the configury simpler:
- Remove BOOST_PARSER_STANDALONE, and make that the default.  The bits of
Boost that we might use are used automatically when they're available (as
discovered via __has_include).

- Remove the non-essential uses of Boost from the examples.
2023-12-02 02:05:53 -06:00
Zach Laine
61bd9fba5c Comment typo. 2023-12-02 02:03:28 -06:00
Zach Laine
1c0bd473f3 Fix really weird thinko in file_slurp() in JSON examples. 2022-04-08 19:07:59 -05:00
Zach Laine
4f3b106de9 Fix a failing static_assert in the non-callback JSON example, that was due to
sizeof(std::unique_ptr<T>) being 2*(sizeof(T*) on Clang!
2022-04-08 17:43:05 -05:00
Zach Laine
4d0a310809 Correct (sigh) UB in self_filling_symbol_table.cpp example. 2022-04-07 17:49:54 -05:00
Zach Laine
93a51860e3 Doc copy edits. 2022-04-07 00:10:38 -05:00
Zach Laine
8d976d31df Fix Clang build on Linux. 2020-09-20 18:32:24 -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
111efe1eb3 Fully internalize Boost.Text headers. 2020-09-20 03:23:23 -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
435ac5adf4 Fix a handfull of compilation failures when building on MSVC. 2020-09-09 23:01:49 -05:00
Zach Laine
e24b0b05cb Add extended JSON callback parsing example. 2020-09-07 20:44:54 -05:00
Zach Laine
faab941450 Add exended JSON parsing example. 2020-09-05 01:49:16 -05:00
Zach Laine
0348ed2b69 First draft of section on rules. 2020-09-05 01:49:16 -05:00
Zach Laine
080b89f920 Add a short example using a rule before we get into the weeds. 2020-09-04 02:23:29 -05:00
Zach Laine
c37a9c65a8 Add a mutable symbol table example. 2020-08-30 18:07:43 -05:00
Zach Laine
b33992719c Add symbol parser example. 2020-08-30 18:06:50 -05:00
Zach Laine
1d90a9d621 Lots of doc updates:
- Add a rationale for parser::none.
- Add a section introducing essential terminology.
- Flesh out the semantic action example.
- Add a section describing the parse context and how it works.
- Remove numerous TODOs related to documentation addressed above.
2020-08-30 15:33:56 -05:00
Zach Laine
5fcca75797 Flesh out the trivial example, fix a problem with it, and add another example
just like it that uses a skipper.
2020-08-29 21:53:54 -05:00
Zach Laine
0b86c6771e Flesh out the hello world example accompanying text. 2020-08-29 21:09:50 -05:00
Zach Laine
1f317d5588 Add trivial parsing example. 2020-08-29 19:17:04 -05:00