add src:line information to 'msg' */
| 792 | |
| 793 | /* add src:line information to 'msg' */ |
| 794 | const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, |
| 795 | int line) { |
| 796 | char buff[LUA_IDSIZE]; |
| 797 | if (src) |
| 798 | luaO_chunkid(buff, getstr(src), tsslen(src)); |
| 799 | else { /* no source available; use "?" instead */ |
| 800 | buff[0] = '?'; buff[1] = '\0'; |
| 801 | } |
| 802 | return luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); |
| 803 | } |
| 804 | |
| 805 | |
| 806 | l_noret luaG_errormsg (lua_State *L) { |
no test coverage detected