diff options
| author | Cody <cody@codyq.dev> | 2023-01-29 20:58:04 -0600 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-01-29 20:58:04 -0600 |
| commit | a653a6602fe5ae5eb4739755db7b34bc92ecdadf (patch) | |
| tree | 2d99c570ccd77767e1d5fcf9b098d45c79cbe6e4 /src/lexer.rs | |
| parent | b856e5c7226e71e500be5eff7079c5d3b0e9e2f4 (diff) | |
| download | sloth-a653a6602fe5ae5eb4739755db7b34bc92ecdadf.tar.gz | |
More stuffs
Diffstat (limited to 'src/lexer.rs')
| -rw-r--r-- | src/lexer.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lexer.rs b/src/lexer.rs index 74a006c..27669cb 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -3,6 +3,7 @@ #[derive(Debug, Eq, PartialEq)] pub enum TokenType { // Utility + DocComment(String), Comment(String), // Short @@ -156,6 +157,15 @@ impl<'a> Iterator for Lexer<'a> { let tt = match character { // Whitespace & Comments + '#' if self.advance_if_eq(Some('#')) => { + let mut value = String::new(); + while self.peek() != Some('\n') { + value.push(self.advance().unwrap()); + } + + TokenType::DocComment(value) + } + '#' => { let mut value = String::new(); while self.peek() != Some('\n') { |
