Improved test coverage
This commit is contained in:
parent
c5b61c1148
commit
8464ed3df1
3 changed files with 60 additions and 15 deletions
|
@ -26,15 +26,6 @@ func NewLeaf(t token.Token) *Expression {
|
|||
return expr
|
||||
}
|
||||
|
||||
// NewBinary creates a new binary operator expression.
|
||||
func NewBinary(left *Expression, operator token.Token, right *Expression) *Expression {
|
||||
expr := New()
|
||||
expr.Token = operator
|
||||
expr.AddChild(left)
|
||||
expr.AddChild(right)
|
||||
return expr
|
||||
}
|
||||
|
||||
// AddChild adds a child to the expression.
|
||||
func (expr *Expression) AddChild(child *Expression) {
|
||||
expr.Children = append(expr.Children, child)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue