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

Method checkMode

parser.go:666–671  ·  view source on GitHub ↗
(mode, x string)

Source from the content-addressed store, hash-verified

664}
665
666func (l *State) checkMode(mode, x string) {
667 if mode != "" && !strings.Contains(mode, x[:1]) {
668 l.push(fmt.Sprintf("attempt to load a %s chunk (mode is '%s')", x, mode))
669 l.throw(SyntaxError)
670 }
671}
672
673func protectedParser(l *State, r io.Reader, name, chunkMode string) error {
674 l.nonYieldableCallCount++

Callers 1

protectedParserFunction · 0.80

Calls 2

pushMethod · 0.95
throwMethod · 0.95

Tested by

no test coverage detected