aboutsummaryrefslogtreecommitdiff
path: root/src/lexer
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-28 11:07:10 +0100
committerAleksey Kladov <[email protected]>2018-07-28 11:07:10 +0100
commit8d9961b75377a7bd2656b5aa1451710de8c86f60 (patch)
treec2dcedf487d2ad4674edb012dd579aa74173d8c2 /src/lexer
parent52dc0ddc84544a59d3a2580d9944d0482a633349 (diff)
Migrate to text-unit
Diffstat (limited to 'src/lexer')
-rw-r--r--src/lexer/ptr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lexer/ptr.rs b/src/lexer/ptr.rs
index 99d55b283..d1391fd5f 100644
--- a/src/lexer/ptr.rs
+++ b/src/lexer/ptr.rs
@@ -11,7 +11,7 @@ impl<'s> Ptr<'s> {
11 pub fn new(text: &'s str) -> Ptr<'s> { 11 pub fn new(text: &'s str) -> Ptr<'s> {
12 Ptr { 12 Ptr {
13 text, 13 text,
14 len: TextUnit::new(0), 14 len: 0.into(),
15 } 15 }
16 } 16 }
17 17
@@ -47,7 +47,7 @@ impl<'s> Ptr<'s> {
47 47
48 pub fn bump(&mut self) -> Option<char> { 48 pub fn bump(&mut self) -> Option<char> {
49 let ch = self.chars().next()?; 49 let ch = self.chars().next()?;
50 self.len += TextUnit::len_of_char(ch); 50 self.len += TextUnit::of_char(ch);
51 Some(ch) 51 Some(ch)
52 } 52 }
53 53