Implemented constant folding
This commit is contained in:
@ -38,6 +38,11 @@ func (t Token) IsKeyword() bool {
|
||||
return t.Kind > _keywords && t.Kind < _keywordsEnd
|
||||
}
|
||||
|
||||
// IsNumeric returns true if the token is a number or rune.
|
||||
func (t Token) IsNumeric() bool {
|
||||
return t.Kind == Number || t.Kind == Rune
|
||||
}
|
||||
|
||||
// IsOperator returns true if the token is an operator.
|
||||
func (t Token) IsOperator() bool {
|
||||
return t.Kind > _operators && t.Kind < _operatorsEnd
|
||||
|
Reference in New Issue
Block a user