[refactoring] update ast structure of "Argument" and "ArgumentList" nodes

This commit is contained in:
Vadym Slizov
2020-11-20 22:57:27 +02:00
parent 73d819eb6c
commit 7e2965f53b
8 changed files with 1386 additions and 1399 deletions

View File

@@ -90,7 +90,10 @@ func (n *Identifier) Accept(v NodeVisitor) {
// ArgumentList node
type ArgumentList struct {
Node
Arguments []Vertex
OpenParenthesisTkn *token.Token
Arguments []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
}
func (n *ArgumentList) Accept(v NodeVisitor) {
@@ -100,9 +103,9 @@ func (n *ArgumentList) Accept(v NodeVisitor) {
// Argument node
type Argument struct {
Node
Variadic bool
IsReference bool
Expr Vertex
VariadicTkn *token.Token
AmpersandTkn *token.Token
Expr Vertex
}
func (n *Argument) Accept(v NodeVisitor) {

View File

@@ -240,16 +240,6 @@ func (v *Dump) Argument(n *ast.Argument) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.Argument{\n")
v.printNode(n.GetNode())
if n.Variadic {
v.printIndent(v.indent)
v.print("Variadic: true,\n")
}
if n.IsReference {
v.printIndent(v.indent)
v.print("IsReference: true,\n")
}
}
func (v *Dump) StmtBreak(n *ast.StmtBreak) {