aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parser/event_parser/parser.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/parser/event_parser/parser.rs b/src/parser/event_parser/parser.rs
index d7d24fa27..8bc382b12 100644
--- a/src/parser/event_parser/parser.rs
+++ b/src/parser/event_parser/parser.rs
@@ -19,6 +19,9 @@ pub(crate) struct Parser<'t> {
19 curly_limit: Option<i32>, 19 curly_limit: Option<i32>,
20} 20}
21 21
22#[derive(Debug, Clone, Copy,PartialEq, Eq)]
23pub(crate) struct Pos(u32);
24
22impl<'t> Parser<'t> { 25impl<'t> Parser<'t> {
23 pub(crate) fn new(text: &'t str, raw_tokens: &'t [Token]) -> Parser<'t> { 26 pub(crate) fn new(text: &'t str, raw_tokens: &'t [Token]) -> Parser<'t> {
24 let mut tokens = Vec::new(); 27 let mut tokens = Vec::new();
@@ -44,8 +47,8 @@ impl<'t> Parser<'t> {
44 } 47 }
45 } 48 }
46 49
47 pub(crate) fn pos(&self) -> usize { 50 pub(crate) fn pos(&self) -> Pos {
48 self.pos 51 Pos(self.pos as u32)
49 } 52 }
50 53
51 pub(crate) fn into_events(self) -> Vec<Event> { 54 pub(crate) fn into_events(self) -> Vec<Event> {