Warn against === and !==.

This commit is contained in:
Stephen Chung
2020-04-22 17:36:51 +08:00
parent 9a1c715aad
commit 7df36033c4
2 changed files with 32 additions and 6 deletions

View File

@@ -19,6 +19,8 @@ pub enum LexError {
MalformedChar(String),
/// An identifier is in an invalid format.
MalformedIdentifier(String),
/// Bad keyword encountered when tokenizing the script text.
ImproperKeyword(String),
}
impl Error for LexError {}
@@ -32,6 +34,7 @@ impl fmt::Display for LexError {
Self::MalformedChar(s) => write!(f, "Invalid character: '{}'", s),
Self::MalformedIdentifier(s) => write!(f, "Variable name is not proper: '{}'", s),
Self::UnterminatedString => write!(f, "Open string is not terminated"),
Self::ImproperKeyword(s) => write!(f, "{}", s),
}
}
}