Skip to content

Commit 2dee88b

Browse files
author
BirdeeHub
committed
docs(readme): readme
1 parent 57b4d41 commit 2dee88b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TOMLUA
22

33
> ⚠️ **Warning:** This is a work-in-progress!
4-
> It needs major work done.
4+
> It needs major work done as it is not yet fully spec compliant.
55
> When this package is no longer in its early development cycle, its version will be set to v1.0.0 for the initial release.
66
77
**TOMLUA** is a fast TOML parser and emitter for Lua, implemented in C. It is designed for **hot-path parsing** of TOML files into Lua tables, not for editing existing files.

src/types.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static void print_lua_stack(lua_State *L, const char *fmt, ...) {
2828
vprintf(fmt, args);
2929
printf(" ===\n");
3030
va_end(args);
31+
const size_t MAX_DISPLAY_LEN = 256;
3132
int top = lua_gettop(L);
3233
for (int i = top; i >= 1; i--) {
3334
int t = lua_type(L, i);
@@ -37,7 +38,11 @@ static void print_lua_stack(lua_State *L, const char *fmt, ...) {
3738
if (t == LUA_TSTRING || t == LUA_TNUMBER) {
3839
size_t len;
3940
const char *s = lua_tolstring(L, i, &len);
40-
printf(" -> '%.*s'", (int)len, s);
41+
if (t == LUA_TSTRING && len > MAX_DISPLAY_LEN) {
42+
printf(" -> 'string[%zu]'", len); // just show length for long strings
43+
} else {
44+
printf(" -> '%.*s'", (int)len, s);
45+
}
4146
}
4247
printf("\n");
4348
}

0 commit comments

Comments
 (0)