Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an easy way to get an error-string from a lexy::parse call? #145

Closed
Cthaeeh opened this issue Jun 9, 2023 · 0 comments
Closed

Comments

@Cthaeeh
Copy link

Cthaeeh commented Jun 9, 2023

E.g.

std::expected<X, std::string> parseX(
      const std::string &str)
{
    auto result = lexy::parse<grammar::Table>(lexy::string_input(str),
                                              lexy_ext::report_error);

    if (result.is_success()) {
        return result.value();
    } else {
        return std::unexpected( ? ); //<-
    }
}

Or do I have to implement my own lexy_ext::report_error in some form?

Repository owner locked and limited conversation to collaborators Jun 18, 2023
@foonathan foonathan converted this issue into discussion #152 Jun 18, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant