mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Remove line/column fields
This commit is contained in:
parent
eb35e9914f
commit
8e1241adea
4 changed files with 37 additions and 67 deletions
|
@ -45,10 +45,7 @@ impl<'a> State<'a> {
|
|||
|
||||
/// Returns the current position
|
||||
pub const fn pos(&self) -> Position {
|
||||
Position::new(
|
||||
(self.input_len - self.bytes.len()) as u32,
|
||||
self.xyzlcol.line,
|
||||
self.xyzlcol.column)
|
||||
Position::new((self.input_len - self.bytes.len()) as u32)
|
||||
}
|
||||
|
||||
/// Returns whether the parser has reached the end of the input
|
||||
|
@ -102,15 +99,7 @@ impl<'a> State<'a> {
|
|||
pub fn len_region(&self, length: u16) -> Region {
|
||||
Region::new(
|
||||
self.pos(),
|
||||
Position::new(
|
||||
self.pos().bump_column(length).offset,
|
||||
self.xyzlcol.line,
|
||||
self
|
||||
.xyzlcol
|
||||
.column
|
||||
.checked_add(length)
|
||||
.unwrap_or_else(|| panic!("len_region overflowed")),
|
||||
),
|
||||
self.pos().bump_column(length),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue