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 10, 2024
1 parent ff22ab1 commit a55603c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions include/boost/parser/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,10 @@ namespace boost { namespace parser {
template<
std::ranges::contiguous_range V,
typename Lexer,
typename TokenCache = std::vector<typename Lexer::token_type>>
typename TokenCache>
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 a55603c

Please sign in to comment.