php8.1: added first class callable syntax (#18)

This commit is contained in:
Makhnev Petr
2021-07-31 23:50:59 +03:00
committed by GitHub
parent 13ed0df282
commit 50ed139750
9 changed files with 2096 additions and 2037 deletions

View File

@@ -1364,6 +1364,9 @@ func (f *formatter) ExprFunctionCall(n *ast.ExprFunctionCall) {
if len(n.Args) > 0 {
n.SeparatorTkns = f.formatList(n.Args, ',')
}
if n.EllipsisTkn != nil {
n.EllipsisTkn = f.newToken(token.T_ELLIPSIS, []byte("..."))
}
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@@ -1424,6 +1427,9 @@ func (f *formatter) ExprMethodCall(n *ast.ExprMethodCall) {
if len(n.Args) > 0 {
n.SeparatorTkns = f.formatList(n.Args, ',')
}
if n.EllipsisTkn != nil {
n.EllipsisTkn = f.newToken(token.T_ELLIPSIS, []byte("..."))
}
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@@ -1448,6 +1454,9 @@ func (f *formatter) ExprNullsafeMethodCall(n *ast.ExprNullsafeMethodCall) {
if len(n.Args) > 0 {
n.SeparatorTkns = f.formatList(n.Args, ',')
}
if n.EllipsisTkn != nil {
n.EllipsisTkn = f.newToken(token.T_ELLIPSIS, []byte("..."))
}
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@@ -1569,6 +1578,9 @@ func (f *formatter) ExprStaticCall(n *ast.ExprStaticCall) {
if len(n.Args) > 0 {
n.SeparatorTkns = f.formatList(n.Args, ',')
}
if n.EllipsisTkn != nil {
n.EllipsisTkn = f.newToken(token.T_ELLIPSIS, []byte("..."))
}
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}