Skip to content

Use u32 for SourceLocation #157

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 1 commit into from
Jun 15, 2017
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
Use u32 for SourceLocation
  • Loading branch information
upsuper committed Jun 15, 2017
commit 07636d9df399f6129a935e36e9e22de53e811e3e
6 changes: 3 additions & 3 deletions src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl<'a> Tokenizer<'a> {
location.column = 1;
}
debug_assert!(position <= target);
location.column += target - position;
location.column += (target - position) as u32;
self.last_known_source_location.set((SourcePosition(target), location));
location
}
Expand Down Expand Up @@ -383,10 +383,10 @@ pub struct SourcePosition(usize);
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
pub struct SourceLocation {
/// The line number, starting at 1 for the first line.
pub line: usize,
pub line: u32,

/// The column number within a line, starting at 1 for first the character of the line.
pub column: usize,
pub column: u32,
}


Expand Down