Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
63f2c22
Add missing doc links in boxed module
GuillaumeGomez Jul 2, 2019
c8aa3c1
Add missing type links in Pin documentation
GuillaumeGomez Jul 4, 2019
dee3d27
allow clippy::unreadable_literal in unicode tables
euclio Jun 23, 2019
8c050fc
rustc: compute `ty::layout::Niche`'s `available` on the fly.
eddyb Jul 11, 2019
dfbf464
rustc_target: move abi::Niche from rustc::ty::layout.
eddyb Jul 12, 2019
88eced5
rustc: precompute the largest Niche and store it in LayoutDetails.
eddyb Jul 15, 2019
d1aca3a
renamed `inner_deref` feature's `deref*()` methods `as_deref*()` as p…
Xandkeeper Apr 1, 2019
6a9d749
fixed breaking changes
Xandkeeper Apr 2, 2019
f2a9721
Use DerefMut
JohnTitor Jul 5, 2019
59634bc
Replace deref with as_deref
JohnTitor Jul 5, 2019
3427a14
Remove support for -Zlower-128bit-ops
bjorn3 Jul 19, 2019
e8a1e73
Update compiler_builtins to 0.1.18
bjorn3 Jul 20, 2019
93de733
Remove tests for -Zlower-128bit-ops
bjorn3 Jul 20, 2019
6fae7db
Remove vector fadd/fmul reduction workarounds
nikic Jul 20, 2019
279c399
code cleanup
bpangWR Jul 22, 2019
fe4cdd3
Disable d32 on armv6 hf targets
nikic Jul 23, 2019
71717b9
Initialize the MSP430 AsmParser if available
nikic Jul 23, 2019
70c817a
Allow lexer to recover from some homoglyphs
estebank Jul 24, 2019
b01b5b9
ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar
pietroalbini Jul 25, 2019
0e022f8
Remove needless indirection through Rc
Mark-Simulacrum Jul 25, 2019
dd0f2ac
librustc_errors: Support ui-testing flag in annotate-snippet emitter
phansch Jul 25, 2019
6844976
review comments: add FIXME comments and formatting
estebank Jul 25, 2019
df4b23e
Implement slow-path for FirstSets::first
ia0 Jul 24, 2019
0576062
clarify and unify some type test names
RalfJung Jul 24, 2019
3284472
Add test for issue-54062
JohnTitor Jul 26, 2019
2828741
Rollup merge of #62084 - euclio:unicode-table-tweak, r=kennytm
Centril Jul 26, 2019
08baff2
Rollup merge of #62120 - GuillaumeGomez:add-missing-type-links, r=Cen…
Centril Jul 26, 2019
bf7551a
Rollup merge of #62310 - GuillaumeGomez:add-missing-doc-links-boxed, …
Centril Jul 26, 2019
d76a519
Rollup merge of #62421 - JohnTitor:U007D-master, r=alexcrichton
Centril Jul 26, 2019
e13ace7
Rollup merge of #62692 - eddyb:precompute-niches, r=oli-obk
Centril Jul 26, 2019
e9f6dda
Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichton
Centril Jul 26, 2019
80f23fb
Rollup merge of #62828 - nikic:fadd-mul-reductions, r=eddyb
Centril Jul 26, 2019
454a889
Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichton
Centril Jul 26, 2019
299ab0b
Rollup merge of #62904 - nikic:arm-d32, r=alexcrichton
Centril Jul 26, 2019
286be6a
Rollup merge of #62907 - nikic:msp430-asmparser, r=alexcrichton
Centril Jul 26, 2019
5ef908a
Rollup merge of #62956 - ia0:fix_62831, r=petrochenkov
Centril Jul 26, 2019
b8dadb0
Rollup merge of #62963 - estebank:homoglyph-recovery, r=petrochenkov
Centril Jul 26, 2019
f82ba3b
Rollup merge of #62964 - RalfJung:ty-tests, r=Centril
Centril Jul 26, 2019
946c918
Rollup merge of #62970 - pietroalbini:fix-tools-builder, r=alexcrichton
Centril Jul 26, 2019
0f040b9
Rollup merge of #62983 - Mark-Simulacrum:remove-needless-rc, r=petroc…
Centril Jul 26, 2019
bc897a5
Rollup merge of #62985 - phansch:support_ui_testing_flag, r=estebank
Centril Jul 26, 2019
a719d90
Rollup merge of #63004 - JohnTitor:add-tests-for-54062, r=Centril
Centril Jul 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review comments: add FIXME comments and formatting
  • Loading branch information
