(source string)
| 18 | } |
| 19 | |
| 20 | func 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 | |
| 40 | func (l *State) runtimeError(message string) { |
| 41 | l.push(message) |
no outgoing calls