add src:line information to 'msg' */
| 812 | |
| 813 | /* add src:line information to 'msg' */ |
| 814 | const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, |
| 815 | int line) { |
| 816 | char buff[LUA_IDSIZE]; |
| 817 | if (src) |
| 818 | luaO_chunkid(buff, getstr(src), tsslen(src)); |
| 819 | else { /* no source available; use "?" instead */ |
| 820 | buff[0] = '?'; buff[1] = '\0'; |
| 821 | } |
| 822 | return luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); |
| 823 | } |
| 824 | |
| 825 | |
| 826 | l_noret luaG_errormsg (lua_State *L) { |
no test coverage detected