AsmGrader 0.0.0
Loading...
Searching...
No Matches
asmgrader::stringize Namespace Reference

For everything related to test requirement stringification. More...

Namespaces

namespace  detail
 

Classes

struct  StringizeResult
 Result type of a call to str or repr More...
 

Variables

constexpr const auto & repr = detail::repr_fn_dispatcher
 repr customization point object The return value of this function is guaranteed to be parsable by highlight::highlight
 
constexpr const auto & str = detail::str_fn_dispatcher
 str customization point object The return value of this function is guaranteed to be parsable by highlight::highlight
 

Detailed Description

For everything related to test requirement stringification.

Implementations of the str and repr functions. These by inspired by Python functions of the same names, and conform to basically the same semantics. That is, repr returns the "raw" representation of an expression. This is what should be used when we want to display components of an expression statement.

str returns the nicely-formatted value of an expression. This is what should be used when we want to display the evalutions of subexpressions.

Output of will default to format_or_unknown for all types without a stringize overload.

Variable Documentation

◆ repr

const auto& asmgrader::stringize::repr = detail::repr_fn_dispatcher
inlineconstexpr

repr customization point object The return value of this function is guaranteed to be parsable by highlight::highlight

Users may define a free function repr with the following signature: fmt::formattable auto repr(std::span<const Token> tokens, std::string_view raw_str, const T& val) Where T is any user-defined type. This function must be defined in the namespace enclosing T.

repr may also be defined within a user-defined type as a non-static member function. This function's required signature is: fmt::formattable auto repr(std::span<const Token> tokens, std::string_view raw_str) const

◆ str

const auto& asmgrader::stringize::str = detail::str_fn_dispatcher
inlineconstexpr

str customization point object The return value of this function is guaranteed to be parsable by highlight::highlight

Users may define a free function str with the following signature: fmt::formattable auto str(const T& val) Where T is any user-defined type. This function must be defined in the namespace enclosing T.

str may also be defined within a user-defined type as a non-static member function. This function's required signature is: fmt::formattable auto str() const