mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Clean up
This commit is contained in:
parent
c23408751c
commit
6ff16c7ad9
1 changed files with 26 additions and 26 deletions
|
@ -231,48 +231,48 @@ impl TtTokenSource {
|
||||||
{
|
{
|
||||||
if let Some((m, is_joint_to_next)) = iter.current_punct3(p) {
|
if let Some((m, is_joint_to_next)) = iter.current_punct3(p) {
|
||||||
if let Some((kind, text)) = match m {
|
if let Some((kind, text)) = match m {
|
||||||
('<', '<', '=') => Some((SHLEQ, "<<=".into())),
|
('<', '<', '=') => Some((SHLEQ, "<<=")),
|
||||||
('>', '>', '=') => Some((SHREQ, ">>=".into())),
|
('>', '>', '=') => Some((SHREQ, ">>=")),
|
||||||
('.', '.', '.') => Some((DOTDOTDOT, "...".into())),
|
('.', '.', '.') => Some((DOTDOTDOT, "...")),
|
||||||
('.', '.', '=') => Some((DOTDOTEQ, "..=".into())),
|
('.', '.', '=') => Some((DOTDOTEQ, "..=")),
|
||||||
_ => None,
|
_ => None,
|
||||||
} {
|
} {
|
||||||
iter.next();
|
iter.next();
|
||||||
iter.next();
|
iter.next();
|
||||||
return Some(TtToken { kind, is_joint_to_next, text });
|
return Some(TtToken { kind, is_joint_to_next, text: text.into() });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some((m, is_joint_to_next)) = iter.current_punct2(p) {
|
if let Some((m, is_joint_to_next)) = iter.current_punct2(p) {
|
||||||
if let Some((kind, text)) = match m {
|
if let Some((kind, text)) = match m {
|
||||||
('<', '<') => Some((SHL, "<<".into())),
|
('<', '<') => Some((SHL, "<<")),
|
||||||
('>', '>') => Some((SHR, ">>".into())),
|
('>', '>') => Some((SHR, ">>")),
|
||||||
|
|
||||||
('|', '|') => Some((PIPEPIPE, "||".into())),
|
('|', '|') => Some((PIPEPIPE, "||")),
|
||||||
('&', '&') => Some((AMPAMP, "&&".into())),
|
('&', '&') => Some((AMPAMP, "&&")),
|
||||||
('%', '=') => Some((PERCENTEQ, "%=".into())),
|
('%', '=') => Some((PERCENTEQ, "%=")),
|
||||||
('*', '=') => Some((STAREQ, "*=".into())),
|
('*', '=') => Some((STAREQ, "*=")),
|
||||||
('/', '=') => Some((SLASHEQ, "/=".into())),
|
('/', '=') => Some((SLASHEQ, "/=")),
|
||||||
('^', '=') => Some((CARETEQ, "^=".into())),
|
('^', '=') => Some((CARETEQ, "^=")),
|
||||||
|
|
||||||
('&', '=') => Some((AMPEQ, "&=".into())),
|
('&', '=') => Some((AMPEQ, "&=")),
|
||||||
('|', '=') => Some((PIPEEQ, "|=".into())),
|
('|', '=') => Some((PIPEEQ, "|=")),
|
||||||
('-', '=') => Some((MINUSEQ, "-=".into())),
|
('-', '=') => Some((MINUSEQ, "-=")),
|
||||||
('+', '=') => Some((PLUSEQ, "+=".into())),
|
('+', '=') => Some((PLUSEQ, "+=")),
|
||||||
('>', '=') => Some((GTEQ, ">=".into())),
|
('>', '=') => Some((GTEQ, ">=")),
|
||||||
('<', '=') => Some((LTEQ, "<=".into())),
|
('<', '=') => Some((LTEQ, "<=")),
|
||||||
|
|
||||||
('-', '>') => Some((THIN_ARROW, "->".into())),
|
('-', '>') => Some((THIN_ARROW, "->")),
|
||||||
('!', '=') => Some((NEQ, "!=".into())),
|
('!', '=') => Some((NEQ, "!=")),
|
||||||
('=', '>') => Some((FAT_ARROW, "=>".into())),
|
('=', '>') => Some((FAT_ARROW, "=>")),
|
||||||
('=', '=') => Some((EQEQ, "==".into())),
|
('=', '=') => Some((EQEQ, "==")),
|
||||||
('.', '.') => Some((DOTDOT, "..".into())),
|
('.', '.') => Some((DOTDOT, "..")),
|
||||||
(':', ':') => Some((COLONCOLON, "::".into())),
|
(':', ':') => Some((COLONCOLON, "::")),
|
||||||
|
|
||||||
_ => None,
|
_ => None,
|
||||||
} {
|
} {
|
||||||
iter.next();
|
iter.next();
|
||||||
return Some(TtToken { kind, is_joint_to_next, text });
|
return Some(TtToken { kind, is_joint_to_next, text: text.into() });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue