2015-01-11 21:38:45 +01:00
|
|
|
package ast
|
|
|
|
|
2015-01-11 22:59:24 +01:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2015-01-11 21:38:45 +01:00
|
|
|
// Concat represents a node where the result of two or more expressions are
|
|
|
|
// concatenated. The result of all expressions must be a string.
|
|
|
|
type Concat struct {
|
|
|
|
Exprs []Node
|
|
|
|
}
|
2015-01-11 22:59:24 +01:00
|
|
|
|
2015-01-12 00:26:54 +01:00
|
|
|
func (n *Concat) Accept(v Visitor) {
|
|
|
|
for _, n := range n.Exprs {
|
|
|
|
n.Accept(v)
|
|
|
|
}
|
|
|
|
|
|
|
|
v(n)
|
|
|
|
}
|
|
|
|
|
2015-01-11 22:59:24 +01:00
|
|
|
func (n *Concat) GoString() string {
|
|
|
|
return fmt.Sprintf("*%#v", *n)
|
|
|
|
}
|