Lexer tokens are now created by the lexer

This is so positional information can be accurately embedded into them.
This commit is contained in:
2022-08-12 14:34:07 -05:00
parent accf528869
commit 856d5763d3
5 changed files with 89 additions and 70 deletions

View File

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