Ruby 4.1.0dev (2026-10-21 revision fa2fee5a1d8a80586a0a0ac38e184e0d6622673e)
Data Structures | Public Member Functions
prism::detail::next_range< T, Next > Class Template Reference

The diagnostics, comments, or magic comments found while parsing, usable in a range-based for loop and with the standard algorithms. More...

#include <parser.hpp>

Data Structures

class  iterator
 Steps through the items one after another. More...
 

Public Member Functions

 next_range (const T *first, std::size_t size) noexcept
 Create a range of the given number of items starting at first.
 
iterator begin () const noexcept
 An iterator at the first item.
 
iterator end () const noexcept
 An iterator past the last item.
 
std::size_t size () const noexcept
 The number of items.
 
bool empty () const noexcept
 Whether there are no items.
 

Detailed Description

template<typename T, const T *(*)(const T *) Next>
class prism::detail::next_range< T, Next >

The diagnostics, comments, or magic comments found while parsing, usable in a range-based for loop and with the standard algorithms.

Each element is a pointer to the C struct, which the C accessors read, and Next is the C function that returns the item after a given one. It refers to the parser rather than copying from it, so the parser must outlive it. It is used through diagnostic_range, comment_range, and magic_comment_range.

Definition at line 105 of file parser.hpp.

Constructor & Destructor Documentation

◆ next_range()

template<typename T , const T *(*)(const T *) Next>
prism::detail::next_range< T, Next >::next_range ( const T *  first,
std::size_t  size 
)
inlinenoexcept

Create a range of the given number of items starting at first.

Parameters
firstThe first item.
sizeThe number of items.

Definition at line 182 of file parser.hpp.

Member Function Documentation

◆ begin()

template<typename T , const T *(*)(const T *) Next>
iterator prism::detail::next_range< T, Next >::begin ( ) const
inlinenoexcept

An iterator at the first item.

Returns
An iterator at the first item.

Definition at line 189 of file parser.hpp.

◆ empty()

template<typename T , const T *(*)(const T *) Next>
bool prism::detail::next_range< T, Next >::empty ( ) const
inlinenoexcept

Whether there are no items.

Returns
Whether there are no items.

Definition at line 210 of file parser.hpp.

◆ end()

template<typename T , const T *(*)(const T *) Next>
iterator prism::detail::next_range< T, Next >::end ( ) const
inlinenoexcept

An iterator past the last item.

Returns
An iterator past the last item.

Definition at line 196 of file parser.hpp.

◆ size()

template<typename T , const T *(*)(const T *) Next>
std::size_t prism::detail::next_range< T, Next >::size ( ) const
inlinenoexcept

The number of items.

Returns
The number of items.

Definition at line 203 of file parser.hpp.


The documentation for this class was generated from the following file: