php5 syntax

This commit is contained in:
z7zmey
2018-02-03 20:13:11 +02:00
parent f1908571dd
commit 1d4e52ebc5
5 changed files with 651 additions and 500 deletions

View File

@@ -4,14 +4,16 @@ import "github.com/z7zmey/php-parser/walker"
// Argument node
type Argument struct {
Variadic bool // if ... before variable
Expr Node // Exression
Variadic bool // if ... before variable
IsReference bool // if & before variable
Expr Node // Exression
}
// NewArgument node constuctor
func NewArgument(Expression Node, Variadic bool) *Argument {
func NewArgument(Expression Node, Variadic bool, IsReference bool) *Argument {
return &Argument{
Variadic,
IsReference,
Expression,
}
}
@@ -19,7 +21,8 @@ func NewArgument(Expression Node, Variadic bool) *Argument {
// Attributes returns node attributes as map
func (n *Argument) Attributes() map[string]interface{} {
return map[string]interface{}{
"Variadic": n.Variadic,
"Variadic": n.Variadic,
"IsReference": n.IsReference,
}
}