Remove line/column fields

This commit is contained in:
Joshua Warner 2021-12-23 21:15:28 -08:00
parent eb35e9914f
commit 8e1241adea
4 changed files with 37 additions and 67 deletions

View file

@ -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),
)
}