replacement for luaB_tostring() that is able to show the contents of tables (and formats numbers better, and show function prototypes) can be called directly from lua via tostring(), assuming tostring hasn't been reassigned
| 1827 | // replacement for luaB_tostring() that is able to show the contents of tables (and formats numbers better, and show function prototypes) |
| 1828 | // can be called directly from lua via tostring(), assuming tostring hasn't been reassigned |
| 1829 | static int tostring(lua_State *L) |
| 1830 | { |
| 1831 | char* str = rawToCString(L); |
| 1832 | str[strlen(str)-2] = 0; // hack: trim off the \r\n (which is there to simplify the print function's task) |
| 1833 | lua_pushstring(L, str); |
| 1834 | return 1; |
| 1835 | } |
| 1836 | |
| 1837 | // tobitstring(int value) |
| 1838 | // |
no test coverage detected