diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-14 22:33:22 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-14 22:34:43 +0100 |
| commit | 2a86e4db0bb3894d1cc3b94e1a1af31a6cd87b80 (patch) | |
| tree | d5c0954ef779689c40eb9b2f58d477869546ea89 /src/syntax/lexer.rs | |
| parent | e50189cfa75d83ea1b74b1dc2cf1fc9c01f8c825 (diff) | |
Reference supplements
Diffstat (limited to 'src/syntax/lexer.rs')
| -rw-r--r-- | src/syntax/lexer.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/syntax/lexer.rs b/src/syntax/lexer.rs index 919cce69..8e27d98d 100644 --- a/src/syntax/lexer.rs +++ b/src/syntax/lexer.rs @@ -172,7 +172,7 @@ impl Lexer<'_> { 'h' if self.s.eat_if("ttps://") => self.link(), '0'..='9' => self.numbering(start), '<' if self.s.at(is_id_continue) => self.label(), - '@' if self.s.at(is_id_continue) => self.reference(), + '@' => self.ref_marker(), '.' if self.s.eat_if("..") => SyntaxKind::Shorthand, '-' if self.s.eat_if("--") => SyntaxKind::Shorthand, @@ -297,6 +297,11 @@ impl Lexer<'_> { self.text() } + fn ref_marker(&mut self) -> SyntaxKind { + self.s.eat_while(is_id_continue); + SyntaxKind::RefMarker + } + fn label(&mut self) -> SyntaxKind { let label = self.s.eat_while(is_id_continue); if label.is_empty() { @@ -310,11 +315,6 @@ impl Lexer<'_> { SyntaxKind::Label } - fn reference(&mut self) -> SyntaxKind { - self.s.eat_while(is_id_continue); - SyntaxKind::Ref - } - fn text(&mut self) -> SyntaxKind { macro_rules! table { ($(|$c:literal)*) => { |
