diff --git a/thrift/compiler/whisker/test/lexer_test.cc b/thrift/compiler/whisker/test/lexer_test.cc index 4ddab907758..f9491654273 100644 --- a/thrift/compiler/whisker/test/lexer_test.cc +++ b/thrift/compiler/whisker/test/lexer_test.cc @@ -183,7 +183,7 @@ TEST_F(LexerTest, multiple_identifiers) { } TEST_F(LexerTest, ids_and_punctuations) { - auto lexer = make_lexer("{{ |. ! bas ^> = ic /# }}{{()}}"); + auto lexer = make_lexer("{{ |. ! bas ^> =* ic /# }}{{()}}"); const std::vector expected = { {tok::open, {}}, {tok::pipe, {}}, @@ -193,6 +193,7 @@ TEST_F(LexerTest, ids_and_punctuations) { {tok::caret, {}}, {tok::gt, {}}, {tok::eq, {}}, + {tok::star, {}}, {tok::identifier, "ic"}, {tok::slash, {}}, {tok::pound, {}}, diff --git a/thrift/compiler/whisker/token.cc b/thrift/compiler/whisker/token.cc index 9eb149465a9..51634028735 100644 --- a/thrift/compiler/whisker/token.cc +++ b/thrift/compiler/whisker/token.cc @@ -91,6 +91,7 @@ constexpr token_kind_info info[] = { {tok::pipe, "`|`"}, {tok::gt, "`>`"}, {tok::eq, "`=`"}, + {tok::star, "`*`"}, #define WHISKER_KEYWORD(kw) {tok::kw_##kw, "`" #kw "`"}, WHISKER_KEYWORDS() diff --git a/thrift/compiler/whisker/token.h b/thrift/compiler/whisker/token.h index a84fa1c91eb..56a32f9b40e 100644 --- a/thrift/compiler/whisker/token.h +++ b/thrift/compiler/whisker/token.h @@ -62,6 +62,7 @@ enum class tok : unsigned { pipe, // "|" gt, // ">" eq, // "=" + star, // "*" // clang-format on // Literals: @@ -114,6 +115,7 @@ constexpr tok to_tok(char c) { case '|': return tok::pipe; case '>': return tok::gt; case '=': return tok::eq; + case '*': return tok::star; default: return tok::error; }