Skip to content

Commit fa99e37

Browse files
authored
Merge pull request #1211 from ahoppen/ahoppen/remove-tokenkind-kind
Remove TokenKind.kind
2 parents 8936b6e + 696eee6 commit fa99e37

File tree

2 files changed

+0
-267
lines changed

2 files changed

+0
-267
lines changed

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/TokenKindFile.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -138,30 +138,6 @@ let tokenKindFile = SourceFileSyntax {
138138
}
139139
}
140140

141-
VariableDeclSyntax(
142-
modifiers: [DeclModifierSyntax(name: .public)],
143-
name: IdentifierPatternSyntax("kind"),
144-
type: TypeAnnotationSyntax(type: TypeSyntax("String"))
145-
) {
146-
SwitchStmtSyntax(expression: ExprSyntax("self")) {
147-
SwitchCaseSyntax("case .eof:") {
148-
ReturnStmtSyntax(#"return "eof""#)
149-
}
150-
151-
for token in SYNTAX_TOKENS {
152-
if token.text == nil {
153-
SwitchCaseSyntax("case .\(raw: token.swiftKind)(_):") {
154-
ReturnStmtSyntax("return \"\(raw: token.kind)\"")
155-
}
156-
} else {
157-
SwitchCaseSyntax("case .\(raw: token.swiftKind):") {
158-
ReturnStmtSyntax("return \"\(raw: token.kind)\"")
159-
}
160-
}
161-
}
162-
}
163-
}
164-
165141
VariableDeclSyntax(
166142
modifiers: [DeclModifierSyntax(name: .public)],
167143
name: IdentifierPatternSyntax("sourceLength"),

Sources/SwiftSyntax/generated/TokenKind.swift

Lines changed: 0 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,249 +1145,6 @@ public enum TokenKind: Hashable {
11451145
}
11461146
}
11471147

1148-
public var kind: String {
1149-
switch self {
1150-
case .eof:
1151-
return "eof"
1152-
case .associatedtypeKeyword:
1153-
return "kw_associatedtype"
1154-
case .classKeyword:
1155-
return "kw_class"
1156-
case .deinitKeyword:
1157-
return "kw_deinit"
1158-
case .enumKeyword:
1159-
return "kw_enum"
1160-
case .extensionKeyword:
1161-
return "kw_extension"
1162-
case .funcKeyword:
1163-
return "kw_func"
1164-
case .importKeyword:
1165-
return "kw_import"
1166-
case .initKeyword:
1167-
return "kw_init"
1168-
case .inoutKeyword:
1169-
return "kw_inout"
1170-
case .letKeyword:
1171-
return "kw_let"
1172-
case .operatorKeyword:
1173-
return "kw_operator"
1174-
case .precedencegroupKeyword:
1175-
return "kw_precedencegroup"
1176-
case .protocolKeyword:
1177-
return "kw_protocol"
1178-
case .structKeyword:
1179-
return "kw_struct"
1180-
case .subscriptKeyword:
1181-
return "kw_subscript"
1182-
case .typealiasKeyword:
1183-
return "kw_typealias"
1184-
case .varKeyword:
1185-
return "kw_var"
1186-
case .fileprivateKeyword:
1187-
return "kw_fileprivate"
1188-
case .internalKeyword:
1189-
return "kw_internal"
1190-
case .privateKeyword:
1191-
return "kw_private"
1192-
case .publicKeyword:
1193-
return "kw_public"
1194-
case .staticKeyword:
1195-
return "kw_static"
1196-
case .deferKeyword:
1197-
return "kw_defer"
1198-
case .ifKeyword:
1199-
return "kw_if"
1200-
case .guardKeyword:
1201-
return "kw_guard"
1202-
case .doKeyword:
1203-
return "kw_do"
1204-
case .repeatKeyword:
1205-
return "kw_repeat"
1206-
case .elseKeyword:
1207-
return "kw_else"
1208-
case .forKeyword:
1209-
return "kw_for"
1210-
case .inKeyword:
1211-
return "kw_in"
1212-
case .whileKeyword:
1213-
return "kw_while"
1214-
case .returnKeyword:
1215-
return "kw_return"
1216-
case .breakKeyword:
1217-
return "kw_break"
1218-
case .continueKeyword:
1219-
return "kw_continue"
1220-
case .fallthroughKeyword:
1221-
return "kw_fallthrough"
1222-
case .switchKeyword:
1223-
return "kw_switch"
1224-
case .caseKeyword:
1225-
return "kw_case"
1226-
case .defaultKeyword:
1227-
return "kw_default"
1228-
case .whereKeyword:
1229-
return "kw_where"
1230-
case .catchKeyword:
1231-
return "kw_catch"
1232-
case .throwKeyword:
1233-
return "kw_throw"
1234-
case .asKeyword:
1235-
return "kw_as"
1236-
case .anyKeyword:
1237-
return "kw_Any"
1238-
case .falseKeyword:
1239-
return "kw_false"
1240-
case .isKeyword:
1241-
return "kw_is"
1242-
case .nilKeyword:
1243-
return "kw_nil"
1244-
case .rethrowsKeyword:
1245-
return "kw_rethrows"
1246-
case .superKeyword:
1247-
return "kw_super"
1248-
case .selfKeyword:
1249-
return "kw_self"
1250-
case .capitalSelfKeyword:
1251-
return "kw_Self"
1252-
case .trueKeyword:
1253-
return "kw_true"
1254-
case .tryKeyword:
1255-
return "kw_try"
1256-
case .throwsKeyword:
1257-
return "kw_throws"
1258-
case .wildcardKeyword:
1259-
return "kw__"
1260-
case .leftParen:
1261-
return "l_paren"
1262-
case .rightParen:
1263-
return "r_paren"
1264-
case .leftBrace:
1265-
return "l_brace"
1266-
case .rightBrace:
1267-
return "r_brace"
1268-
case .leftSquareBracket:
1269-
return "l_square"
1270-
case .rightSquareBracket:
1271-
return "r_square"
1272-
case .leftAngle:
1273-
return "l_angle"
1274-
case .rightAngle:
1275-
return "r_angle"
1276-
case .period:
1277-
return "period"
1278-
case .comma:
1279-
return "comma"
1280-
case .ellipsis:
1281-
return "ellipsis"
1282-
case .colon:
1283-
return "colon"
1284-
case .semicolon:
1285-
return "semi"
1286-
case .equal:
1287-
return "equal"
1288-
case .atSign:
1289-
return "at_sign"
1290-
case .pound:
1291-
return "pound"
1292-
case .prefixAmpersand:
1293-
return "amp_prefix"
1294-
case .arrow:
1295-
return "arrow"
1296-
case .backtick:
1297-
return "backtick"
1298-
case .backslash:
1299-
return "backslash"
1300-
case .exclamationMark:
1301-
return "exclaim_postfix"
1302-
case .postfixQuestionMark:
1303-
return "question_postfix"
1304-
case .infixQuestionMark:
1305-
return "question_infix"
1306-
case .stringQuote:
1307-
return "string_quote"
1308-
case .singleQuote:
1309-
return "single_quote"
1310-
case .multilineStringQuote:
1311-
return "multiline_string_quote"
1312-
case .poundKeyPathKeyword:
1313-
return "pound_pound_keyPath"
1314-
case .poundLineKeyword:
1315-
return "pound_pound_line"
1316-
case .poundSelectorKeyword:
1317-
return "pound_pound_selector"
1318-
case .poundFileKeyword:
1319-
return "pound_pound_file"
1320-
case .poundFileIDKeyword:
1321-
return "pound_pound_fileID"
1322-
case .poundFilePathKeyword:
1323-
return "pound_pound_filePath"
1324-
case .poundColumnKeyword:
1325-
return "pound_pound_column"
1326-
case .poundFunctionKeyword:
1327-
return "pound_pound_function"
1328-
case .poundDsohandleKeyword:
1329-
return "pound_pound_dsohandle"
1330-
case .poundAssertKeyword:
1331-
return "pound_pound_assert"
1332-
case .poundSourceLocationKeyword:
1333-
return "pound_pound_sourceLocation"
1334-
case .poundWarningKeyword:
1335-
return "pound_pound_warning"
1336-
case .poundErrorKeyword:
1337-
return "pound_pound_error"
1338-
case .poundIfKeyword:
1339-
return "pound_pound_if"
1340-
case .poundElseKeyword:
1341-
return "pound_pound_else"
1342-
case .poundElseifKeyword:
1343-
return "pound_pound_elseif"
1344-
case .poundEndifKeyword:
1345-
return "pound_pound_endif"
1346-
case .poundAvailableKeyword:
1347-
return "pound_pound_available"
1348-
case .poundUnavailableKeyword:
1349-
return "pound_pound_unavailable"
1350-
case .poundFileLiteralKeyword:
1351-
return "pound_pound_fileLiteral"
1352-
case .poundImageLiteralKeyword:
1353-
return "pound_pound_imageLiteral"
1354-
case .poundColorLiteralKeyword:
1355-
return "pound_pound_colorLiteral"
1356-
case .poundHasSymbolKeyword:
1357-
return "pound_pound__hasSymbol"
1358-
case .integerLiteral(_ ):
1359-
return "integer_literal"
1360-
case .floatingLiteral(_ ):
1361-
return "floating_literal"
1362-
case .stringLiteral(_ ):
1363-
return "string_literal"
1364-
case .regexLiteral(_ ):
1365-
return "regex_literal"
1366-
case .unknown(_ ):
1367-
return "unknown"
1368-
case .identifier(_ ):
1369-
return "identifier"
1370-
case .unspacedBinaryOperator(_ ):
1371-
return "oper_binary_unspaced"
1372-
case .spacedBinaryOperator(_ ):
1373-
return "oper_binary_spaced"
1374-
case .postfixOperator(_ ):
1375-
return "oper_postfix"
1376-
case .prefixOperator(_ ):
1377-
return "oper_prefix"
1378-
case .dollarIdentifier(_ ):
1379-
return "dollarident"
1380-
case .contextualKeyword(_ ):
1381-
return "contextual_keyword"
1382-
case .rawStringDelimiter(_ ):
1383-
return "raw_string_delimiter"
1384-
case .stringSegment(_ ):
1385-
return "string_segment"
1386-
case .yield:
1387-
return "kw_yield"
1388-
}
1389-
}
1390-
13911148
public var sourceLength: SourceLength {
13921149
switch self {
13931150
case .eof:

0 commit comments

Comments
 (0)