MCPcopy Create free account
hub / github.com/google/gapid / WriteFunction

Method WriteFunction

gapil/semantic/printer/printer.go:87–112  ·  view source on GitHub ↗

WriteFunction appends the string representation of f to the Printer's buffer.

(f *semantic.Function)

Source from the content-addressed store, hash-verified

85// WriteFunction appends the string representation of f to the Printer's
86// buffer.
87func (p *Printer) WriteFunction(f *semantic.Function) *Printer {
88 p.WriteString("// order: ")
89 p.WriteString(f.Order.String())
90 p.WriteString("¶")
91 switch {
92 case f.Extern:
93 p.WriteString("extern ")
94 case f.Subroutine:
95 p.WriteString("sub ")
96 default:
97 p.WriteString("cmd ")
98 }
99 p.WriteType(f.Signature.Return)
100 p.WriteRune(' ')
101 p.WriteString(f.Name())
102 p.WriteRune('(')
103 params := f.CallParameters()
104 p.list(params, func(param *semantic.Parameter) {
105 p.WriteType(param.Type)
106 p.WriteRune(' ')
107 p.WriteString(param.Name())
108 })
109 p.WriteString(") ")
110 p.WriteStatement(f.Block)
111 return p
112}
113
114// WriteExpression appends the string representation of n to the Printer's
115// buffer.

Callers 3

checkMethod · 0.80
TestExtractCallsFunction · 0.80
TestInsertFenceFunction · 0.80

Calls 8

WriteStringMethod · 0.95
WriteTypeMethod · 0.95
WriteRuneMethod · 0.95
listMethod · 0.95
WriteStatementMethod · 0.95
CallParametersMethod · 0.80
StringMethod · 0.65
NameMethod · 0.65

Tested by 3

checkMethod · 0.64
TestExtractCallsFunction · 0.64
TestInsertFenceFunction · 0.64