fix identifier -> keyword conversion

This commit is contained in:
Luna 2019-07-01 15:07:17 -03:00
parent ac23c0d2d7
commit b591ecdf9b
1 changed files with 3 additions and 3 deletions

View File

@ -249,6 +249,9 @@ pub const Scanner = struct {
_ = self.advance();
}
// ugly hack.
self.rollback();
// after reading the identifier, we check
// if it is any of our keywords, if it is, then we add
// the specificed keyword type. if not, just .IDENTIFIER
@ -261,9 +264,6 @@ pub const Scanner = struct {
toktype = TokenType.Identifier;
}
// ugly hack.
self.rollback();
return self.makeToken(toktype);
}