Added unit test for lexer

This commit is contained in:
2022-08-10 11:28:29 -04:00
parent 245798f33d
commit 3f16d34aa1
6 changed files with 56 additions and 4 deletions

View File

@@ -73,6 +73,11 @@ func (token Token) Value () (value any) {
return token.value
}
// Equals returns whether this token is equal to another token
func (token Token) Equals (testToken Token) (match bool) {
return token == testToken
}
// Location returns the location of the token in its file.
func (token Token) Location () (location file.Location) {
return token.location