Skip to content

Commit

Permalink
Rename rustc_lexer::TokenKind::Not to Bang
Browse files Browse the repository at this point in the history
All other tokens are named by the punctuation they use, rather than
by semantics operation they stand for. `!` is the only exception to
the rule, let's fix it.
  • Loading branch information
matklad committed Aug 20, 2020
1 parent 1a22a0f commit 5299297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/librustc_lexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub enum TokenKind {
/// "="
Eq,
/// "!"
Not,
Bang,
/// "<"
Lt,
/// ">"
Expand Down Expand Up @@ -378,7 +378,7 @@ impl Cursor<'_> {
':' => Colon,
'$' => Dollar,
'=' => Eq,
'!' => Not,
'!' => Bang,
'<' => Lt,
'>' => Gt,
'-' => Minus,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_parse/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl<'a> StringReader<'a> {
rustc_lexer::TokenKind::Colon => token::Colon,
rustc_lexer::TokenKind::Dollar => token::Dollar,
rustc_lexer::TokenKind::Eq => token::Eq,
rustc_lexer::TokenKind::Not => token::Not,
rustc_lexer::TokenKind::Bang => token::Not,
rustc_lexer::TokenKind::Lt => token::Lt,
rustc_lexer::TokenKind::Gt => token::Gt,
rustc_lexer::TokenKind::Minus => token::BinOp(token::Minus),
Expand Down

0 comments on commit 5299297

Please sign in to comment.