 
   @_spi(RawSyntax)
   public mutating func parsePoundDiagnosticDeclaration() -> RawDeclSyntax {
-    assert(self.at(any: [.poundErrorKeyword, .poundWarningKeyword]))
+    enum ExpectedTokenKind: RawTokenKindSubset {
+      case poundErrorKeyword
+      case poundWarningKeyword
+
+      var rawTokenKind: RawTokenKind {
+        switch self {
+        case .poundErrorKeyword: return .poundErrorKeyword
+        case .poundWarningKeyword: return .poundWarningKeyword
+        }
+      }
+    }
+
 
     let directive: PoundDiagnosticKind
-    if let poundError = self.consume(if: .poundErrorKeyword) {
-      directive = .error(poundError: poundError)
-    } else if let poundWarning = self.consume(if: .poundWarningKeyword) {
-      directive = .warning(poundWarning: poundWarning)
-    } else {
-      assert(false, "Should not happen based on assertion at start of function")
+
+    switch self.at(anyIn: ExpectedTokenKind.self) {
+    case (.poundErrorKeyword, let handle)?:
+      directive = .error(poundError: self.eat(handle))
+    case (.poundWarningKeyword, let handle)?:
+      directive = .warning(poundWarning: self.eat(handle))
+    case nil:
       directive = .error(poundError: RawTokenSyntax(missing: .poundErrorKeyword, arena: self.arena))
     }
-
+    
     let (unexpectedBeforeLeftParen, leftParen) = self.expect(.leftParen)
     let stringLiteral: RawStringLiteralExprSyntax
     if self.currentToken.tokenKind == .stringLiteral {

            equalityToken: equal,
            rightTypeIdentifier: secondType,
            arena: self.arena))
        } else {
          requirement = RawSyntax(RawSameTypeRequirementSyntax(
            leftTypeIdentifier: firstType,
            equalityToken: RawTokenSyntax(missing: .equal, arena: self.arena),

              rightTypeIdentifier: secondType,
              arena: self.arena))
          }
        case (.spacedBinaryOperator, _)?,
          (.unspacedBinaryOperator, _)?,
          (.postfixOperator, _)?,
          (.prefixOperator, _)?:
          let equal = self.consumeAnyToken()
          let secondType = self.parseType()
          requirement = RawSyntax(RawSameTypeRequirementSyntax(
