about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/lexer/unicode_chars.rs
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2023-01-19 02:25:24 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2023-01-19 02:25:55 +0000
commit1487aa9f9d7edbe660272f7adb5e57ef31deab9d (patch)
tree05a579961df45a8491fa8942b89bc0f6af3bc7e8 /compiler/rustc_parse/src/lexer/unicode_chars.rs
parent3520bba13690e843704e77bd2ada89131b81051e (diff)
downloadrust-1487aa9f9d7edbe660272f7adb5e57ef31deab9d.tar.gz
rust-1487aa9f9d7edbe660272f7adb5e57ef31deab9d.zip
Add double-equals homoglyph
Diffstat (limited to 'compiler/rustc_parse/src/lexer/unicode_chars.rs')
-rw-r--r--compiler/rustc_parse/src/lexer/unicode_chars.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/lexer/unicode_chars.rs b/compiler/rustc_parse/src/lexer/unicode_chars.rs
index 2332216f09b..34d003ccfa7 100644
--- a/compiler/rustc_parse/src/lexer/unicode_chars.rs
+++ b/compiler/rustc_parse/src/lexer/unicode_chars.rs
@@ -296,6 +296,7 @@ pub(crate) const UNICODE_ARRAY: &[(char, &str, &str)] = &[
     ('〉', "Right Angle Bracket", ">"),
     ('》', "Right Double Angle Bracket", ">"),
     ('>', "Fullwidth Greater-Than Sign", ">"),
+    ('⩵', "Two Consecutive Equals Signs", "==")
 ];
 
 // FIXME: the lexer could be used to turn the ASCII version of unicode homoglyphs, instead of
@@ -325,6 +326,7 @@ const ASCII_ARRAY: &[(&str, &str, Option<token::TokenKind>)] = &[
     ("+", "Plus Sign", Some(token::BinOp(token::Plus))),
     ("<", "Less-Than Sign", Some(token::Lt)),
     ("=", "Equals Sign", Some(token::Eq)),
+    ("==", "Double Equals Sign", Some(token::EqEq)),
     (">", "Greater-Than Sign", Some(token::Gt)),
     // FIXME: Literals are already lexed by this point, so we can't recover gracefully just by
     // spitting the correct token out.