diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-02-24 12:43:13 -0500 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-02-24 12:43:13 -0500 |
| commit | 692fc6906c9f523334428d29afc187411fd59bf9 (patch) | |
| tree | 1084ffbe097bf1f822e11bac2d83f4a30e84ef67 /willow/tools/willowc/include/tokenizer.hpp | |
| parent | 4b005e4a6e646c0b2788fc261097cdca2a93696c (diff) | |
| download | compiler-692fc6906c9f523334428d29afc187411fd59bf9.tar.gz | |
[willow][tools]: unit testing for tokenizer
Diffstat (limited to 'willow/tools/willowc/include/tokenizer.hpp')
| -rw-r--r-- | willow/tools/willowc/include/tokenizer.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/willow/tools/willowc/include/tokenizer.hpp b/willow/tools/willowc/include/tokenizer.hpp index 47577ab..d3970f6 100644 --- a/willow/tools/willowc/include/tokenizer.hpp +++ b/willow/tools/willowc/include/tokenizer.hpp @@ -22,6 +22,9 @@ enum class TokenKind { LCurly, RCurly, Equals, + Star, + LTriangle, + RTriangle, RArrow, Comment, @@ -66,7 +69,7 @@ class Tokenizer { bool scan_hex(); bool scan_constant(); public: - explicit Tokenizer(std::string_view buf, std::size_t offset = 0) + explicit constexpr Tokenizer(std::string_view buf, std::size_t offset = 0) : buf{buf}, offset{offset} {} Token scan(); @@ -103,6 +106,12 @@ constexpr std::string_view TokenKindName(TokenKind t) { return "RCurly"; case TokenKind::Equals: return "Equals"; + case TokenKind::Star: + return "Star"; + case TokenKind::LTriangle: + return "LTriangle"; + case TokenKind::RTriangle: + return "RTriangle"; case TokenKind::RArrow: return "RArrow"; case TokenKind::Comment: |