Skip to content

Commit 0e3449c

Browse files
committed
Remove TokenKind.kind
This property isn't used anywhere, dates back to the old parser and isn't public. Let's remove it.
1 parent 7c8540b commit 0e3449c

File tree

2 files changed

+0
-137
lines changed

2 files changed

+0
-137
lines changed

Sources/SwiftSyntax/TokenKind.swift.gyb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,6 @@ public enum TokenKind: Hashable {
9898
}
9999
}
100100

101-
var kind: String {
102-
switch self {
103-
case .eof: return "eof"
104-
% for token in SYNTAX_TOKENS:
105-
% kind = token.swift_kind()
106-
% if not token.text:
107-
% kind += '(_)'
108-
% end
109-
case .${kind}: return "${token.kind}"
110-
% end
111-
}
112-
}
113-
114101
var sourceLength: SourceLength {
115102
switch self {
116103
case .eof: return .zero

Sources/SwiftSyntax/gyb_generated/TokenKind.swift

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -682,130 +682,6 @@ public enum TokenKind: Hashable {
682682
}
683683
}
684684

685-
var kind: String {
686-
switch self {
687-
case .eof: return "eof"
688-
case .associatedtypeKeyword: return "kw_associatedtype"
689-
case .classKeyword: return "kw_class"
690-
case .deinitKeyword: return "kw_deinit"
691-
case .enumKeyword: return "kw_enum"
692-
case .extensionKeyword: return "kw_extension"
693-
case .funcKeyword: return "kw_func"
694-
case .importKeyword: return "kw_import"
695-
case .initKeyword: return "kw_init"
696-
case .inoutKeyword: return "kw_inout"
697-
case .letKeyword: return "kw_let"
698-
case .operatorKeyword: return "kw_operator"
699-
case .precedencegroupKeyword: return "kw_precedencegroup"
700-
case .protocolKeyword: return "kw_protocol"
701-
case .structKeyword: return "kw_struct"
702-
case .subscriptKeyword: return "kw_subscript"
703-
case .typealiasKeyword: return "kw_typealias"
704-
case .varKeyword: return "kw_var"
705-
case .fileprivateKeyword: return "kw_fileprivate"
706-
case .internalKeyword: return "kw_internal"
707-
case .privateKeyword: return "kw_private"
708-
case .publicKeyword: return "kw_public"
709-
case .staticKeyword: return "kw_static"
710-
case .deferKeyword: return "kw_defer"
711-
case .ifKeyword: return "kw_if"
712-
case .guardKeyword: return "kw_guard"
713-
case .doKeyword: return "kw_do"
714-
case .repeatKeyword: return "kw_repeat"
715-
case .elseKeyword: return "kw_else"
716-
case .forKeyword: return "kw_for"
717-
case .inKeyword: return "kw_in"
718-
case .whileKeyword: return "kw_while"
719-
case .returnKeyword: return "kw_return"
720-
case .breakKeyword: return "kw_break"
721-
case .continueKeyword: return "kw_continue"
722-
case .fallthroughKeyword: return "kw_fallthrough"
723-
case .switchKeyword: return "kw_switch"
724-
case .caseKeyword: return "kw_case"
725-
case .defaultKeyword: return "kw_default"
726-
case .whereKeyword: return "kw_where"
727-
case .catchKeyword: return "kw_catch"
728-
case .throwKeyword: return "kw_throw"
729-
case .asKeyword: return "kw_as"
730-
case .anyKeyword: return "kw_Any"
731-
case .falseKeyword: return "kw_false"
732-
case .isKeyword: return "kw_is"
733-
case .nilKeyword: return "kw_nil"
734-
case .rethrowsKeyword: return "kw_rethrows"
735-
case .superKeyword: return "kw_super"
736-
case .selfKeyword: return "kw_self"
737-
case .capitalSelfKeyword: return "kw_Self"
738-
case .trueKeyword: return "kw_true"
739-
case .tryKeyword: return "kw_try"
740-
case .throwsKeyword: return "kw_throws"
741-
case .wildcardKeyword: return "kw__"
742-
case .leftParen: return "l_paren"
743-
case .rightParen: return "r_paren"
744-
case .leftBrace: return "l_brace"
745-
case .rightBrace: return "r_brace"
746-
case .leftSquareBracket: return "l_square"
747-
case .rightSquareBracket: return "r_square"
748-
case .leftAngle: return "l_angle"
749-
case .rightAngle: return "r_angle"
750-
case .period: return "period"
751-
case .comma: return "comma"
752-
case .ellipsis: return "ellipsis"
753-
case .colon: return "colon"
754-
case .semicolon: return "semi"
755-
case .equal: return "equal"
756-
case .atSign: return "at_sign"
757-
case .pound: return "pound"
758-
case .prefixAmpersand: return "amp_prefix"
759-
case .arrow: return "arrow"
760-
case .backtick: return "backtick"
761-
case .backslash: return "backslash"
762-
case .exclamationMark: return "exclaim_postfix"
763-
case .postfixQuestionMark: return "question_postfix"
764-
case .infixQuestionMark: return "question_infix"
765-
case .stringQuote: return "string_quote"
766-
case .singleQuote: return "single_quote"
767-
case .multilineStringQuote: return "multiline_string_quote"
768-
case .poundKeyPathKeyword: return "pound_keyPath"
769-
case .poundLineKeyword: return "pound_line"
770-
case .poundSelectorKeyword: return "pound_selector"
771-
case .poundFileKeyword: return "pound_file"
772-
case .poundFileIDKeyword: return "pound_fileID"
773-
case .poundFilePathKeyword: return "pound_filePath"
774-
case .poundColumnKeyword: return "pound_column"
775-
case .poundFunctionKeyword: return "pound_function"
776-
case .poundDsohandleKeyword: return "pound_dsohandle"
777-
case .poundAssertKeyword: return "pound_assert"
778-
case .poundSourceLocationKeyword: return "pound_sourceLocation"
779-
case .poundWarningKeyword: return "pound_warning"
780-
case .poundErrorKeyword: return "pound_error"
781-
case .poundIfKeyword: return "pound_if"
782-
case .poundElseKeyword: return "pound_else"
783-
case .poundElseifKeyword: return "pound_elseif"
784-
case .poundEndifKeyword: return "pound_endif"
785-
case .poundAvailableKeyword: return "pound_available"
786-
case .poundUnavailableKeyword: return "pound_unavailable"
787-
case .poundFileLiteralKeyword: return "pound_fileLiteral"
788-
case .poundImageLiteralKeyword: return "pound_imageLiteral"
789-
case .poundColorLiteralKeyword: return "pound_colorLiteral"
790-
case .poundHasSymbolKeyword: return "pound__hasSymbol"
791-
case .integerLiteral(_): return "integer_literal"
792-
case .floatingLiteral(_): return "floating_literal"
793-
case .stringLiteral(_): return "string_literal"
794-
case .regexLiteral(_): return "regex_literal"
795-
case .unknown(_): return "unknown"
796-
case .identifier(_): return "identifier"
797-
case .unspacedBinaryOperator(_): return "oper_binary_unspaced"
798-
case .spacedBinaryOperator(_): return "oper_binary_spaced"
799-
case .postfixOperator(_): return "oper_postfix"
800-
case .prefixOperator(_): return "oper_prefix"
801-
case .dollarIdentifier(_): return "dollarident"
802-
case .contextualKeyword(_): return "contextual_keyword"
803-
case .rawStringDelimiter(_): return "raw_string_delimiter"
804-
case .stringSegment(_): return "string_segment"
805-
case .yield: return "kw_yield"
806-
}
807-
}
808-
809685
var sourceLength: SourceLength {
810686
switch self {
811687
case .eof: return .zero

0 commit comments

Comments
 (0)