Simplified constant folding
This commit is contained in:
parent
818477f5c3
commit
f87cda97e2
5 changed files with 51 additions and 25 deletions
|
@ -11,9 +11,8 @@ type Expression struct {
|
|||
Parent *Expression
|
||||
Children []*Expression
|
||||
Token token.Token
|
||||
Value int
|
||||
Precedence int8
|
||||
IsFolded bool
|
||||
Foldable
|
||||
}
|
||||
|
||||
// New creates a new expression.
|
||||
|
@ -62,8 +61,8 @@ func (expr *Expression) Reset() {
|
|||
}
|
||||
|
||||
expr.Token.Reset()
|
||||
expr.Value = 0
|
||||
expr.Precedence = 0
|
||||
expr.Value = 0
|
||||
expr.IsFolded = false
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue