diff options
| author | Mustafa Quraish <[email protected]> | 2022-01-30 02:20:58 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-01-30 18:04:13 -0500 |
| commit | b08bb0a17ed05e7febaee5c71f5cf1ff3447dea1 (patch) | |
| tree | d10d6f869509b7c9d4650f4aa18850fdaec97904 /src/tokens.c | |
| parent | Update build system to use Makefile (diff) | |
| download | cup-b08bb0a17ed05e7febaee5c71f5cf1ff3447dea1.tar.xz cup-b08bb0a17ed05e7febaee5c71f5cf1ff3447dea1.zip | |
Put tokens in their own macro to allow looping over them
Diffstat (limited to 'src/tokens.c')
| -rw-r--r-- | src/tokens.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tokens.c b/src/tokens.c index e562e16..2d99f71 100644 --- a/src/tokens.c +++ b/src/tokens.c @@ -47,9 +47,10 @@ char *token_type_to_str(TokenType type) // Otherwise, just print the token type switch (type) { - #define ENUM_TOKEN(name, str) case name: return str; - ENUM_TOKENS(ENUM_TOKEN) - #undef ENUM_TOKEN + #define HANDLE_ITEM(name, str) case name: return str; + ENUM_TOKENS(HANDLE_ITEM) + ENUM_KEYWORDS(HANDLE_ITEM) + #undef HANDLE_ITEM default: assert(false && "Unreachable"); } } |