Skip to content

Make some of lexer's API private #59671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2019
Merged
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions src/libsyntax/parse/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ pub struct UnmatchedBrace {
}

pub struct StringReader<'a> {
pub sess: &'a ParseSess,
crate sess: &'a ParseSess,
/// The absolute offset within the source_map of the next character to read
pub next_pos: BytePos,
crate next_pos: BytePos,
/// The absolute offset within the source_map of the current character
pub pos: BytePos,
crate pos: BytePos,
/// The current character (which has been read from self.pos)
pub ch: Option<char>,
pub source_file: Lrc<syntax_pos::SourceFile>,
crate ch: Option<char>,
crate source_file: Lrc<syntax_pos::SourceFile>,
/// Stop reading src at this index.
pub end_src_index: usize,
crate end_src_index: usize,
// cached:
peek_tok: token::Token,
peek_span: Span,
Expand Down Expand Up @@ -126,7 +126,7 @@ impl<'a> StringReader<'a> {
}

/// Immutably extract string if found at current position with given delimiters
pub fn peek_delimited(&self, from_ch: char, to_ch: char) -> Option<String> {
fn peek_delimited(&self, from_ch: char, to_ch: char) -> Option<String> {
let mut pos = self.pos;
let mut idx = self.src_index(pos);
let mut ch = char_at(&self.src, idx);
Expand Down Expand Up @@ -191,7 +191,7 @@ impl<'a> StringReader<'a> {
self.fatal_span(self.peek_span, m)
}

pub fn emit_fatal_errors(&mut self) {
crate fn emit_fatal_errors(&mut self) {
for err in &mut self.fatal_errs {
err.emit();
}
Expand Down