Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

Commit 8d8da21

Browse files
committed
chore: refactor frontend token
1 parent 88bf265 commit 8d8da21

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎include/lbd/frontend/token.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace frontend::token {
6262

6363
Token(TokenType tokenType, Location location);
6464

65-
friend std::ostream &operator<<(std::ostream &stream, const Token &token);
65+
friend std::ostream &operator<<(std::ostream &outputStream, const Token &token);
6666

6767
[[nodiscard]] std::string toString() const;
6868
};

‎src/frontend/token.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ namespace frontend::token {
88
tokenType(std::move(tokenType)) {
99
}
1010

11-
std::ostream &operator<<(std::ostream &stream, const Token &token) {
12-
return stream << token.location << ":\t" << token.toString();
11+
std::ostream &operator<<(std::ostream &outputStream, const Token &token) {
12+
return outputStream << token.location << ":\t" << token.toString();
1313
}
1414

1515
std::string Token::toString() const {
16-
return std::visit([&]<typename T0>(T0 &&arg) {
16+
return std::visit([&]<typename T0>(T0 &&argument) {
1717
using T = std::decay_t<T0>;
1818
if constexpr (std::is_same_v<T, Identifier>) {
19-
return token::toString<T>() + " <" + arg.value + ">";
19+
return token::toString<T>() + " <" + argument.value + ">";
2020
} else if constexpr (std::is_same_v<T, String>) {
21-
return token::toString<T>() + " <\"" + arg.value + "\">";
21+
return token::toString<T>() + " <\"" + argument.value + "\">";
2222
} else if constexpr (std::is_same_v<T, Float>) {
23-
return token::toString<T>() + " <" + std::to_string(arg.value) + ">";
23+
return token::toString<T>() + " <" + std::to_string(argument.value) + ">";
2424
} else {
2525
return token::toString<T>();
2626
}

0 commit comments

Comments
 (0)