MCPcopy Index your code
hub / github.com/Shopify/go-lua / readFunction

Method readFunction

undump.go:211–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209}
210
211func (state *loadState) readFunction() (p prototype, err error) {
212 var n int32
213 if n, err = state.readInt(); err != nil {
214 return
215 }
216 p.lineDefined = int(n)
217 if n, err = state.readInt(); err != nil {
218 return
219 }
220 p.lastLineDefined = int(n)
221 var b byte
222 if b, err = state.readByte(); err != nil {
223 return
224 }
225 p.parameterCount = int(b)
226 if b, err = state.readByte(); err != nil {
227 return
228 }
229 p.isVarArg = b != 0
230 if b, err = state.readByte(); err != nil {
231 return
232 }
233 p.maxStackSize = int(b)
234 if p.code, err = state.readCode(); err != nil {
235 return
236 }
237 if p.constants, p.prototypes, err = state.readConstants(); err != nil {
238 return
239 }
240 if p.prototypes, err = state.readPrototypes(); err != nil {
241 return
242 }
243 if p.upValues, err = state.readUpValues(); err != nil {
244 return
245 }
246 var names []string
247 if p.source, p.lineInfo, p.localVariables, names, err = state.readDebug(&p); err != nil {
248 return
249 }
250 for i, name := range names {
251 p.upValues[i].name = name
252 }
253 return
254}
255
256func init() {
257 copy(header.Signature[:], Signature)

Callers 2

readPrototypesMethod · 0.95
undumpMethod · 0.80

Calls 7

readIntMethod · 0.95
readByteMethod · 0.95
readCodeMethod · 0.95
readConstantsMethod · 0.95
readPrototypesMethod · 0.95
readUpValuesMethod · 0.95
readDebugMethod · 0.95

Tested by

no test coverage detected