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

Function chunkID

debug.go:20–38  ·  view source on GitHub ↗
(source string)

Source from the content-addressed store, hash-verified

18}
19
20func chunkID(source string) string {
21 switch source[0] {
22 case '=': // "literal" source
23 if len(source) <= idSize {
24 return source[1:]
25 }
26 return source[1:idSize]
27 case '@': // file name
28 if len(source) <= idSize {
29 return source[1:]
30 }
31 return "..." + source[1:idSize-3]
32 }
33 source = strings.Split(source, "\n")[0]
34 if l := len("[string \"...\"]"); len(source) > idSize-l {
35 return "[string \"" + source + "...\"]"
36 }
37 return "[string \"" + source + "\"]"
38}
39
40func (l *State) runtimeError(message string) {
41 l.push(message)

Callers 5

runtimeErrorMethod · 0.85
functionInfoFunction · 0.85
TestErrorFunction · 0.85
TestErrorfFunction · 0.85
scanErrorMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestErrorFunction · 0.68
TestErrorfFunction · 0.68