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

Method parameterList

parser.go:510–531  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

508}
509
510func (p *parser) parameterList() {
511 n, isVarArg := 0, false
512 if p.t != ')' {
513 for first := true; first || (!isVarArg && p.testNext(',')); first = false {
514 switch p.t {
515 case tkName:
516 p.function.MakeLocalVariable(p.checkName())
517 n++
518 case tkDots:
519 p.next()
520 isVarArg = true
521 default:
522 p.syntaxError("<name> or '...' expected")
523 }
524 }
525 }
526 // TODO the following lines belong in a *function method
527 p.function.f.isVarArg = isVarArg
528 p.function.AdjustLocalVariables(n)
529 p.function.f.parameterCount = p.function.activeVariableCount
530 p.function.ReserveRegisters(p.function.activeVariableCount)
531}
532
533func (p *parser) body(isMethod bool, line int) exprDesc {
534 p.function.OpenFunction(line)

Callers 1

bodyMethod · 0.95

Calls 7

checkNameMethod · 0.95
testNextMethod · 0.80
MakeLocalVariableMethod · 0.80
syntaxErrorMethod · 0.80
AdjustLocalVariablesMethod · 0.80
ReserveRegistersMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected