mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-29 06:17:48 +00:00
Give clearer names to template parameters
This commit is contained in:
@@ -38,8 +38,8 @@ struct Charmap {
|
||||
};
|
||||
|
||||
// Traverse the trie depth-first to derive the character mappings in definition order
|
||||
template<typename F>
|
||||
bool forEachChar(Charmap const &charmap, F callback) {
|
||||
template<typename CallbackFnT>
|
||||
bool forEachChar(Charmap const &charmap, CallbackFnT callback) {
|
||||
// clang-format off: nested initializers
|
||||
for (std::stack<std::pair<size_t, std::string>> prefixes({{0, ""}}); !prefixes.empty();) {
|
||||
// clang-format on
|
||||
|
||||
@@ -816,8 +816,8 @@ static int nextChar() {
|
||||
return peek();
|
||||
}
|
||||
|
||||
template<typename P>
|
||||
static int skipChars(P predicate) {
|
||||
template<typename PredicateFnT>
|
||||
static int skipChars(PredicateFnT predicate) {
|
||||
int c = peek();
|
||||
while (predicate(c)) {
|
||||
c = nextChar();
|
||||
@@ -2281,8 +2281,8 @@ yy::parser::symbol_type yylex() {
|
||||
}
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
static Capture makeCapture(char const *name, F callback) {
|
||||
template<typename CallbackFnT>
|
||||
static Capture makeCapture(char const *name, CallbackFnT callback) {
|
||||
// Due to parser internals, it reads the EOL after the expression before calling this.
|
||||
// Thus, we don't need to keep one in the buffer afterwards.
|
||||
// The following assumption checks that.
|
||||
|
||||
@@ -57,8 +57,10 @@
|
||||
|
||||
yy::parser::symbol_type yylex(); // Provided by lexer.cpp
|
||||
|
||||
template <typename N, typename S>
|
||||
static auto handleSymbolByType(std::string const &symName, N numCallback, S strCallback) {
|
||||
template<typename NumCallbackFnT, typename StrCallbackFnT>
|
||||
static auto handleSymbolByType(
|
||||
std::string const &symName, NumCallbackFnT numCallback, StrCallbackFnT strCallback
|
||||
) {
|
||||
if (Symbol *sym = sym_FindScopedSymbol(symName); sym && sym->type == SYM_EQUS) {
|
||||
return strCallback(*sym->getEqus());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user