estebank committed Jul 25, 2019
commit 684497648ae22a69df80d410de643385c2cc86d4
15 changes: 11 additions & 4 deletions src/libsyntax/parse/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,18 @@ impl<'a> StringReader<'a> {
self.pos,
"unknown start of token",
c);
if let Some(t) = unicode_chars::check_for_substitution(self, start, c, &mut err) {
err.emit();
return Ok(t);
// FIXME: the lexer could be used to turn the ASCII version of unicode homoglyphs,
// instead of keeping a table in `check_for_substitution`into the token. Ideally,
// this should be inside `rustc_lexer`. However, we should first remove compound
// tokens like `<<` from `rustc_lexer`, and then add fancier error recovery to it,
// as there will be less overall work to do this way.
return match unicode_chars::check_for_substitution(self, start, c, &mut err) {
Some(token) => {
err.emit();
Ok(token)
}
None => Err(err),
}
return Err(err)
}
};
Ok(kind)
Expand Down
14 changes: 10 additions & 4 deletions src/libsyntax/parse/lexer/unicode_chars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use super::StringReader;
use errors::{Applicability, DiagnosticBuilder};
use syntax_pos::{BytePos, Pos, Span, NO_EXPANSION};
use syntax_pos::{BytePos, Pos, Span, NO_EXPANSION, symbol::kw};
use crate::parse::token;

#[rustfmt::skip] // for line breaks
Expand Down Expand Up @@ -298,18 +298,20 @@ const UNICODE_ARRAY: &[(char, &str, char)] = &[
('>', "Fullwidth Greater-Than Sign", '>'),
];

// FIXME: the lexer could be used to turn the ASCII version of unicode homoglyphs, instead of
// keeping the substitution token in this table. Ideally, this should be inside `rustc_lexer`.
// However, we should first remove compound tokens like `<<` from `rustc_lexer`, and then add
// fancier error recovery to it, as there will be less overall work to do this way.
const ASCII_ARRAY: &[(char, &str, Option<token::TokenKind>)] = &[
(' ', "Space", Some(token::Whitespace)),
('_', "Underscore", None),
('_', "Underscore", Some(token::Ident(kw::Underscore, false))),
('-', "Minus/Hyphen", Some(token::BinOp(token::Minus))),
(',', "Comma", Some(token::Comma)),
(';', "Semicolon", Some(token::Semi)),
(':', "Colon", Some(token::Colon)),
('!', "Exclamation Mark", Some(token::Not)),
('?', "Question Mark", Some(token::Question)),
('.', "Period", Some(token::Dot)),
('\'', "Single Quote", None), // Literals are already lexed by this point, so we can't recover
('"', "Quotation Mark", None), // gracefully just by spitting the correct token out.
('(', "Left Parenthesis", Some(token::OpenDelim(token::Paren))),
(')', "Right Parenthesis", Some(token::CloseDelim(token::Paren))),
('[', "Left Square Bracket", Some(token::OpenDelim(token::Bracket))),
Expand All @@ -324,6 +326,10 @@ const ASCII_ARRAY: &[(char, &str, Option<token::TokenKind>)] = &[
('<', "Less-Than Sign", Some(token::Lt)),
('=', "Equals Sign", Some(token::Eq)),
('>', "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.
('\'', "Single Quote", None),
('"', "Quotation Mark", None),
];

crate fn check_for_substitution<'a>(
Expand Down