Added more examples
This commit is contained in:
@ -55,14 +55,16 @@ func (expr *Expression) Count(buffer []byte, kind token.Kind, name string) uint8
|
||||
|
||||
// Reset resets all values to the default.
|
||||
func (expr *Expression) Reset() {
|
||||
for _, child := range expr.Children {
|
||||
child.Reset()
|
||||
expr.Parent = nil
|
||||
|
||||
if expr.Children != nil {
|
||||
expr.Children = expr.Children[:0]
|
||||
}
|
||||
|
||||
expr.Token.Reset()
|
||||
expr.Parent = nil
|
||||
expr.Children = expr.Children[:0]
|
||||
expr.Value = 0
|
||||
expr.Precedence = 0
|
||||
expr.IsFolded = false
|
||||
}
|
||||
|
||||
// EachLeaf iterates through all leaves in the tree.
|
||||
|
Reference in New Issue
Block a user