Add Token::Unit.

This commit is contained in:
Stephen Chung
2022-04-21 10:04:46 +08:00
parent 299d6ef308
commit 5e4f27ae25
5 changed files with 69 additions and 34 deletions

View File

@@ -51,7 +51,8 @@ impl fmt::Display for LexError {
Self::ImproperSymbol(s, d) if d.is_empty() => {
write!(f, "Invalid symbol encountered: '{}'", s)
}
Self::ImproperSymbol(.., d) => f.write_str(d),
Self::ImproperSymbol(s, d) if s.is_empty() => f.write_str(d),
Self::ImproperSymbol(s, d) => write!(f, "{}: '{}'", d, s),
}
}
}