MCPcopy Create free account
hub / github.com/z7zmey/php-parser / printExprArrowFunction

Method printExprArrowFunction

printer/printer.go:1335–1372  ·  view source on GitHub ↗
(n node.Node)

Source from the content-addressed store, hash-verified

1333}
1334
1335func (p *Printer) printExprArrowFunction(n node.Node) {
1336 nn := n.(*expr.ArrowFunction)
1337 p.printFreeFloating(nn, freefloating.Start)
1338
1339 if nn.Static {
1340 io.WriteString(p.w, "static")
1341 }
1342 p.printFreeFloating(nn, freefloating.Static)
1343 if nn.Static && n.GetFreeFloating().IsEmpty() {
1344 io.WriteString(p.w, " ")
1345 }
1346
1347 io.WriteString(p.w, "fn")
1348 p.printFreeFloating(nn, freefloating.Function)
1349
1350 if nn.ReturnsRef {
1351 io.WriteString(p.w, "&")
1352 }
1353 p.printFreeFloating(nn, freefloating.Ampersand)
1354
1355 io.WriteString(p.w, "(")
1356 p.joinPrint(",", nn.Params)
1357 p.printFreeFloating(nn, freefloating.ParameterList)
1358 io.WriteString(p.w, ")")
1359 p.printFreeFloating(nn, freefloating.Params)
1360
1361 if nn.ReturnType != nil {
1362 io.WriteString(p.w, ":")
1363 p.Print(nn.ReturnType)
1364 }
1365 p.printFreeFloating(nn, freefloating.ReturnType)
1366
1367 io.WriteString(p.w, "=>")
1368
1369 p.printNode(nn.Expr)
1370
1371 p.printFreeFloating(nn, freefloating.End)
1372}
1373
1374func (p *Printer) printExprBitwiseNot(n node.Node) {
1375 nn := n.(*expr.BitwiseNot)

Callers 1

printNodeMethod · 0.95

Calls 6

printFreeFloatingMethod · 0.95
joinPrintMethod · 0.95
PrintMethod · 0.95
printNodeMethod · 0.95
IsEmptyMethod · 0.80
GetFreeFloatingMethod · 0.65

Tested by

no test coverage detected