aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated/tokens.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/generated/tokens.rs')
-rw-r--r--crates/ra_syntax/src/ast/generated/tokens.rs916
1 files changed, 2 insertions, 914 deletions
diff --git a/crates/ra_syntax/src/ast/generated/tokens.rs b/crates/ra_syntax/src/ast/generated/tokens.rs
index e64b8bce6..7344b0e49 100644
--- a/crates/ra_syntax/src/ast/generated/tokens.rs
+++ b/crates/ra_syntax/src/ast/generated/tokens.rs
@@ -1046,906 +1046,6 @@ impl AstToken for Shreq {
1046 fn syntax(&self) -> &SyntaxToken { &self.syntax } 1046 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1047} 1047}
1048#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1048#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1049pub struct AsKw {
1050 pub(crate) syntax: SyntaxToken,
1051}
1052impl std::fmt::Display for AsKw {
1053 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1054 std::fmt::Display::fmt(&self.syntax, f)
1055 }
1056}
1057impl AstToken for AsKw {
1058 fn can_cast(kind: SyntaxKind) -> bool { kind == AS_KW }
1059 fn cast(syntax: SyntaxToken) -> Option<Self> {
1060 if Self::can_cast(syntax.kind()) {
1061 Some(Self { syntax })
1062 } else {
1063 None
1064 }
1065 }
1066 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1067}
1068#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1069pub struct AsyncKw {
1070 pub(crate) syntax: SyntaxToken,
1071}
1072impl std::fmt::Display for AsyncKw {
1073 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1074 std::fmt::Display::fmt(&self.syntax, f)
1075 }
1076}
1077impl AstToken for AsyncKw {
1078 fn can_cast(kind: SyntaxKind) -> bool { kind == ASYNC_KW }
1079 fn cast(syntax: SyntaxToken) -> Option<Self> {
1080 if Self::can_cast(syntax.kind()) {
1081 Some(Self { syntax })
1082 } else {
1083 None
1084 }
1085 }
1086 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1087}
1088#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1089pub struct AwaitKw {
1090 pub(crate) syntax: SyntaxToken,
1091}
1092impl std::fmt::Display for AwaitKw {
1093 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1094 std::fmt::Display::fmt(&self.syntax, f)
1095 }
1096}
1097impl AstToken for AwaitKw {
1098 fn can_cast(kind: SyntaxKind) -> bool { kind == AWAIT_KW }
1099 fn cast(syntax: SyntaxToken) -> Option<Self> {
1100 if Self::can_cast(syntax.kind()) {
1101 Some(Self { syntax })
1102 } else {
1103 None
1104 }
1105 }
1106 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1107}
1108#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1109pub struct BoxKw {
1110 pub(crate) syntax: SyntaxToken,
1111}
1112impl std::fmt::Display for BoxKw {
1113 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1114 std::fmt::Display::fmt(&self.syntax, f)
1115 }
1116}
1117impl AstToken for BoxKw {
1118 fn can_cast(kind: SyntaxKind) -> bool { kind == BOX_KW }
1119 fn cast(syntax: SyntaxToken) -> Option<Self> {
1120 if Self::can_cast(syntax.kind()) {
1121 Some(Self { syntax })
1122 } else {
1123 None
1124 }
1125 }
1126 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1127}
1128#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1129pub struct BreakKw {
1130 pub(crate) syntax: SyntaxToken,
1131}
1132impl std::fmt::Display for BreakKw {
1133 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1134 std::fmt::Display::fmt(&self.syntax, f)
1135 }
1136}
1137impl AstToken for BreakKw {
1138 fn can_cast(kind: SyntaxKind) -> bool { kind == BREAK_KW }
1139 fn cast(syntax: SyntaxToken) -> Option<Self> {
1140 if Self::can_cast(syntax.kind()) {
1141 Some(Self { syntax })
1142 } else {
1143 None
1144 }
1145 }
1146 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1147}
1148#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1149pub struct ConstKw {
1150 pub(crate) syntax: SyntaxToken,
1151}
1152impl std::fmt::Display for ConstKw {
1153 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1154 std::fmt::Display::fmt(&self.syntax, f)
1155 }
1156}
1157impl AstToken for ConstKw {
1158 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_KW }
1159 fn cast(syntax: SyntaxToken) -> Option<Self> {
1160 if Self::can_cast(syntax.kind()) {
1161 Some(Self { syntax })
1162 } else {
1163 None
1164 }
1165 }
1166 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1167}
1168#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1169pub struct ContinueKw {
1170 pub(crate) syntax: SyntaxToken,
1171}
1172impl std::fmt::Display for ContinueKw {
1173 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1174 std::fmt::Display::fmt(&self.syntax, f)
1175 }
1176}
1177impl AstToken for ContinueKw {
1178 fn can_cast(kind: SyntaxKind) -> bool { kind == CONTINUE_KW }
1179 fn cast(syntax: SyntaxToken) -> Option<Self> {
1180 if Self::can_cast(syntax.kind()) {
1181 Some(Self { syntax })
1182 } else {
1183 None
1184 }
1185 }
1186 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1187}
1188#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1189pub struct CrateKw {
1190 pub(crate) syntax: SyntaxToken,
1191}
1192impl std::fmt::Display for CrateKw {
1193 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1194 std::fmt::Display::fmt(&self.syntax, f)
1195 }
1196}
1197impl AstToken for CrateKw {
1198 fn can_cast(kind: SyntaxKind) -> bool { kind == CRATE_KW }
1199 fn cast(syntax: SyntaxToken) -> Option<Self> {
1200 if Self::can_cast(syntax.kind()) {
1201 Some(Self { syntax })
1202 } else {
1203 None
1204 }
1205 }
1206 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1207}
1208#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1209pub struct DynKw {
1210 pub(crate) syntax: SyntaxToken,
1211}
1212impl std::fmt::Display for DynKw {
1213 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1214 std::fmt::Display::fmt(&self.syntax, f)
1215 }
1216}
1217impl AstToken for DynKw {
1218 fn can_cast(kind: SyntaxKind) -> bool { kind == DYN_KW }
1219 fn cast(syntax: SyntaxToken) -> Option<Self> {
1220 if Self::can_cast(syntax.kind()) {
1221 Some(Self { syntax })
1222 } else {
1223 None
1224 }
1225 }
1226 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1227}
1228#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1229pub struct ElseKw {
1230 pub(crate) syntax: SyntaxToken,
1231}
1232impl std::fmt::Display for ElseKw {
1233 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1234 std::fmt::Display::fmt(&self.syntax, f)
1235 }
1236}
1237impl AstToken for ElseKw {
1238 fn can_cast(kind: SyntaxKind) -> bool { kind == ELSE_KW }
1239 fn cast(syntax: SyntaxToken) -> Option<Self> {
1240 if Self::can_cast(syntax.kind()) {
1241 Some(Self { syntax })
1242 } else {
1243 None
1244 }
1245 }
1246 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1247}
1248#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1249pub struct EnumKw {
1250 pub(crate) syntax: SyntaxToken,
1251}
1252impl std::fmt::Display for EnumKw {
1253 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1254 std::fmt::Display::fmt(&self.syntax, f)
1255 }
1256}
1257impl AstToken for EnumKw {
1258 fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_KW }
1259 fn cast(syntax: SyntaxToken) -> Option<Self> {
1260 if Self::can_cast(syntax.kind()) {
1261 Some(Self { syntax })
1262 } else {
1263 None
1264 }
1265 }
1266 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1267}
1268#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1269pub struct ExternKw {
1270 pub(crate) syntax: SyntaxToken,
1271}
1272impl std::fmt::Display for ExternKw {
1273 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1274 std::fmt::Display::fmt(&self.syntax, f)
1275 }
1276}
1277impl AstToken for ExternKw {
1278 fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_KW }
1279 fn cast(syntax: SyntaxToken) -> Option<Self> {
1280 if Self::can_cast(syntax.kind()) {
1281 Some(Self { syntax })
1282 } else {
1283 None
1284 }
1285 }
1286 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1287}
1288#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1289pub struct FalseKw {
1290 pub(crate) syntax: SyntaxToken,
1291}
1292impl std::fmt::Display for FalseKw {
1293 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1294 std::fmt::Display::fmt(&self.syntax, f)
1295 }
1296}
1297impl AstToken for FalseKw {
1298 fn can_cast(kind: SyntaxKind) -> bool { kind == FALSE_KW }
1299 fn cast(syntax: SyntaxToken) -> Option<Self> {
1300 if Self::can_cast(syntax.kind()) {
1301 Some(Self { syntax })
1302 } else {
1303 None
1304 }
1305 }
1306 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1307}
1308#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1309pub struct FnKw {
1310 pub(crate) syntax: SyntaxToken,
1311}
1312impl std::fmt::Display for FnKw {
1313 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1314 std::fmt::Display::fmt(&self.syntax, f)
1315 }
1316}
1317impl AstToken for FnKw {
1318 fn can_cast(kind: SyntaxKind) -> bool { kind == FN_KW }
1319 fn cast(syntax: SyntaxToken) -> Option<Self> {
1320 if Self::can_cast(syntax.kind()) {
1321 Some(Self { syntax })
1322 } else {
1323 None
1324 }
1325 }
1326 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1327}
1328#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1329pub struct ForKw {
1330 pub(crate) syntax: SyntaxToken,
1331}
1332impl std::fmt::Display for ForKw {
1333 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1334 std::fmt::Display::fmt(&self.syntax, f)
1335 }
1336}
1337impl AstToken for ForKw {
1338 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_KW }
1339 fn cast(syntax: SyntaxToken) -> Option<Self> {
1340 if Self::can_cast(syntax.kind()) {
1341 Some(Self { syntax })
1342 } else {
1343 None
1344 }
1345 }
1346 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1347}
1348#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1349pub struct IfKw {
1350 pub(crate) syntax: SyntaxToken,
1351}
1352impl std::fmt::Display for IfKw {
1353 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1354 std::fmt::Display::fmt(&self.syntax, f)
1355 }
1356}
1357impl AstToken for IfKw {
1358 fn can_cast(kind: SyntaxKind) -> bool { kind == IF_KW }
1359 fn cast(syntax: SyntaxToken) -> Option<Self> {
1360 if Self::can_cast(syntax.kind()) {
1361 Some(Self { syntax })
1362 } else {
1363 None
1364 }
1365 }
1366 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1367}
1368#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1369pub struct ImplKw {
1370 pub(crate) syntax: SyntaxToken,
1371}
1372impl std::fmt::Display for ImplKw {
1373 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1374 std::fmt::Display::fmt(&self.syntax, f)
1375 }
1376}
1377impl AstToken for ImplKw {
1378 fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_KW }
1379 fn cast(syntax: SyntaxToken) -> Option<Self> {
1380 if Self::can_cast(syntax.kind()) {
1381 Some(Self { syntax })
1382 } else {
1383 None
1384 }
1385 }
1386 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1387}
1388#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1389pub struct InKw {
1390 pub(crate) syntax: SyntaxToken,
1391}
1392impl std::fmt::Display for InKw {
1393 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1394 std::fmt::Display::fmt(&self.syntax, f)
1395 }
1396}
1397impl AstToken for InKw {
1398 fn can_cast(kind: SyntaxKind) -> bool { kind == IN_KW }
1399 fn cast(syntax: SyntaxToken) -> Option<Self> {
1400 if Self::can_cast(syntax.kind()) {
1401 Some(Self { syntax })
1402 } else {
1403 None
1404 }
1405 }
1406 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1407}
1408#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1409pub struct LetKw {
1410 pub(crate) syntax: SyntaxToken,
1411}
1412impl std::fmt::Display for LetKw {
1413 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1414 std::fmt::Display::fmt(&self.syntax, f)
1415 }
1416}
1417impl AstToken for LetKw {
1418 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_KW }
1419 fn cast(syntax: SyntaxToken) -> Option<Self> {
1420 if Self::can_cast(syntax.kind()) {
1421 Some(Self { syntax })
1422 } else {
1423 None
1424 }
1425 }
1426 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1427}
1428#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1429pub struct LoopKw {
1430 pub(crate) syntax: SyntaxToken,
1431}
1432impl std::fmt::Display for LoopKw {
1433 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1434 std::fmt::Display::fmt(&self.syntax, f)
1435 }
1436}
1437impl AstToken for LoopKw {
1438 fn can_cast(kind: SyntaxKind) -> bool { kind == LOOP_KW }
1439 fn cast(syntax: SyntaxToken) -> Option<Self> {
1440 if Self::can_cast(syntax.kind()) {
1441 Some(Self { syntax })
1442 } else {
1443 None
1444 }
1445 }
1446 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1447}
1448#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1449pub struct MacroKw {
1450 pub(crate) syntax: SyntaxToken,
1451}
1452impl std::fmt::Display for MacroKw {
1453 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1454 std::fmt::Display::fmt(&self.syntax, f)
1455 }
1456}
1457impl AstToken for MacroKw {
1458 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_KW }
1459 fn cast(syntax: SyntaxToken) -> Option<Self> {
1460 if Self::can_cast(syntax.kind()) {
1461 Some(Self { syntax })
1462 } else {
1463 None
1464 }
1465 }
1466 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1467}
1468#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1469pub struct MatchKw {
1470 pub(crate) syntax: SyntaxToken,
1471}
1472impl std::fmt::Display for MatchKw {
1473 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1474 std::fmt::Display::fmt(&self.syntax, f)
1475 }
1476}
1477impl AstToken for MatchKw {
1478 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_KW }
1479 fn cast(syntax: SyntaxToken) -> Option<Self> {
1480 if Self::can_cast(syntax.kind()) {
1481 Some(Self { syntax })
1482 } else {
1483 None
1484 }
1485 }
1486 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1487}
1488#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1489pub struct ModKw {
1490 pub(crate) syntax: SyntaxToken,
1491}
1492impl std::fmt::Display for ModKw {
1493 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1494 std::fmt::Display::fmt(&self.syntax, f)
1495 }
1496}
1497impl AstToken for ModKw {
1498 fn can_cast(kind: SyntaxKind) -> bool { kind == MOD_KW }
1499 fn cast(syntax: SyntaxToken) -> Option<Self> {
1500 if Self::can_cast(syntax.kind()) {
1501 Some(Self { syntax })
1502 } else {
1503 None
1504 }
1505 }
1506 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1507}
1508#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1509pub struct MoveKw {
1510 pub(crate) syntax: SyntaxToken,
1511}
1512impl std::fmt::Display for MoveKw {
1513 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1514 std::fmt::Display::fmt(&self.syntax, f)
1515 }
1516}
1517impl AstToken for MoveKw {
1518 fn can_cast(kind: SyntaxKind) -> bool { kind == MOVE_KW }
1519 fn cast(syntax: SyntaxToken) -> Option<Self> {
1520 if Self::can_cast(syntax.kind()) {
1521 Some(Self { syntax })
1522 } else {
1523 None
1524 }
1525 }
1526 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1527}
1528#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1529pub struct MutKw {
1530 pub(crate) syntax: SyntaxToken,
1531}
1532impl std::fmt::Display for MutKw {
1533 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1534 std::fmt::Display::fmt(&self.syntax, f)
1535 }
1536}
1537impl AstToken for MutKw {
1538 fn can_cast(kind: SyntaxKind) -> bool { kind == MUT_KW }
1539 fn cast(syntax: SyntaxToken) -> Option<Self> {
1540 if Self::can_cast(syntax.kind()) {
1541 Some(Self { syntax })
1542 } else {
1543 None
1544 }
1545 }
1546 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1547}
1548#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1549pub struct PubKw {
1550 pub(crate) syntax: SyntaxToken,
1551}
1552impl std::fmt::Display for PubKw {
1553 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1554 std::fmt::Display::fmt(&self.syntax, f)
1555 }
1556}
1557impl AstToken for PubKw {
1558 fn can_cast(kind: SyntaxKind) -> bool { kind == PUB_KW }
1559 fn cast(syntax: SyntaxToken) -> Option<Self> {
1560 if Self::can_cast(syntax.kind()) {
1561 Some(Self { syntax })
1562 } else {
1563 None
1564 }
1565 }
1566 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1567}
1568#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1569pub struct RefKw {
1570 pub(crate) syntax: SyntaxToken,
1571}
1572impl std::fmt::Display for RefKw {
1573 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1574 std::fmt::Display::fmt(&self.syntax, f)
1575 }
1576}
1577impl AstToken for RefKw {
1578 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_KW }
1579 fn cast(syntax: SyntaxToken) -> Option<Self> {
1580 if Self::can_cast(syntax.kind()) {
1581 Some(Self { syntax })
1582 } else {
1583 None
1584 }
1585 }
1586 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1587}
1588#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1589pub struct ReturnKw {
1590 pub(crate) syntax: SyntaxToken,
1591}
1592impl std::fmt::Display for ReturnKw {
1593 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1594 std::fmt::Display::fmt(&self.syntax, f)
1595 }
1596}
1597impl AstToken for ReturnKw {
1598 fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_KW }
1599 fn cast(syntax: SyntaxToken) -> Option<Self> {
1600 if Self::can_cast(syntax.kind()) {
1601 Some(Self { syntax })
1602 } else {
1603 None
1604 }
1605 }
1606 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1607}
1608#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1609pub struct SelfKw {
1610 pub(crate) syntax: SyntaxToken,
1611}
1612impl std::fmt::Display for SelfKw {
1613 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1614 std::fmt::Display::fmt(&self.syntax, f)
1615 }
1616}
1617impl AstToken for SelfKw {
1618 fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_KW }
1619 fn cast(syntax: SyntaxToken) -> Option<Self> {
1620 if Self::can_cast(syntax.kind()) {
1621 Some(Self { syntax })
1622 } else {
1623 None
1624 }
1625 }
1626 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1627}
1628#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1629pub struct StaticKw {
1630 pub(crate) syntax: SyntaxToken,
1631}
1632impl std::fmt::Display for StaticKw {
1633 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1634 std::fmt::Display::fmt(&self.syntax, f)
1635 }
1636}
1637impl AstToken for StaticKw {
1638 fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC_KW }
1639 fn cast(syntax: SyntaxToken) -> Option<Self> {
1640 if Self::can_cast(syntax.kind()) {
1641 Some(Self { syntax })
1642 } else {
1643 None
1644 }
1645 }
1646 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1647}
1648#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1649pub struct StructKw {
1650 pub(crate) syntax: SyntaxToken,
1651}
1652impl std::fmt::Display for StructKw {
1653 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1654 std::fmt::Display::fmt(&self.syntax, f)
1655 }
1656}
1657impl AstToken for StructKw {
1658 fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT_KW }
1659 fn cast(syntax: SyntaxToken) -> Option<Self> {
1660 if Self::can_cast(syntax.kind()) {
1661 Some(Self { syntax })
1662 } else {
1663 None
1664 }
1665 }
1666 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1667}
1668#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1669pub struct SuperKw {
1670 pub(crate) syntax: SyntaxToken,
1671}
1672impl std::fmt::Display for SuperKw {
1673 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1674 std::fmt::Display::fmt(&self.syntax, f)
1675 }
1676}
1677impl AstToken for SuperKw {
1678 fn can_cast(kind: SyntaxKind) -> bool { kind == SUPER_KW }
1679 fn cast(syntax: SyntaxToken) -> Option<Self> {
1680 if Self::can_cast(syntax.kind()) {
1681 Some(Self { syntax })
1682 } else {
1683 None
1684 }
1685 }
1686 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1687}
1688#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1689pub struct TraitKw {
1690 pub(crate) syntax: SyntaxToken,
1691}
1692impl std::fmt::Display for TraitKw {
1693 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1694 std::fmt::Display::fmt(&self.syntax, f)
1695 }
1696}
1697impl AstToken for TraitKw {
1698 fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT_KW }
1699 fn cast(syntax: SyntaxToken) -> Option<Self> {
1700 if Self::can_cast(syntax.kind()) {
1701 Some(Self { syntax })
1702 } else {
1703 None
1704 }
1705 }
1706 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1707}
1708#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1709pub struct TrueKw {
1710 pub(crate) syntax: SyntaxToken,
1711}
1712impl std::fmt::Display for TrueKw {
1713 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1714 std::fmt::Display::fmt(&self.syntax, f)
1715 }
1716}
1717impl AstToken for TrueKw {
1718 fn can_cast(kind: SyntaxKind) -> bool { kind == TRUE_KW }
1719 fn cast(syntax: SyntaxToken) -> Option<Self> {
1720 if Self::can_cast(syntax.kind()) {
1721 Some(Self { syntax })
1722 } else {
1723 None
1724 }
1725 }
1726 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1727}
1728#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1729pub struct TryKw {
1730 pub(crate) syntax: SyntaxToken,
1731}
1732impl std::fmt::Display for TryKw {
1733 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1734 std::fmt::Display::fmt(&self.syntax, f)
1735 }
1736}
1737impl AstToken for TryKw {
1738 fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_KW }
1739 fn cast(syntax: SyntaxToken) -> Option<Self> {
1740 if Self::can_cast(syntax.kind()) {
1741 Some(Self { syntax })
1742 } else {
1743 None
1744 }
1745 }
1746 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1747}
1748#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1749pub struct TypeKw {
1750 pub(crate) syntax: SyntaxToken,
1751}
1752impl std::fmt::Display for TypeKw {
1753 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1754 std::fmt::Display::fmt(&self.syntax, f)
1755 }
1756}
1757impl AstToken for TypeKw {
1758 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_KW }
1759 fn cast(syntax: SyntaxToken) -> Option<Self> {
1760 if Self::can_cast(syntax.kind()) {
1761 Some(Self { syntax })
1762 } else {
1763 None
1764 }
1765 }
1766 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1767}
1768#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1769pub struct UnsafeKw {
1770 pub(crate) syntax: SyntaxToken,
1771}
1772impl std::fmt::Display for UnsafeKw {
1773 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1774 std::fmt::Display::fmt(&self.syntax, f)
1775 }
1776}
1777impl AstToken for UnsafeKw {
1778 fn can_cast(kind: SyntaxKind) -> bool { kind == UNSAFE_KW }
1779 fn cast(syntax: SyntaxToken) -> Option<Self> {
1780 if Self::can_cast(syntax.kind()) {
1781 Some(Self { syntax })
1782 } else {
1783 None
1784 }
1785 }
1786 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1787}
1788#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1789pub struct UseKw {
1790 pub(crate) syntax: SyntaxToken,
1791}
1792impl std::fmt::Display for UseKw {
1793 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1794 std::fmt::Display::fmt(&self.syntax, f)
1795 }
1796}
1797impl AstToken for UseKw {
1798 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_KW }
1799 fn cast(syntax: SyntaxToken) -> Option<Self> {
1800 if Self::can_cast(syntax.kind()) {
1801 Some(Self { syntax })
1802 } else {
1803 None
1804 }
1805 }
1806 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1807}
1808#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1809pub struct WhereKw {
1810 pub(crate) syntax: SyntaxToken,
1811}
1812impl std::fmt::Display for WhereKw {
1813 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1814 std::fmt::Display::fmt(&self.syntax, f)
1815 }
1816}
1817impl AstToken for WhereKw {
1818 fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_KW }
1819 fn cast(syntax: SyntaxToken) -> Option<Self> {
1820 if Self::can_cast(syntax.kind()) {
1821 Some(Self { syntax })
1822 } else {
1823 None
1824 }
1825 }
1826 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1827}
1828#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1829pub struct WhileKw {
1830 pub(crate) syntax: SyntaxToken,
1831}
1832impl std::fmt::Display for WhileKw {
1833 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1834 std::fmt::Display::fmt(&self.syntax, f)
1835 }
1836}
1837impl AstToken for WhileKw {
1838 fn can_cast(kind: SyntaxKind) -> bool { kind == WHILE_KW }
1839 fn cast(syntax: SyntaxToken) -> Option<Self> {
1840 if Self::can_cast(syntax.kind()) {
1841 Some(Self { syntax })
1842 } else {
1843 None
1844 }
1845 }
1846 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1847}
1848#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1849pub struct AutoKw {
1850 pub(crate) syntax: SyntaxToken,
1851}
1852impl std::fmt::Display for AutoKw {
1853 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1854 std::fmt::Display::fmt(&self.syntax, f)
1855 }
1856}
1857impl AstToken for AutoKw {
1858 fn can_cast(kind: SyntaxKind) -> bool { kind == AUTO_KW }
1859 fn cast(syntax: SyntaxToken) -> Option<Self> {
1860 if Self::can_cast(syntax.kind()) {
1861 Some(Self { syntax })
1862 } else {
1863 None
1864 }
1865 }
1866 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1867}
1868#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1869pub struct DefaultKw {
1870 pub(crate) syntax: SyntaxToken,
1871}
1872impl std::fmt::Display for DefaultKw {
1873 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1874 std::fmt::Display::fmt(&self.syntax, f)
1875 }
1876}
1877impl AstToken for DefaultKw {
1878 fn can_cast(kind: SyntaxKind) -> bool { kind == DEFAULT_KW }
1879 fn cast(syntax: SyntaxToken) -> Option<Self> {
1880 if Self::can_cast(syntax.kind()) {
1881 Some(Self { syntax })
1882 } else {
1883 None
1884 }
1885 }
1886 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1887}
1888#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1889pub struct ExistentialKw {
1890 pub(crate) syntax: SyntaxToken,
1891}
1892impl std::fmt::Display for ExistentialKw {
1893 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1894 std::fmt::Display::fmt(&self.syntax, f)
1895 }
1896}
1897impl AstToken for ExistentialKw {
1898 fn can_cast(kind: SyntaxKind) -> bool { kind == EXISTENTIAL_KW }
1899 fn cast(syntax: SyntaxToken) -> Option<Self> {
1900 if Self::can_cast(syntax.kind()) {
1901 Some(Self { syntax })
1902 } else {
1903 None
1904 }
1905 }
1906 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1907}
1908#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1909pub struct UnionKw {
1910 pub(crate) syntax: SyntaxToken,
1911}
1912impl std::fmt::Display for UnionKw {
1913 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1914 std::fmt::Display::fmt(&self.syntax, f)
1915 }
1916}
1917impl AstToken for UnionKw {
1918 fn can_cast(kind: SyntaxKind) -> bool { kind == UNION_KW }
1919 fn cast(syntax: SyntaxToken) -> Option<Self> {
1920 if Self::can_cast(syntax.kind()) {
1921 Some(Self { syntax })
1922 } else {
1923 None
1924 }
1925 }
1926 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1927}
1928#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1929pub struct RawKw {
1930 pub(crate) syntax: SyntaxToken,
1931}
1932impl std::fmt::Display for RawKw {
1933 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1934 std::fmt::Display::fmt(&self.syntax, f)
1935 }
1936}
1937impl AstToken for RawKw {
1938 fn can_cast(kind: SyntaxKind) -> bool { kind == RAW_KW }
1939 fn cast(syntax: SyntaxToken) -> Option<Self> {
1940 if Self::can_cast(syntax.kind()) {
1941 Some(Self { syntax })
1942 } else {
1943 None
1944 }
1945 }
1946 fn syntax(&self) -> &SyntaxToken { &self.syntax }
1947}
1948#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1949pub struct IntNumber { 1049pub struct IntNumber {
1950 pub(crate) syntax: SyntaxToken, 1050 pub(crate) syntax: SyntaxToken,
1951} 1051}
@@ -2687,8 +1787,6 @@ pub enum LiteralToken {
2687 FloatNumber(FloatNumber), 1787 FloatNumber(FloatNumber),
2688 String(String), 1788 String(String),
2689 RawString(RawString), 1789 RawString(RawString),
2690 TrueKw(TrueKw),
2691 FalseKw(FalseKw),
2692 ByteString(ByteString), 1790 ByteString(ByteString),
2693 RawByteString(RawByteString), 1791 RawByteString(RawByteString),
2694 Char(Char), 1792 Char(Char),
@@ -2706,12 +1804,6 @@ impl From<String> for LiteralToken {
2706impl From<RawString> for LiteralToken { 1804impl From<RawString> for LiteralToken {
2707 fn from(node: RawString) -> LiteralToken { LiteralToken::RawString(node) } 1805 fn from(node: RawString) -> LiteralToken { LiteralToken::RawString(node) }
2708} 1806}
2709impl From<TrueKw> for LiteralToken {
2710 fn from(node: TrueKw) -> LiteralToken { LiteralToken::TrueKw(node) }
2711}
2712impl From<FalseKw> for LiteralToken {
2713 fn from(node: FalseKw) -> LiteralToken { LiteralToken::FalseKw(node) }
2714}
2715impl From<ByteString> for LiteralToken { 1807impl From<ByteString> for LiteralToken {
2716 fn from(node: ByteString) -> LiteralToken { LiteralToken::ByteString(node) } 1808 fn from(node: ByteString) -> LiteralToken { LiteralToken::ByteString(node) }
2717} 1809}
@@ -2732,8 +1824,8 @@ impl std::fmt::Display for LiteralToken {
2732impl AstToken for LiteralToken { 1824impl AstToken for LiteralToken {
2733 fn can_cast(kind: SyntaxKind) -> bool { 1825 fn can_cast(kind: SyntaxKind) -> bool {
2734 match kind { 1826 match kind {
2735 INT_NUMBER | FLOAT_NUMBER | STRING | RAW_STRING | TRUE_KW | FALSE_KW | BYTE_STRING 1827 INT_NUMBER | FLOAT_NUMBER | STRING | RAW_STRING | BYTE_STRING | RAW_BYTE_STRING
2736 | RAW_BYTE_STRING | CHAR | BYTE => true, 1828 | CHAR | BYTE => true,
2737 _ => false, 1829 _ => false,
2738 } 1830 }
2739 } 1831 }
@@ -2743,8 +1835,6 @@ impl AstToken for LiteralToken {
2743 FLOAT_NUMBER => LiteralToken::FloatNumber(FloatNumber { syntax }), 1835 FLOAT_NUMBER => LiteralToken::FloatNumber(FloatNumber { syntax }),
2744 STRING => LiteralToken::String(String { syntax }), 1836 STRING => LiteralToken::String(String { syntax }),
2745 RAW_STRING => LiteralToken::RawString(RawString { syntax }), 1837 RAW_STRING => LiteralToken::RawString(RawString { syntax }),
2746 TRUE_KW => LiteralToken::TrueKw(TrueKw { syntax }),
2747 FALSE_KW => LiteralToken::FalseKw(FalseKw { syntax }),
2748 BYTE_STRING => LiteralToken::ByteString(ByteString { syntax }), 1838 BYTE_STRING => LiteralToken::ByteString(ByteString { syntax }),
2749 RAW_BYTE_STRING => LiteralToken::RawByteString(RawByteString { syntax }), 1839 RAW_BYTE_STRING => LiteralToken::RawByteString(RawByteString { syntax }),
2750 CHAR => LiteralToken::Char(Char { syntax }), 1840 CHAR => LiteralToken::Char(Char { syntax }),
@@ -2759,8 +1849,6 @@ impl AstToken for LiteralToken {
2759 LiteralToken::FloatNumber(it) => &it.syntax, 1849 LiteralToken::FloatNumber(it) => &it.syntax,
2760 LiteralToken::String(it) => &it.syntax, 1850 LiteralToken::String(it) => &it.syntax,
2761 LiteralToken::RawString(it) => &it.syntax, 1851 LiteralToken::RawString(it) => &it.syntax,
2762 LiteralToken::TrueKw(it) => &it.syntax,
2763 LiteralToken::FalseKw(it) => &it.syntax,
2764 LiteralToken::ByteString(it) => &it.syntax, 1852 LiteralToken::ByteString(it) => &it.syntax,
2765 LiteralToken::RawByteString(it) => &it.syntax, 1853 LiteralToken::RawByteString(it) => &it.syntax,
2766 LiteralToken::Char(it) => &it.syntax, 1854 LiteralToken::Char(it) => &it.syntax,