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

Method printStmtTraitUseAlias

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

Source from the content-addressed store, hash-verified

3059}
3060
3061func (p *Printer) printStmtTraitUseAlias(n node.Node) {
3062 nn := n.(*stmt.TraitUseAlias)
3063 p.printFreeFloating(nn, freefloating.Start)
3064
3065 p.Print(nn.Ref)
3066 p.printFreeFloating(nn, freefloating.Ref)
3067
3068 if nn.GetFreeFloating().IsEmpty() {
3069 io.WriteString(p.w, " ")
3070 }
3071 io.WriteString(p.w, "as")
3072
3073 if nn.Modifier != nil {
3074 if nn.Modifier.GetFreeFloating().IsEmpty() {
3075 io.WriteString(p.w, " ")
3076 }
3077 p.Print(nn.Modifier)
3078 }
3079
3080 if nn.Alias != nil {
3081 if nn.Alias.GetFreeFloating().IsEmpty() {
3082 io.WriteString(p.w, " ")
3083 }
3084 p.Print(nn.Alias)
3085 }
3086 p.printFreeFloating(nn, freefloating.Alias)
3087
3088 p.printFreeFloating(nn, freefloating.SemiColon)
3089 if n.GetFreeFloating().IsEmpty() {
3090 io.WriteString(p.w, ";")
3091 }
3092
3093 p.printFreeFloating(nn, freefloating.End)
3094}
3095
3096func (p *Printer) printStmtTraitUsePrecedence(n node.Node) {
3097 nn := n.(*stmt.TraitUsePrecedence)

Callers 1

printNodeMethod · 0.95

Calls 4

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

Tested by

no test coverage detected