Skip to content

Commit

Permalink
Fix multiple thinkos in tokens_view.
Browse files Browse the repository at this point in the history
See #202.
  • Loading branch information
tzlaine committed Nov 29, 2024
1 parent 1421592 commit 2b518bc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions include/boost/parser/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ namespace boost { namespace parser {
typename TokenCache = std::vector<typename Lexer::token_type>>
requires std::ranges::view<V>
struct tokens_view
: public std::ranges::view_interface<tokens_view<V, Lexer>>
: public std::ranges::view_interface<tokens_view<V, Lexer, TokenCache>>
{
private:
template<bool>
Expand Down Expand Up @@ -934,8 +934,17 @@ namespace boost { namespace parser {
return token_offset_ == rhs.token_offset_;
}

auto range_begin() const { std::ranges::begin(parent_->base_); }
auto range_end() const { std::ranges::end(parent_->base_); }
auto range_begin() const
{
return std::ranges::begin(parent_->base_);
}
auto range_end() const { return std::ranges::end(parent_->base_); }

using base_type = detail::stl_interfaces::proxy_iterator_interface<
iterator<Const>,
std::forward_iterator_tag,
token_type>;
using base_type::operator++;
};

template<bool Const>
Expand Down

0 comments on commit 2b518bc

Please sign in to comment.