add src:line information to 'msg' */
| 631 | |
| 632 | /* add src:line information to 'msg' */ |
| 633 | const char *luaG_addinfo(lua_State *L, const char *msg, TString *src, |
| 634 | int line) { |
| 635 | char buff[LUA_IDSIZE]; |
| 636 | if (src) |
| 637 | luaO_chunkid(buff, getstr(src), LUA_IDSIZE); |
| 638 | else { /* no source available; use "?" instead */ |
| 639 | buff[0] = '?'; buff[1] = '\0'; |
| 640 | } |
| 641 | return luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); |
| 642 | } |
| 643 | |
| 644 | |
| 645 | void luaG_errormsg(lua_State *L, const char *msg) { |
no test coverage detected