parent
c680668d22
commit
b6178aed2a
|
@ -380,7 +380,7 @@ impl<'a> Tokenizer<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn substr_offset(&self, s: &'a str) -> usize {
|
pub fn substr_offset(&self, s: &'a str) -> usize {
|
||||||
assert!(s.len() < self.input.len());
|
assert!(s.len() <= self.input.len());
|
||||||
let a = self.input.as_ptr() as usize;
|
let a = self.input.as_ptr() as usize;
|
||||||
let b = s.as_ptr() as usize;
|
let b = s.as_ptr() as usize;
|
||||||
assert!(a <= b);
|
assert!(a <= b);
|
||||||
|
|
|
@ -9,4 +9,5 @@ fn bad() {
|
||||||
bad("a = 01");
|
bad("a = 01");
|
||||||
bad("a = 1__1");
|
bad("a = 1__1");
|
||||||
bad("a = 1_");
|
bad("a = 1_");
|
||||||
|
bad("''");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue