Move lexer to use regex instead of hand-rolled lexing
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -36,6 +36,16 @@ impl Pos {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn adv_char(&mut self, c: char) {
|
||||
*self = self.next_char(c);
|
||||
}
|
||||
|
||||
pub fn adv_str(&mut self, s: &str) {
|
||||
for c in s.chars() {
|
||||
self.adv_char(c);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn min(self, other: Self) -> Self {
|
||||
if self.byte < other.byte {
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user