diff --git a/trunk_lexer/src/lexer.rs b/trunk_lexer/src/lexer.rs index 098397d..29516cd 100644 --- a/trunk_lexer/src/lexer.rs +++ b/trunk_lexer/src/lexer.rs @@ -614,7 +614,15 @@ impl Lexer { }, ':' => { self.col += 1; - TokenKind::Colon + + if let Some(':') = it.peek() { + self.col += 1; + + it.next(); + TokenKind::DoubleColon + } else { + TokenKind::Colon + } }, _ => unimplemented!(" char: {}, line: {}, col: {}", char, self.line, self.col), }; @@ -819,7 +827,7 @@ function"#, &[ #[test] fn punct() { - assert_tokens("