Improved visibility of token groups

This commit is contained in:
Eduard Urbach 2025-01-26 12:28:38 +01:00
parent 9153a4ba30
commit ce5302a965
Signed by: eduard
GPG key ID: 49226B848C78F6C8
2 changed files with 73 additions and 73 deletions

View file

@ -25,12 +25,12 @@ func (t Token) End() Position {
// IsAssignment returns true if the token is an assignment operator.
func (t Token) IsAssignment() bool {
return t.Kind > _assignments && t.Kind < _assignmentsEnd
return t.Kind > ___ASSIGNMENTS___ && t.Kind < ___END_ASSIGNMENTS___
}
// IsComparison returns true if the token is a comparison operator.
func (t Token) IsComparison() bool {
return t.Kind > _comparisons && t.Kind < _comparisonsEnd
return t.Kind > ___COMPARISONS___ && t.Kind < ___END_COMPARISONS___
}
// IsExpressionStart returns true if the token starts an expression.
@ -40,7 +40,7 @@ func (t Token) IsExpressionStart() bool {
// IsKeyword returns true if the token is a keyword.
func (t Token) IsKeyword() bool {
return t.Kind > _keywords && t.Kind < _keywordsEnd
return t.Kind > ___KEYWORDS___ && t.Kind < ___END_KEYWORDS___
}
// IsNumeric returns true if the token is a number or rune.
@ -50,12 +50,12 @@ func (t Token) IsNumeric() bool {
// IsOperator returns true if the token is an operator.
func (t Token) IsOperator() bool {
return t.Kind > _operators && t.Kind < _operatorsEnd
return t.Kind > ___OPERATORS___ && t.Kind < ___END_OPERATORS___
}
// IsUnaryOperator returns true if the token is a unary operator.
func (t Token) IsUnaryOperator() bool {
return t.Kind > _unary && t.Kind < _unaryEnd
return t.Kind > ___UNARY___ && t.Kind < ___END_UNARY___
}
// Reset resets the token to default values.