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

Method parse

parser.go:655–664  ·  view source on GitHub ↗
(r io.ByteReader, name string)

Source from the content-addressed store, hash-verified

653}
654
655func (l *State) parse(r io.ByteReader, name string) *luaClosure {
656 p := &parser{scanner: scanner{r: r, lineNumber: 1, lastLine: 1, lookAheadToken: token{t: tkEOS}, l: l, source: name}}
657 f := &function{f: &prototype{source: name, maxStackSize: 2, isVarArg: true}, constantLookup: make(map[value]int), p: p, jumpPC: noJump}
658 p.function = f
659 p.mainFunction()
660 // TODO assertions about parser state
661 c := l.newLuaClosure(f.f)
662 l.push(c)
663 return c
664}
665
666func (l *State) checkMode(mode, x string) {
667 if mode != "" && !strings.Contains(mode, x[:1]) {

Callers 1

protectedParserFunction · 0.80

Calls 3

mainFunctionMethod · 0.95
newLuaClosureMethod · 0.95
pushMethod · 0.95

Tested by

no test coverage detected