From 0f2bd09d269862105e603a9865201f521f49490b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 8 Jun 2026 21:45:30 -0700 Subject: It works again! and more! About to change a few things: - symbols and errors will have a range not a position - remove view/output token type, those should just be View and Output structs - Figure out some formatting stuff? (add a dep? I dunno) - Move to non-quoted dot-delimeted variable references. - Add loops. - Add conditionals? - Add more! --- src/lexer.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lexer.rs') 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> { Literal(&'a str), Text(&'a str), Error{ what: ErrorType }, - EOS, } #[derive(Copy,Clone)] @@ -36,7 +35,7 @@ pub struct Symbol<'a> { impl<'a> fmt::Debug for Symbol<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:?} @ {}:{}", self.symbol, self.start.line, self.start.column ) + write!(f, "{:?} @ {:?}-{:?}", self.symbol, self.start, self.end ) } } @@ -64,6 +63,7 @@ impl<'a> Symbol<'a> { } } +#[derive(Debug)] enum Mode { Text, InTag, @@ -300,6 +300,7 @@ impl<'a> Lexer<'a> { } fn parse_end_tag(&mut self) -> Option> { + self.skip_ws(); let start_pos = self.pos.clone(); if let Some(chr) = self.cur() && chr == '|' { match self.peek() { -- cgit v1.2.3