Skip to content

Commit 237bc8b

Browse files
committed
UNICODE_ARRAY and ASCII_ARRAY fixes.
- Avoid unnecessary escaping of single quotes within string literals. - Add a missing blank line between two `UNICODE_ARRAY` sections.
1 parent 434999e commit 237bc8b

File tree

1 file changed

+38
-37
lines changed

1 file changed

+38
-37
lines changed

compiler/rustc_parse/src/lexer/unicode_chars.rs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -129,42 +129,42 @@ pub(super) const UNICODE_ARRAY: &[(char, &str, &str)] = &[
129129
('。', "Ideographic Full Stop", "."),
130130
('︒', "Presentation Form For Vertical Ideographic Full Stop", "."),
131131

132-
('՝', "Armenian Comma", "\'"),
133-
(''', "Fullwidth Apostrophe", "\'"),
134-
('‘', "Left Single Quotation Mark", "\'"),
135-
('’', "Right Single Quotation Mark", "\'"),
136-
('‛', "Single High-Reversed-9 Quotation Mark", "\'"),
137-
('′', "Prime", "\'"),
138-
('‵', "Reversed Prime", "\'"),
139-
('՚', "Armenian Apostrophe", "\'"),
140-
('׳', "Hebrew Punctuation Geresh", "\'"),
141-
('`', "Grave Accent", "\'"),
142-
('`', "Greek Varia", "\'"),
143-
('`', "Fullwidth Grave Accent", "\'"),
144-
('´', "Acute Accent", "\'"),
145-
('΄', "Greek Tonos", "\'"),
146-
('´', "Greek Oxia", "\'"),
147-
('᾽', "Greek Koronis", "\'"),
148-
('᾿', "Greek Psili", "\'"),
149-
('῾', "Greek Dasia", "\'"),
150-
('ʹ', "Modifier Letter Prime", "\'"),
151-
('ʹ', "Greek Numeral Sign", "\'"),
152-
('ˈ', "Modifier Letter Vertical Line", "\'"),
153-
('ˊ', "Modifier Letter Acute Accent", "\'"),
154-
('ˋ', "Modifier Letter Grave Accent", "\'"),
155-
('˴', "Modifier Letter Middle Grave Accent", "\'"),
156-
('ʻ', "Modifier Letter Turned Comma", "\'"),
157-
('ʽ', "Modifier Letter Reversed Comma", "\'"),
158-
('ʼ', "Modifier Letter Apostrophe", "\'"),
159-
('ʾ', "Modifier Letter Right Half Ring", "\'"),
160-
('ꞌ', "Latin Small Letter Saltillo", "\'"),
161-
('י', "Hebrew Letter Yod", "\'"),
162-
('ߴ', "Nko High Tone Apostrophe", "\'"),
163-
('ߵ', "Nko Low Tone Apostrophe", "\'"),
164-
('ᑊ', "Canadian Syllabics West-Cree P", "\'"),
165-
('ᛌ', "Runic Letter Short-Twig-Sol S", "\'"),
166-
('𖽑', "Miao Sign Aspiration", "\'"),
167-
('𖽒', "Miao Sign Reformed Voicing", "\'"),
132+
('՝', "Armenian Comma", "'"),
133+
(''', "Fullwidth Apostrophe", "'"),
134+
('‘', "Left Single Quotation Mark", "'"),
135+
('’', "Right Single Quotation Mark", "'"),
136+
('‛', "Single High-Reversed-9 Quotation Mark", "'"),
137+
('′', "Prime", "'"),
138+
('‵', "Reversed Prime", "'"),
139+
('՚', "Armenian Apostrophe", "'"),
140+
('׳', "Hebrew Punctuation Geresh", "'"),
141+
('`', "Grave Accent", "'"),
142+
('`', "Greek Varia", "'"),
143+
('`', "Fullwidth Grave Accent", "'"),
144+
('´', "Acute Accent", "'"),
145+
('΄', "Greek Tonos", "'"),
146+
('´', "Greek Oxia", "'"),
147+
('᾽', "Greek Koronis", "'"),
148+
('᾿', "Greek Psili", "'"),
149+
('῾', "Greek Dasia", "'"),
150+
('ʹ', "Modifier Letter Prime", "'"),
151+
('ʹ', "Greek Numeral Sign", "'"),
152+
('ˈ', "Modifier Letter Vertical Line", "'"),
153+
('ˊ', "Modifier Letter Acute Accent", "'"),
154+
('ˋ', "Modifier Letter Grave Accent", "'"),
155+
('˴', "Modifier Letter Middle Grave Accent", "'"),
156+
('ʻ', "Modifier Letter Turned Comma", "'"),
157+
('ʽ', "Modifier Letter Reversed Comma", "'"),
158+
('ʼ', "Modifier Letter Apostrophe", "'"),
159+
('ʾ', "Modifier Letter Right Half Ring", "'"),
160+
('ꞌ', "Latin Small Letter Saltillo", "'"),
161+
('י', "Hebrew Letter Yod", "'"),
162+
('ߴ', "Nko High Tone Apostrophe", "'"),
163+
('ߵ', "Nko Low Tone Apostrophe", "'"),
164+
('ᑊ', "Canadian Syllabics West-Cree P", "'"),
165+
('ᛌ', "Runic Letter Short-Twig-Sol S", "'"),
166+
('𖽑', "Miao Sign Aspiration", "'"),
167+
('𖽒', "Miao Sign Reformed Voicing", "'"),
168168

169169
('᳓', "Vedic Sign Nihshvasa", "\""),
170170
('"', "Fullwidth Quotation Mark", "\""),
@@ -298,6 +298,7 @@ pub(super) const UNICODE_ARRAY: &[(char, &str, &str)] = &[
298298
('〉', "Right Angle Bracket", ">"),
299299
('》', "Right Double Angle Bracket", ">"),
300300
('>', "Fullwidth Greater-Than Sign", ">"),
301+
301302
('⩵', "Two Consecutive Equals Signs", "==")
302303
];
303304

@@ -332,7 +333,7 @@ const ASCII_ARRAY: &[(&str, &str, Option<token::TokenKind>)] = &[
332333
(">", "Greater-Than Sign", Some(token::Gt)),
333334
// FIXME: Literals are already lexed by this point, so we can't recover gracefully just by
334335
// spitting the correct token out.
335-
("\'", "Single Quote", None),
336+
("'", "Single Quote", None),
336337
("\"", "Quotation Mark", None),
337338
];
338339

0 commit comments

Comments
 (0)