header_utils
Loading...
Searching...
No Matches
ghassanpl::parsing Namespace Reference

Classes

struct  parse_error
 An exception type that will be thrown when eating/parsing fails. More...

Functions

size_t find_line_number (std::string_view of_string, std::string_view in_document) noexcept
 Given a multiline in_document, will return the line number (starting at 1) of the line which contains the start of of_string.
std::pair< size_t, size_t > find_line_and_column (std::string_view of_string, std::string_view in_document) noexcept
 Given a multiline in_document, will return the line and column numbers (starting at 1) of the start of of_string.
std::string_view consume_c_identifier (std::string_view &str)
 Will consume a C-style identifier: [A-Za-z_][A-Za-z0-9_]*.
std::string_view consume_c_identifier_with (std::string_view &str, std::string_view additional_chars)
 Will consume a C-style identifier that may contain any additional characters from additional_chars: '[A-Za-z_'+additional_chars+'][A-Za-z0-9_'+additional_chars+']*'.
std::pair< std::string_view, double > consume_c_float (std::string_view &str)
std::pair< std::string_view, int64_t > consume_c_integer (std::string_view &str, int base)
std::pair< std::string_view, uint64_t > consume_c_unsigned (std::string_view &str, int base)
template<char DELIMITER>
std::pair< std::string_view, std::string > consume_c_string (std::string_view &strv)
bool try_eat (std::string_view &str, std::string_view what)
bool try_eat (std::string_view &str, char what)
void eat (std::string_view &str, std::string_view what)
void eat (std::string_view &str, char what)
std::string_view try_eat_identifier (std::string_view &str)
std::string_view eat_identifier (std::string_view &str)
std::string_view try_eat_identifier_with (std::string_view &str, std::string_view additional_chars)
std::string_view eat_identifier_with (std::string_view &str, std::string_view additional_chars)
std::string_view eat_whitespace (std::string_view &str)
bool try_eat_line_comment (std::string_view &str, std::string_view comment_start)
bool try_eat_unsigned (std::string_view &str, uint64_t &result, int base)
std::optional< uint64_t > try_eat_unsigned (std::string_view &str, int base)
bool try_eat_integer (std::string_view &str, int64_t &result, int base)
std::optional< int64_t > try_eat_integer (std::string_view &str, int base)
bool try_eat_float (std::string_view &str, double &result)
std::optional< double > try_eat_float (std::string_view &str)
uint64_t eat_unsigned (std::string_view &str, int base)
int64_t eat_integer (std::string_view &str, int base)
double eat_float (std::string_view &str)
 Eats a C-style floating-point value.
char32_t try_eat_utf8_codepoint (std::string_view &str)
char32_t eat_utf8_codepoint (std::string_view &str)
std::tuple< std::string_view, std::variant< double, uint64_t, int64_t > > consume_c_number (std::string_view &str)

Detailed Description

Function Documentation

◆ consume_c_number()

std::tuple< std::string_view, std::variant< double, uint64_t, int64_t > > ghassanpl::parsing::consume_c_number ( std::string_view & str)
inlinenodiscard

Definition at line 194 of file parsing.h.