diff options
| author | Taiki Endo <te316e89@gmail.com> | 2019-02-07 02:33:01 +0900 |
|---|---|---|
| committer | Taiki Endo <te316e89@gmail.com> | 2019-02-07 02:33:01 +0900 |
| commit | 7bb082d27fe472f52b103de0ae9fc6fa7e6546cc (patch) | |
| tree | dfed08e00fc6e88022fd7249bd5017e5d57110a7 /src/libsyntax/parse/lexer/mod.rs | |
| parent | 2596bc1368d1e3d34c9a7841ad87a3100f01cbad (diff) | |
| download | rust-7bb082d27fe472f52b103de0ae9fc6fa7e6546cc.tar.gz rust-7bb082d27fe472f52b103de0ae9fc6fa7e6546cc.zip | |
libsyntax => 2018
Diffstat (limited to 'src/libsyntax/parse/lexer/mod.rs')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 06f9162a400..2e3233c8ed8 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1,9 +1,10 @@ -use ast::{self, Ident}; +use crate::ast::{self, Ident}; +use crate::source_map::{SourceMap, FilePathMapping}; +use crate::errors::{Applicability, FatalError, Diagnostic, DiagnosticBuilder}; +use crate::parse::{token, ParseSess}; +use crate::symbol::{Symbol, keywords}; + use syntax_pos::{self, BytePos, CharPos, Pos, Span, NO_EXPANSION}; -use source_map::{SourceMap, FilePathMapping}; -use errors::{Applicability, FatalError, Diagnostic, DiagnosticBuilder}; -use parse::{token, ParseSess}; -use symbol::{Symbol, keywords}; use core::unicode::property::Pattern_White_Space; use std::borrow::Cow; @@ -11,6 +12,7 @@ use std::char; use std::iter; use std::mem::replace; use rustc_data_structures::sync::Lrc; +use log::debug; pub mod comments; mod tokentrees; @@ -449,7 +451,7 @@ impl<'a> StringReader<'a> { } return s.into(); - fn translate_crlf_(rdr: &StringReader, + fn translate_crlf_(rdr: &StringReader<'_>, start: BytePos, s: &str, mut j: usize, @@ -1866,19 +1868,20 @@ fn char_at(s: &str, byte: usize) -> char { mod tests { use super::*; - use ast::{Ident, CrateConfig}; - use symbol::Symbol; - use syntax_pos::{BytePos, Span, NO_EXPANSION}; - use source_map::SourceMap; - use errors; - use feature_gate::UnstableFeatures; - use parse::token; + use crate::ast::{Ident, CrateConfig}; + use crate::symbol::Symbol; + use crate::source_map::SourceMap; + use crate::errors; + use crate::feature_gate::UnstableFeatures; + use crate::parse::token; + use crate::diagnostics::plugin::ErrorMap; + use crate::with_globals; use std::io; use std::path::PathBuf; - use diagnostics::plugin::ErrorMap; + use syntax_pos::{BytePos, Span, NO_EXPANSION}; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::sync::Lock; - use with_globals; + fn mk_sess(sm: Lrc<SourceMap>) -> ParseSess { let emitter = errors::emitter::EmitterWriter::new(Box::new(io::sink()), Some(sm.clone()), @@ -1943,7 +1946,7 @@ mod tests { // check that the given reader produces the desired stream // of tokens (stop checking after exhausting the expected vec) - fn check_tokenization(mut string_reader: StringReader, expected: Vec<token::Token>) { + fn check_tokenization(mut string_reader: StringReader<'_>, expected: Vec<token::Token>) { for expected_tok in &expected { assert_eq!(&string_reader.next_token().tok, expected_tok); } |
