foonathan / lexy

C++ parsing DSL
https://lexy.foonathan.net
Boost Software License 1.0
1.01k stars 68 forks source link

Example for Callback lexy::new_ in documentation appears to be incorrect. #67

Closed Bobbias closed 2 years ago

Bobbias commented 2 years ago

The documentation for lexy::new_ on your website appears to show the wrong example.

Currently it shows this:

Example 2. Construct a point on the heap and returns a std::unique_ptr

struct point
{
    int x, y;
};

struct production
{
    static constexpr auto whitespace = dsl::ascii::space;

    static constexpr auto rule = [] {
        auto integer = dsl::integer<int>;
        return dsl::twice(integer, dsl::sep(dsl::comma));
    }();
    static constexpr auto value = lexy::construct<point>;
};

The code here is identical to the example for lexy::construct.

foonathan commented 2 years ago

Thanks for catching that.