diff options
Diffstat (limited to 'src/lexer.rs')
| -rw-r--r-- | src/lexer.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lexer.rs b/src/lexer.rs index 5ce7929..c7249b7 100644 --- a/src/lexer.rs +++ b/src/lexer.rs | |||
| @@ -24,7 +24,6 @@ pub enum SymbolType<'a> { | |||
| 24 | Literal(&'a str), | 24 | Literal(&'a str), |
| 25 | Text(&'a str), | 25 | Text(&'a str), |
| 26 | Error{ what: ErrorType }, | 26 | Error{ what: ErrorType }, |
| 27 | EOS, | ||
| 28 | } | 27 | } |
| 29 | 28 | ||
| 30 | #[derive(Copy,Clone)] | 29 | #[derive(Copy,Clone)] |
| @@ -36,7 +35,7 @@ pub struct Symbol<'a> { | |||
| 36 | 35 | ||
| 37 | impl<'a> fmt::Debug for Symbol<'a> { | 36 | impl<'a> fmt::Debug for Symbol<'a> { |
| 38 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | 37 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 39 | write!(f, "{:?} @ {}:{}", self.symbol, self.start.line, self.start.column ) | 38 | write!(f, "{:?} @ {:?}-{:?}", self.symbol, self.start, self.end ) |
| 40 | } | 39 | } |
| 41 | } | 40 | } |
| 42 | 41 | ||
| @@ -64,6 +63,7 @@ impl<'a> Symbol<'a> { | |||
| 64 | } | 63 | } |
| 65 | } | 64 | } |
| 66 | 65 | ||
| 66 | #[derive(Debug)] | ||
| 67 | enum Mode { | 67 | enum Mode { |
| 68 | Text, | 68 | Text, |
| 69 | InTag, | 69 | InTag, |
| @@ -300,6 +300,7 @@ impl<'a> Lexer<'a> { | |||
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | fn parse_end_tag(&mut self) -> Option<Symbol<'a>> { | 302 | fn parse_end_tag(&mut self) -> Option<Symbol<'a>> { |
| 303 | self.skip_ws(); | ||
| 303 | let start_pos = self.pos.clone(); | 304 | let start_pos = self.pos.clone(); |
| 304 | if let Some(chr) = self.cur() && chr == '|' { | 305 | if let Some(chr) = self.cur() && chr == '|' { |
| 305 | match self.peek() { | 306 | match self.peek() { |
