add src:line information to 'msg' */
| 742 | |
| 743 | /* add src:line information to 'msg' */ |
| 744 | const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, |
| 745 | int line) { |
| 746 | char buff[LUA_IDSIZE]; |
| 747 | if (src) |
| 748 | luaO_chunkid(buff, getstr(src), tsslen(src)); |
| 749 | else { /* no source available; use "?" instead */ |
| 750 | buff[0] = '?'; buff[1] = '\0'; |
| 751 | } |
| 752 | return luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); |
| 753 | } |
| 754 | |
| 755 | |
| 756 | l_noret luaG_errormsg (lua_State *L) { |
no test coverage detected