add src:line information to 'msg' */
| 751 | |
| 752 | /* add src:line information to 'msg' */ |
| 753 | const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, |
| 754 | int line) { |
| 755 | char buff[LUA_IDSIZE]; |
| 756 | if (src) |
| 757 | luaO_chunkid(buff, getstr(src), tsslen(src)); |
| 758 | else { /* no source available; use "?" instead */ |
| 759 | buff[0] = '?'; buff[1] = '\0'; |
| 760 | } |
| 761 | return luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); |
| 762 | } |
| 763 | |
| 764 | |
| 765 | l_noret luaG_errormsg (lua_State *L) { |
no test coverage detected