Rename a few variables

This commit is contained in:
Rangi42
2024-03-25 14:10:12 -04:00
parent 3568418c5d
commit 2b44672873
3 changed files with 6 additions and 7 deletions

View File

@@ -97,7 +97,7 @@ struct LexerState {
void setAsCurrentState();
bool setFileAsNextState(std::string const &filePath, bool updateStateNow);
void setViewAsNextState(char const *filePath, char const *buf, size_t size, uint32_t lineNo_);
void setViewAsNextState(char const *name, char const *buf, size_t size, uint32_t lineNo_);
void clear(uint32_t lineNo_);
};

View File

@@ -450,9 +450,9 @@ bool LexerState::setFileAsNextState(std::string const &filePath, bool updateStat
}
void LexerState::setViewAsNextState(
char const *filePath, char const *buf, size_t size, uint32_t lineNo_
char const *name, char const *buf, size_t size, uint32_t lineNo_
) {
path = filePath; // Used to report read errors in `peekInternal`
path = name; // Used to report read errors in `peekInternal`
content = ViewedLexerState{.ptr = buf, .size = size, .offset = 0};
clear(lineNo_);
lexerStateEOL = this;
@@ -1498,9 +1498,8 @@ static void appendStringLiteral(std::string &yylval, bool raw) {
// We'll be exiting the string scope, so re-enable expansions
// (Not interpolations, since they're handled by the function itself...)
lexerState->disableMacroArgs = false;
auto str = readInterpolation(0);
if (str) {
appendEscapedSubstring(yylval, *str);
if (auto interpolation = readInterpolation(0); interpolation) {
appendEscapedSubstring(yylval, *interpolation);
}
lexerState->disableMacroArgs = true;
continue; // Do not copy an additional character

View File

@@ -776,7 +776,7 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "\tTrim the last %" PRIu64 " tiles\n", options.trim);
fprintf(stderr, "\tMaximum %" PRIu8 " palettes\n", options.nbPalettes);
fprintf(stderr, "\tPalettes contain %" PRIu8 " colors\n", options.nbColorsPerPal);
fprintf(stderr, "\t%s palette spec\n", []() {
fprintf(stderr, "\t%s palette spec\n", [] {
switch (options.palSpecType) {
case Options::NO_SPEC:
return "No";