diff options
| author | ame <[email protected]> | 2023-12-30 14:38:05 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2023-12-30 14:38:05 -0600 |
| commit | 22bb79562a0f876c96d78f913a9ad221698354e6 (patch) | |
| tree | 9fe6a3e8dd73610fc0e3eec03e3c5a92c7325ed9 | |
| parent | 8c591404e3ce9a36acb5fbe26ceaf5d6f63048e5 (diff) | |
json fixes
| -rw-r--r-- | docs/io.md | 1 | ||||
| -rw-r--r-- | src/config.c | 4 | ||||
| -rw-r--r-- | src/io.c | 4 |
3 files changed, 5 insertions, 4 deletions
@@ -19,6 +19,7 @@ llib.io.pprint({a = 5, b = {9, 9, 22}}) - start_nl_at (3) - maximum depth that will be kept in-line - collapse_all (0 | false) - skip all newlines - collapse_to_memory (1 | true) - print memory address instead of ... + ### error/warn/log/debug 'accepts a string diff --git a/src/config.c b/src/config.c index 0c8a813..4f6838f 100644 --- a/src/config.c +++ b/src/config.c @@ -32,8 +32,8 @@ int l_set(lua_State* L) { key = lua_tonumber(L, -1); } *config_map[ind].value = key; - lua_pushnumber(L, 1); - return 1; + //lua_pushnumber(L, 1); + //return 1; } lua_pop(L,1); } @@ -110,7 +110,7 @@ void i_pprint(lua_State* L, int indent, int skip_indent){ for(;lua_next(L,last_idx) != 0;){ if(lua_type(L,-2) == LUA_TSTRING){ if(!skip) print_indentation(indent); - printf(" %s"color_gray": "color_reset, lua_tostring(L,-2)); + printf(" '%s'"color_gray": "color_reset, lua_tostring(L,-2)); } i_pprint(L,indent+1,1); printf(","); @@ -192,7 +192,7 @@ void json_parse(lua_State* L, str* raw){ int i = 1; for(i = 1; i != raw->len - 1; i++){ topush[0] = *(raw->c + i); - if(state == normal && (topush[0] == ' ' || topush[0] == '\n')) continue; + if(state == normal && (topush[0] == ' ' || topush[0] == '\n' || topush[0] <= 10)) continue; switch(topush[0]){ case '"': |
