tint/lexer: Add 'diagnostic' keyword
Bug: tint:1809 Change-Id: I55ce14b8775a64c4f7ccbbd7e84094e9e4ee19a6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117560 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
parent
57c0bbc2a5
commit
ffe356d558
|
@ -1141,6 +1141,9 @@ Token Lexer::check_keyword(const Source& source, std::string_view str) {
|
|||
if (str == "continuing") {
|
||||
return {Token::Type::kContinuing, source, "continuing"};
|
||||
}
|
||||
if (str == "diagnostic") {
|
||||
return {Token::Type::kDiagnostic, source, "diagnostic"};
|
||||
}
|
||||
if (str == "discard") {
|
||||
return {Token::Type::kDiscard, source, "discard"};
|
||||
}
|
||||
|
|
|
@ -1061,8 +1061,10 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
TokenData{"continue", Token::Type::kContinue},
|
||||
TokenData{"continuing", Token::Type::kContinuing},
|
||||
TokenData{"default", Token::Type::kDefault},
|
||||
TokenData{"diagnostic", Token::Type::kDiagnostic},
|
||||
TokenData{"discard", Token::Type::kDiscard},
|
||||
TokenData{"else", Token::Type::kElse},
|
||||
TokenData{"enable", Token::Type::kEnable},
|
||||
TokenData{"f32", Token::Type::kF32},
|
||||
TokenData{"fallthrough", Token::Type::kFallthrough},
|
||||
TokenData{"false", Token::Type::kFalse},
|
||||
|
|
|
@ -153,6 +153,8 @@ std::string_view Token::TypeToName(Type type) {
|
|||
return "continue";
|
||||
case Token::Type::kContinuing:
|
||||
return "continuing";
|
||||
case Token::Type::kDiagnostic:
|
||||
return "diagnostic";
|
||||
case Token::Type::kDiscard:
|
||||
return "discard";
|
||||
case Token::Type::kDefault:
|
||||
|
|
|
@ -163,6 +163,8 @@ class Token {
|
|||
kContinue,
|
||||
/// A 'continuing'
|
||||
kContinuing,
|
||||
/// A 'diagnostic'
|
||||
kDiagnostic,
|
||||
/// A 'discard'
|
||||
kDiscard,
|
||||
/// A 'default'
|
||||
|
|
Loading…
Reference in New Issue