This commit is contained in:
Folkert 2021-03-12 16:37:00 +01:00
parent e5e38f03bc
commit 06278c2efe
4 changed files with 195 additions and 25 deletions

View file

@ -1,6 +1,6 @@
use bumpalo::collections::vec::Vec;
use bumpalo::Bump;
use roc_region::all::{Located, Region};
use roc_region::all::{Located, Position, Region};
use std::fmt;
use Progress::*;
@ -36,6 +36,13 @@ impl<'a> State<'a> {
}
}
pub fn get_position(&self) -> Position {
Position {
row: self.line,
col: self.column,
}
}
/// Returns whether the parser has reached the end of the input
pub fn has_reached_end(&self) -> bool {
self.bytes.is_empty()