Move lexer to use regex instead of hand-rolled lexing

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-04-27 19:50:46 -04:00
parent 58421a0469
commit ce97d90f9d
6 changed files with 147 additions and 180 deletions

View File

@@ -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