Implemented constant folding
This commit is contained in:
parent
315ad23e31
commit
67c7d1ec99
8 changed files with 118 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue