Skip to content

Parsing from a stream #132

Answered by rkaminsk
rkaminsk asked this question in Q&A
Apr 16, 2023 · 4 comments · 8 replies
Discussion options

You must be logged in to vote

Here is the version I am currently working with. Going to mark this one as answer.

#include <cassert>
#include <sstream>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

#include <catch2/catch_test_macros.hpp>

#include <lexy/action/scan.hpp>
#include <lexy/callback.hpp>
#include <lexy/dsl.hpp>
#include <lexy/grammar.hpp>
#include <lexy_ext/report_error.hpp>

template <class Input, class Void = void> struct get_counting {
    using type = lexy::_default_location_counting<Input>;
};

template <class Input> struct get_counting<Input, std::void_t<typename Input::counting>> {
    using type = Input::counting;
};

template <class Input> auto get_anchor(Input const

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
2 replies
@foonathan
Comment options

@rkaminsk
Comment options

Comment options

You must be logged in to vote
2 replies
@foonathan
Comment options

@rkaminsk
Comment options

Comment options

You must be logged in to vote
4 replies
@foonathan
Comment options

@rkaminsk
Comment options

@foonathan
Comment options

@rkaminsk
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by rkaminsk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants