diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-01-13 04:49:20 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-01-17 08:17:26 +0000 |
| commit | debcbf0b8e8fcf6f1d44e8f79cc06c0866d8d1dd (patch) | |
| tree | f61d8ca01c5e888b1f18e25dcb516d80a54b875d /src/libsyntax/parse/mod.rs | |
| parent | de46b247585999ae70674f1fa0543d62f2889c7f (diff) | |
| download | rust-debcbf0b8e8fcf6f1d44e8f79cc06c0866d8d1dd.tar.gz rust-debcbf0b8e8fcf6f1d44e8f79cc06c0866d8d1dd.zip | |
Refactor the parser to consume token trees.
Diffstat (limited to 'src/libsyntax/parse/mod.rs')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 500e8285b4c..0937ef15b4d 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -45,7 +45,7 @@ pub mod obsolete; /// Info about a parsing session. pub struct ParseSess { - pub span_diagnostic: Handler, // better be the same as the one in the reader! + pub span_diagnostic: Handler, pub unstable_features: UnstableFeatures, pub config: CrateConfig, /// Used to determine and report recursive mod inclusions @@ -227,8 +227,7 @@ pub fn filemap_to_tts(sess: &ParseSess, filemap: Rc<FileMap>) -> Vec<tokenstream /// Given tts and the ParseSess, produce a parser pub fn tts_to_parser<'a>(sess: &'a ParseSess, tts: Vec<tokenstream::TokenTree>) -> Parser<'a> { - let trdr = lexer::new_tt_reader(&sess.span_diagnostic, None, tts); - let mut p = Parser::new(sess, Box::new(trdr), None, false); + let mut p = Parser::new(sess, tts, None, false); p.check_unknown_macro_variable(); p } |
