diff options
| author | bors <bors@rust-lang.org> | 2016-04-27 13:49:45 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-27 13:49:45 -0700 |
| commit | cda7c1cf2463443aee4a2f51a5141bc7ce4a4f97 (patch) | |
| tree | 52be2ea17940cd98bbdfdc205d2552ce71eb127d /src/libsyntax/ext | |
| parent | b52d76a08528273b218f168753ed846ecfb59aec (diff) | |
| parent | 6887202ea3a1d3e3df0c88c07c754defd87b9712 (diff) | |
| download | rust-cda7c1cf2463443aee4a2f51a5141bc7ce4a4f97.tar.gz rust-cda7c1cf2463443aee4a2f51a5141bc7ce4a4f97.zip | |
Auto merge of #33199 - mitaa:tokenize-responsibly, r=nrc
Make some fatal lexer errors recoverable I've kept the changes to a minimum since I'm not really sure if this approach is a acceptable. fixes #12834 cc @nrc
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 7f53d0f412c..6b3b5ce9de9 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -12,7 +12,7 @@ use self::LockstepIterSize::*; use ast; use ast::{TokenTree, Ident, Name}; use codemap::{Span, DUMMY_SP}; -use errors::Handler; +use errors::{Handler, DiagnosticBuilder}; use ext::tt::macro_parser::{NamedMatch, MatchedSeq, MatchedNonterminal}; use parse::token::{DocComment, MatchNt, SubstNt}; use parse::token::{Token, NtIdent, SpecialMacroVar}; @@ -50,6 +50,7 @@ pub struct TtReader<'a> { pub cur_span: Span, /// Transform doc comments. Only useful in macro invocations pub desugar_doc_comments: bool, + pub fatal_errs: Vec<DiagnosticBuilder<'a>>, } /// This can do Macro-By-Example transcription. On the other hand, if @@ -99,6 +100,7 @@ pub fn new_tt_reader_with_doc_flag(sp_diag: &Handler, /* dummy values, never read: */ cur_tok: token::Eof, cur_span: DUMMY_SP, + fatal_errs: Vec::new(), }; tt_next_token(&mut r); /* get cur_tok and cur_span set up */ r |
