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.rs202
1 files changed, 0 insertions, 202 deletions
diff --git a/crates/ra_syntax/src/ast/generated/tokens.rs b/crates/ra_syntax/src/ast/generated/tokens.rs
index 4cbc1d793..7611ce4cb 100644
--- a/crates/ra_syntax/src/ast/generated/tokens.rs
+++ b/crates/ra_syntax/src/ast/generated/tokens.rs
@@ -1410,208 +1410,6 @@ impl AstToken for RangeSeparator {
1410 } 1410 }
1411} 1411}
1412#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1412#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1413pub enum BinOp {
1414 Pipepipe(Pipepipe),
1415 Ampamp(Ampamp),
1416 Eqeq(Eqeq),
1417 Neq(Neq),
1418 Lteq(Lteq),
1419 Gteq(Gteq),
1420 LAngle(LAngle),
1421 RAngle(RAngle),
1422 Plus(Plus),
1423 Star(Star),
1424 Minus(Minus),
1425 Slash(Slash),
1426 Percent(Percent),
1427 Shl(Shl),
1428 Shr(Shr),
1429 Caret(Caret),
1430 Pipe(Pipe),
1431 Amp(Amp),
1432 Eq(Eq),
1433 Pluseq(Pluseq),
1434 Slasheq(Slasheq),
1435 Stareq(Stareq),
1436 Percenteq(Percenteq),
1437 Shreq(Shreq),
1438 Shleq(Shleq),
1439 Minuseq(Minuseq),
1440 Pipeeq(Pipeeq),
1441 Ampeq(Ampeq),
1442 Careteq(Careteq),
1443}
1444impl From<Pipepipe> for BinOp {
1445 fn from(node: Pipepipe) -> BinOp { BinOp::Pipepipe(node) }
1446}
1447impl From<Ampamp> for BinOp {
1448 fn from(node: Ampamp) -> BinOp { BinOp::Ampamp(node) }
1449}
1450impl From<Eqeq> for BinOp {
1451 fn from(node: Eqeq) -> BinOp { BinOp::Eqeq(node) }
1452}
1453impl From<Neq> for BinOp {
1454 fn from(node: Neq) -> BinOp { BinOp::Neq(node) }
1455}
1456impl From<Lteq> for BinOp {
1457 fn from(node: Lteq) -> BinOp { BinOp::Lteq(node) }
1458}
1459impl From<Gteq> for BinOp {
1460 fn from(node: Gteq) -> BinOp { BinOp::Gteq(node) }
1461}
1462impl From<LAngle> for BinOp {
1463 fn from(node: LAngle) -> BinOp { BinOp::LAngle(node) }
1464}
1465impl From<RAngle> for BinOp {
1466 fn from(node: RAngle) -> BinOp { BinOp::RAngle(node) }
1467}
1468impl From<Plus> for BinOp {
1469 fn from(node: Plus) -> BinOp { BinOp::Plus(node) }
1470}
1471impl From<Star> for BinOp {
1472 fn from(node: Star) -> BinOp { BinOp::Star(node) }
1473}
1474impl From<Minus> for BinOp {
1475 fn from(node: Minus) -> BinOp { BinOp::Minus(node) }
1476}
1477impl From<Slash> for BinOp {
1478 fn from(node: Slash) -> BinOp { BinOp::Slash(node) }
1479}
1480impl From<Percent> for BinOp {
1481 fn from(node: Percent) -> BinOp { BinOp::Percent(node) }
1482}
1483impl From<Shl> for BinOp {
1484 fn from(node: Shl) -> BinOp { BinOp::Shl(node) }
1485}
1486impl From<Shr> for BinOp {
1487 fn from(node: Shr) -> BinOp { BinOp::Shr(node) }
1488}
1489impl From<Caret> for BinOp {
1490 fn from(node: Caret) -> BinOp { BinOp::Caret(node) }
1491}
1492impl From<Pipe> for BinOp {
1493 fn from(node: Pipe) -> BinOp { BinOp::Pipe(node) }
1494}
1495impl From<Amp> for BinOp {
1496 fn from(node: Amp) -> BinOp { BinOp::Amp(node) }
1497}
1498impl From<Eq> for BinOp {
1499 fn from(node: Eq) -> BinOp { BinOp::Eq(node) }
1500}
1501impl From<Pluseq> for BinOp {
1502 fn from(node: Pluseq) -> BinOp { BinOp::Pluseq(node) }
1503}
1504impl From<Slasheq> for BinOp {
1505 fn from(node: Slasheq) -> BinOp { BinOp::Slasheq(node) }
1506}
1507impl From<Stareq> for BinOp {
1508 fn from(node: Stareq) -> BinOp { BinOp::Stareq(node) }
1509}
1510impl From<Percenteq> for BinOp {
1511 fn from(node: Percenteq) -> BinOp { BinOp::Percenteq(node) }
1512}
1513impl From<Shreq> for BinOp {
1514 fn from(node: Shreq) -> BinOp { BinOp::Shreq(node) }
1515}
1516impl From<Shleq> for BinOp {
1517 fn from(node: Shleq) -> BinOp { BinOp::Shleq(node) }
1518}
1519impl From<Minuseq> for BinOp {
1520 fn from(node: Minuseq) -> BinOp { BinOp::Minuseq(node) }
1521}
1522impl From<Pipeeq> for BinOp {
1523 fn from(node: Pipeeq) -> BinOp { BinOp::Pipeeq(node) }
1524}
1525impl From<Ampeq> for BinOp {
1526 fn from(node: Ampeq) -> BinOp { BinOp::Ampeq(node) }
1527}
1528impl From<Careteq> for BinOp {
1529 fn from(node: Careteq) -> BinOp { BinOp::Careteq(node) }
1530}
1531impl std::fmt::Display for BinOp {
1532 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1533 std::fmt::Display::fmt(self.syntax(), f)
1534 }
1535}
1536impl AstToken for BinOp {
1537 fn can_cast(kind: SyntaxKind) -> bool {
1538 match kind {
1539 PIPEPIPE | AMPAMP | EQEQ | NEQ | LTEQ | GTEQ | L_ANGLE | R_ANGLE | PLUS | STAR
1540 | MINUS | SLASH | PERCENT | SHL | SHR | CARET | PIPE | AMP | EQ | PLUSEQ | SLASHEQ
1541 | STAREQ | PERCENTEQ | SHREQ | SHLEQ | MINUSEQ | PIPEEQ | AMPEQ | CARETEQ => true,
1542 _ => false,
1543 }
1544 }
1545 fn cast(syntax: SyntaxToken) -> Option<Self> {
1546 let res = match syntax.kind() {
1547 PIPEPIPE => BinOp::Pipepipe(Pipepipe { syntax }),
1548 AMPAMP => BinOp::Ampamp(Ampamp { syntax }),
1549 EQEQ => BinOp::Eqeq(Eqeq { syntax }),
1550 NEQ => BinOp::Neq(Neq { syntax }),
1551 LTEQ => BinOp::Lteq(Lteq { syntax }),
1552 GTEQ => BinOp::Gteq(Gteq { syntax }),
1553 L_ANGLE => BinOp::LAngle(LAngle { syntax }),
1554 R_ANGLE => BinOp::RAngle(RAngle { syntax }),
1555 PLUS => BinOp::Plus(Plus { syntax }),
1556 STAR => BinOp::Star(Star { syntax }),
1557 MINUS => BinOp::Minus(Minus { syntax }),
1558 SLASH => BinOp::Slash(Slash { syntax }),
1559 PERCENT => BinOp::Percent(Percent { syntax }),
1560 SHL => BinOp::Shl(Shl { syntax }),
1561 SHR => BinOp::Shr(Shr { syntax }),
1562 CARET => BinOp::Caret(Caret { syntax }),
1563 PIPE => BinOp::Pipe(Pipe { syntax }),
1564 AMP => BinOp::Amp(Amp { syntax }),
1565 EQ => BinOp::Eq(Eq { syntax }),
1566 PLUSEQ => BinOp::Pluseq(Pluseq { syntax }),
1567 SLASHEQ => BinOp::Slasheq(Slasheq { syntax }),
1568 STAREQ => BinOp::Stareq(Stareq { syntax }),
1569 PERCENTEQ => BinOp::Percenteq(Percenteq { syntax }),
1570 SHREQ => BinOp::Shreq(Shreq { syntax }),
1571 SHLEQ => BinOp::Shleq(Shleq { syntax }),
1572 MINUSEQ => BinOp::Minuseq(Minuseq { syntax }),
1573 PIPEEQ => BinOp::Pipeeq(Pipeeq { syntax }),
1574 AMPEQ => BinOp::Ampeq(Ampeq { syntax }),
1575 CARETEQ => BinOp::Careteq(Careteq { syntax }),
1576 _ => return None,
1577 };
1578 Some(res)
1579 }
1580 fn syntax(&self) -> &SyntaxToken {
1581 match self {
1582 BinOp::Pipepipe(it) => &it.syntax,
1583 BinOp::Ampamp(it) => &it.syntax,
1584 BinOp::Eqeq(it) => &it.syntax,
1585 BinOp::Neq(it) => &it.syntax,
1586 BinOp::Lteq(it) => &it.syntax,
1587 BinOp::Gteq(it) => &it.syntax,
1588 BinOp::LAngle(it) => &it.syntax,
1589 BinOp::RAngle(it) => &it.syntax,
1590 BinOp::Plus(it) => &it.syntax,
1591 BinOp::Star(it) => &it.syntax,
1592 BinOp::Minus(it) => &it.syntax,
1593 BinOp::Slash(it) => &it.syntax,
1594 BinOp::Percent(it) => &it.syntax,
1595 BinOp::Shl(it) => &it.syntax,
1596 BinOp::Shr(it) => &it.syntax,
1597 BinOp::Caret(it) => &it.syntax,
1598 BinOp::Pipe(it) => &it.syntax,
1599 BinOp::Amp(it) => &it.syntax,
1600 BinOp::Eq(it) => &it.syntax,
1601 BinOp::Pluseq(it) => &it.syntax,
1602 BinOp::Slasheq(it) => &it.syntax,
1603 BinOp::Stareq(it) => &it.syntax,
1604 BinOp::Percenteq(it) => &it.syntax,
1605 BinOp::Shreq(it) => &it.syntax,
1606 BinOp::Shleq(it) => &it.syntax,
1607 BinOp::Minuseq(it) => &it.syntax,
1608 BinOp::Pipeeq(it) => &it.syntax,
1609 BinOp::Ampeq(it) => &it.syntax,
1610 BinOp::Careteq(it) => &it.syntax,
1611 }
1612 }
1613}
1614#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1615pub enum PrefixOp { 1413pub enum PrefixOp {
1616 Minus(Minus), 1414 Minus(Minus),
1617 Excl(Excl), 1415 Excl(Excl),