Nim
Nim copied to clipboard
Serializing Table to json causes segfault
Description
The code below wold cause error
import std/[json, jsonutils, tables]
echo $({ 1: "v".to_json }.to_table.to_json)
Nim Version
Nim Compiler Version 1.6.12 [MacOSX: amd64] Compiled at 2023-03-10 Copyright (c) 2006-2023 by Andreas Rumpf
active boot switches: -d:release -d:nimUseLinenoise
Current Output
Traceback (most recent call last)
/alex/projects/nim/play.nim(5) play
/usr/local/Cellar/nim/1.6.12/nim/lib/pure/json.nim(820) $
/usr/local/Cellar/nim/1.6.12/nim/lib/pure/json.nim(718) toUgly
/usr/local/Cellar/nim/1.6.12/nim/lib/pure/json.nim(711) toUgly
/usr/local/Cellar/nim/1.6.12/nim/lib/pure/json.nim(718) toUgly
/usr/local/Cellar/nim/1.6.12/nim/lib/pure/json.nim(708) toUgly
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed
Expected Output
No response
Possible Solution
No response
Additional Information
Also a minor thing, it produces incorrect json, try code below and instead of {"1":"v"}
it dumps internal state of the table. Strictly speaking using numbers as keys for table is not a valid json, so not insisting, feel free to close as wontfix.
import std/[json, jsonutils, tables]
echo $({ 1: "v" }.to_table.to_json)
If you patch toUgly
to render nil
JsonNodes into <nil>
, you get:
{"data":[{"hcode":0,"key":0,"val":<nil>},{"hcode":0,"key":0,"val":<nil>},{"hcode":0,"key":0,"val":<nil>},{"hcode":0,"key":0,"val":<nil>},{"hcode":0,"key":0,"val":<nil>},{"hcode":8641844181895329213,"key":1,"val":"v"},{"hcode":0,"key":0,"val":<nil>},{"hcode":0,"key":0,"val":<nil>}],"counter":1}
The type serialized here is Table[int, JsonNode]
and there are nil
values of JsonNode
inside the table object, which seemingly do not get serialized into null
(although if this happened they might get deserialized into JNull
nodes).
!nim c
import std/[json, jsonutils, tables]
echo {9:"X".toJson}.toTable.toJson
@juancarlospaco (contributor)devel :-1: FAIL
Output
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Traceback (most recent call last)
/home/runner/work/Nim/Nim/temp.nim temp
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/json.nim $
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/json.nim toUgly
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp'
Stats
- Created
2023-07-07T00:09:40Z
- Started
2023-07-07T00:10:15
- Finished
2023-07-07T00:10:17
- Duration
1 minute
- Commands
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ;
typedef struct tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA;
typedef struct tySequence__b0TYNliVF4mDRMoPnM9b0Ig tySequence__b0TYNliVF4mDRMoPnM9b0Ig;
typedef struct tySequence__b0TYNliVF4mDRMoPnM9b0Ig_Content tySequence__b0TYNliVF4mDRMoPnM9b0Ig_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_OrderedTable__zciNbPTK5JK5nQk2wIvn9cQ tyObject_OrderedTable__zciNbPTK5JK5nQk2wIvn9cQ;
typedef struct tySequence__9c3cQyAPzkDhKGWWIUhEylQ tySequence__9c3cQyAPzkDhKGWWIUhEylQ;
typedef struct tySequence__9c3cQyAPzkDhKGWWIUhEylQ_Content tySequence__9c3cQyAPzkDhKGWWIUhEylQ_Content;
typedef struct tySequence__XIqKMXs9c6VBYxftWVH9aJcg tySequence__XIqKMXs9c6VBYxftWVH9aJcg;
typedef struct tySequence__XIqKMXs9c6VBYxftWVH9aJcg_Content tySequence__XIqKMXs9c6VBYxftWVH9aJcg_Content;
typedef struct tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A;
typedef struct tyTuple__zXq2yaF49aAHOIbYUMN9cg6g tyTuple__zXq2yaF49aAHOIbYUMN9cg6g;
typedef struct tyTuple__gE3jVc60u8s9aNqDmRx07JQ tyTuple__gE3jVc60u8s9aNqDmRx07JQ;
typedef struct tyTuple__Mx7Ugsvovkuhldj7za4kYw tyTuple__Mx7Ugsvovkuhldj7za4kYw;
struct tySequence__b0TYNliVF4mDRMoPnM9b0Ig {
NI len; tySequence__b0TYNliVF4mDRMoPnM9b0Ig_Content* p;
};
struct tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA {
tySequence__b0TYNliVF4mDRMoPnM9b0Ig data;
NI counter;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NU8 tyEnum_JsonNodeKind__Pjv0YbVnULzyjRUFfWRQdA;
struct tySequence__9c3cQyAPzkDhKGWWIUhEylQ {
NI len; tySequence__9c3cQyAPzkDhKGWWIUhEylQ_Content* p;
};
struct tyObject_OrderedTable__zciNbPTK5JK5nQk2wIvn9cQ {
tySequence__9c3cQyAPzkDhKGWWIUhEylQ data;
NI counter;
NI first;
NI last;
};
struct tySequence__XIqKMXs9c6VBYxftWVH9aJcg {
NI len; tySequence__XIqKMXs9c6VBYxftWVH9aJcg_Content* p;
};
struct tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ {
NIM_BOOL isUnquoted;
tyEnum_JsonNodeKind__Pjv0YbVnULzyjRUFfWRQdA kind;
union{
struct { NimStringV2 str;
} _kind_1;
struct { NI64 num;
} _kind_2;
struct { NF fnum;
} _kind_3;
struct { NIM_BOOL bval;
} _kind_4;
struct { tyObject_OrderedTable__zciNbPTK5JK5nQk2wIvn9cQ fields;
} _kind_6;
struct { tySequence__XIqKMXs9c6VBYxftWVH9aJcg elems;
} _kind_7;
};
};
typedef NU8 tyEnum_EnumMode__SuNK0YgatOwX9b9cfxxn0iaA;
typedef NU8 tyEnum_JsonNodeMode__9bYbU0JrO9cxyGmPUrtSFubQ;
struct tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A {
tyEnum_EnumMode__SuNK0YgatOwX9b9cfxxn0iaA enumMode;
tyEnum_JsonNodeMode__9bYbU0JrO9cxyGmPUrtSFubQ jsonNodeMode;
};
struct tyTuple__zXq2yaF49aAHOIbYUMN9cg6g {
NI Field0;
tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* Field1;
};
typedef tyTuple__zXq2yaF49aAHOIbYUMN9cg6g tyArray__PgRsM3wiBCyP9clenwPq1tw[1];
struct tyTuple__gE3jVc60u8s9aNqDmRx07JQ {
NI Field0;
NI Field1;
tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* Field2;
};
struct tySequence__b0TYNliVF4mDRMoPnM9b0Ig_Content { NI cap; tyTuple__gE3jVc60u8s9aNqDmRx07JQ data[SEQ_DECL_SIZE]; };
struct tyTuple__Mx7Ugsvovkuhldj7za4kYw {
NI Field0;
NI Field1;
NimStringV2 Field2;
tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* Field3;
};
struct tySequence__9c3cQyAPzkDhKGWWIUhEylQ_Content { NI cap; tyTuple__Mx7Ugsvovkuhldj7za4kYw data[SEQ_DECL_SIZE]; };
struct tySequence__XIqKMXs9c6VBYxftWVH9aJcg_Content { NI cap; tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* data[SEQ_DECL_SIZE]; };
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___pureZjson_u5234)(tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* node_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ*, toJson__temp_u1615)(tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA a_p0, tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A opt_p1);
N_LIB_PRIVATE N_NIMCALL(tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA, toTable__temp_u8)(tyTuple__zXq2yaF49aAHOIbYUMN9cg6g* pairs_p0, NI pairs_p0Len_0);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ*, toJson__stdZjsonutils_u647)(NimStringV2 a_p0, tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A opt_p1);
N_LIB_PRIVATE N_NIMCALL(tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A, initToJsonOptions__stdZjsonutils_u34)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, dealloc)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZjson_u359)(tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u1578)(tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4483)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[1+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 1 | NIM_STRLIT_FLAG, "X" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {1, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_BOOL nimInErrorMode__system_u4265;
extern TFrame* framePtr__system_u3877;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__system_u4265);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u3877 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u3877).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u3877;
framePtr__system_u3877 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4483();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u3877 = (*framePtr__system_u3877).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* colontmpD_;
tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA colontmpD__2;
tyObject_JsonNodeObj__aTcKIsvwvxDDYCy9bK0qdmQ* colontmpD__3;
NimStringV2 colontmpD__4;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
tyArray__PgRsM3wiBCyP9clenwPq1tw T3_;
tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A T4_;
tyObject_ToJsonOptions__zJfLW9bueEbl9avflmL1Ex6A T5_;
NIM_BOOL oldNimErrFin1_;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
colontmpD_ = NIM_NIL;
nimZeroMem((void*)(&colontmpD__2), sizeof(tyObject_Table__TUlJVlM3zeSJcb0veXh9cmA));
colontmpD__3 = NIM_NIL;
colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL;
nimZeroMem((void*)T3_, sizeof(tyArray__PgRsM3wiBCyP9clenwPq1tw));
T3_[0].Field0 = ((NI)9);
T4_ = initToJsonOptions__stdZjsonutils_u34();
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
colontmpD_ = toJson__stdZjsonutils_u647(TM__SRd76hP9cMfCzdUO857UhQQ_3, T4_);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T3_[0].Field1 = colontmpD_;
colontmpD__2 = toTable__temp_u8(T3_, 1);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T5_ = initToJsonOptions__stdZjsonutils_u34();
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
colontmpD__3 = toJson__temp_u1615(colontmpD__2, T5_);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
colontmpD__4 = dollar___pureZjson_u5234(colontmpD__3);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = colontmpD__4;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
oldNimErrFin1_ = *nimErr_; *nimErr_ = NIM_FALSE;
if (colontmpD__4.p && !(colontmpD__4.p->cap & NIM_STRLIT_FLAG)) {
dealloc(colontmpD__4.p);
}
eqdestroy___pureZjson_u359(colontmpD__3);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
eqdestroy___temp_u1578((&colontmpD__2));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
eqdestroy___pureZjson_u359(colontmpD_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
*nimErr_ = oldNimErrFin1_;
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
AST
nnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
nnkBracket.newTree(
newIdentNode("json"),
newIdentNode("jsonutils"),
newIdentNode("tables")
)
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkTableConstr.newTree(
nnkExprColonExpr.newTree(
newLit(9),
nnkDotExpr.newTree(
newLit("X"),
newIdentNode("toJson")
)
)
),
newIdentNode("toTable")
),
newIdentNode("toJson")
)
)
)
stable :-1: FAIL
Output
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Traceback (most recent call last)
/home/runner/work/Nim/Nim/temp.nim temp
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/json.nim $
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/pure/json.nim toUgly
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp '
Stats
- Created
2023-07-07T00:09:40Z
- Started
2023-07-07T00:10:18
- Finished
2023-07-07T00:10:19
- Duration
1 minute
- Commands
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg;
typedef struct tyObject_Table__YdDi40fmla9aMS4DAejDISQ tyObject_Table__YdDi40fmla9aMS4DAejDISQ;
typedef struct tySequence__5FlzKD9bFitYO9cNledb2Z9bA tySequence__5FlzKD9bFitYO9cNledb2Z9bA;
typedef struct tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg;
typedef struct tyTuple__nn0vUYDsGlbEPIV3CKVqaw tyTuple__nn0vUYDsGlbEPIV3CKVqaw;
typedef struct tyTuple__igbW9ak6RCv5v9cBQZvBzHSg tyTuple__igbW9ak6RCv5v9cBQZvBzHSg;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NimStringDesc* tyArray__nHXaesL0DJZHyVS07ARPRA[1];
struct tyObject_Table__YdDi40fmla9aMS4DAejDISQ {
tySequence__5FlzKD9bFitYO9cNledb2Z9bA* data;
NI counter;
};
typedef NU8 tyEnum_EnumMode__nydMKqpqwPKw85NqaN3bkQ;
typedef NU8 tyEnum_JsonNodeMode__W9c6T1a8oFULaavFr24u1Cg;
struct tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg {
tyEnum_EnumMode__nydMKqpqwPKw85NqaN3bkQ enumMode;
tyEnum_JsonNodeMode__W9c6T1a8oFULaavFr24u1Cg jsonNodeMode;
};
struct tyTuple__igbW9ak6RCv5v9cBQZvBzHSg {
NI Field0;
NI Field1;
tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg* Field2;
};
typedef NU8 tyEnum_TNimKind__3rC59cFdCULJbp2tHLSZMXQ;
typedef NU8 tySet_tyEnum_TNimTypeFlag__z9aX9aBGjlpDIC58y9bKcsmzA;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
NI align;
tyEnum_TNimKind__3rC59cFdCULJbp2tHLSZMXQ kind;
tySet_tyEnum_TNimTypeFlag__z9aX9aBGjlpDIC58y9bKcsmzA flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__XtzEyxd2A8uwMJcYYak9c7w;
struct TNimNode {
tyEnum_TNimNodeKind__XtzEyxd2A8uwMJcYYak9c7w kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct tyTuple__nn0vUYDsGlbEPIV3CKVqaw {
NI Field0;
tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg* Field1;
};
typedef tyTuple__nn0vUYDsGlbEPIV3CKVqaw tyArray__QDJFz74yyD3sY2ZQehcXkw[1];
struct tySequence__5FlzKD9bFitYO9cNledb2Z9bA {
TGenericSeq Sup;
tyTuple__igbW9ak6RCv5v9cBQZvBzHSg data[SEQ_DECL_SIZE];
};
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___pureZjson_4562)(tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg* node);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg*, toJson__temp_1378)(tyObject_Table__YdDi40fmla9aMS4DAejDISQ a, tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg opt);
N_LIB_PRIVATE N_NIMCALL(void, toTable__temp_8)(tyTuple__nn0vUYDsGlbEPIV3CKVqaw* pairs, NI pairsLen_0, tyObject_Table__YdDi40fmla9aMS4DAejDISQ* Result);
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tySequence__5FlzKD9bFitYO9cNledb2Z9bA)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg*, toJson__stdZjsonutils_621)(NimStringDesc* a, tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg, initToJsonOptions__stdZjsonutils_33)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_2997)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatsjsondotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatstimesdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatstimesdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmtempdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE TNimType NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_;
extern TNimType NTIint__rR5Bzr1D5krxoo1NcNyeMA_;
extern TNimType NTIjsonnode__EHRvIlTmtWXPzhH2R7eROQ_;
N_LIB_PRIVATE TNimType NTIkeyvaluepairseq__5FlzKD9bFitYO9cNledb2Z9bA_;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "X", 1);
extern TFrame* framePtr__system_2564;
extern TFrame* framePtr__system_2564;
extern TFrame* framePtr__system_2564;
extern TFrame* framePtr__system_2564;
extern TFrame* framePtr__system_2564;
extern TFrame* framePtr__system_2564;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__systemZmemory_7(p, ((int) 0), size);
}
static N_NIMCALL(void, Marker_tySequence__5FlzKD9bFitYO9cNledb2Z9bA)(void* p, NI op) {
tySequence__5FlzKD9bFitYO9cNledb2Z9bA* a;
NI T1_;
a = (tySequence__5FlzKD9bFitYO9cNledb2Z9bA*)p;
T1_ = (NI)0;
for (T1_ = 0; T1_ < (a ? a->Sup.len : 0); T1_++) {
nimGCvisit((void*)a->data[T1_].Field2, op);
}
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__system_2564 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__system_2564).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__system_2564;
framePtr__system_2564 = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__system_2997();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_2564 = (*framePtr__system_2564).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatstimesdotnim_Init000();
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000();
initStackBottomWith((void *)&inner);
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatsjsondotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatstimesdotnim_DatInit000();
atmtempdotnim_DatInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyArray__nHXaesL0DJZHyVS07ARPRA T1_;
tyArray__QDJFz74yyD3sY2ZQehcXkw T2_;
tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg T3_;
tyObject_Table__YdDi40fmla9aMS4DAejDISQ T4_;
tyObject_ToJsonOptions__sY3kt7y8VnTxUAvZv1DeWg T5_;
tyObject_JsonNodeObj__YU09c0CZ4AhB3Q82XHzM2Tg* T6_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimZeroMem((void*)T1_, sizeof(tyArray__nHXaesL0DJZHyVS07ARPRA));
nimZeroMem((void*)T2_, sizeof(tyArray__QDJFz74yyD3sY2ZQehcXkw));
T2_[0].Field0 = ((NI) 9);
T3_ = initToJsonOptions__stdZjsonutils_33();
T2_[0].Field1 = toJson__stdZjsonutils_621(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3), T3_);
nimZeroMem((void*)(&T4_), sizeof(tyObject_Table__YdDi40fmla9aMS4DAejDISQ));
toTable__temp_8(T2_, 1, (&T4_));
T5_ = initToJsonOptions__stdZjsonutils_33();
T6_ = NIM_NIL;
T6_ = toJson__temp_1378(T4_, T5_);
T1_[0] = dollar___pureZjson_4562(T6_);
echoBinSafe(T1_, 1);
popFrame();
}
}
N_LIB_PRIVATE N_NIMCALL(void, atmtempdotnim_DatInit000)(void) {
static TNimNode* TM__SRd76hP9cMfCzdUO857UhQQ_2_3[3];
static TNimNode TM__SRd76hP9cMfCzdUO857UhQQ_0[4];
NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_.size = sizeof(tyTuple__igbW9ak6RCv5v9cBQZvBzHSg);
NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_.align = NIM_ALIGNOF(tyTuple__igbW9ak6RCv5v9cBQZvBzHSg);
NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_.kind = 18;
NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_.base = 0;
NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_.flags = 2;
TM__SRd76hP9cMfCzdUO857UhQQ_2_3[0] = &TM__SRd76hP9cMfCzdUO857UhQQ_0[1];
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].kind = 1;
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].offset = offsetof(tyTuple__igbW9ak6RCv5v9cBQZvBzHSg, Field0);
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].typ = (&NTIint__rR5Bzr1D5krxoo1NcNyeMA_);
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].name = "Field0";
TM__SRd76hP9cMfCzdUO857UhQQ_2_3[1] = &TM__SRd76hP9cMfCzdUO857UhQQ_0[2];
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].kind = 1;
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].offset = offsetof(tyTuple__igbW9ak6RCv5v9cBQZvBzHSg, Field1);
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].typ = (&NTIint__rR5Bzr1D5krxoo1NcNyeMA_);
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].name = "Field1";
TM__SRd76hP9cMfCzdUO857UhQQ_2_3[2] = &TM__SRd76hP9cMfCzdUO857UhQQ_0[3];
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].kind = 1;
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].offset = offsetof(tyTuple__igbW9ak6RCv5v9cBQZvBzHSg, Field2);
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].typ = (&NTIjsonnode__EHRvIlTmtWXPzhH2R7eROQ_);
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].name = "Field2";
TM__SRd76hP9cMfCzdUO857UhQQ_0[0].len = 3; TM__SRd76hP9cMfCzdUO857UhQQ_0[0].kind = 2; TM__SRd76hP9cMfCzdUO857UhQQ_0[0].sons = &TM__SRd76hP9cMfCzdUO857UhQQ_2_3[0];
NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_.node = &TM__SRd76hP9cMfCzdUO857UhQQ_0[0];
NTIkeyvaluepairseq__5FlzKD9bFitYO9cNledb2Z9bA_.size = sizeof(tySequence__5FlzKD9bFitYO9cNledb2Z9bA*);
NTIkeyvaluepairseq__5FlzKD9bFitYO9cNledb2Z9bA_.align = NIM_ALIGNOF(tySequence__5FlzKD9bFitYO9cNledb2Z9bA*);
NTIkeyvaluepairseq__5FlzKD9bFitYO9cNledb2Z9bA_.kind = 24;
NTIkeyvaluepairseq__5FlzKD9bFitYO9cNledb2Z9bA_.base = (&NTIkeyvaluepair__igbW9ak6RCv5v9cBQZvBzHSg_);
NTIkeyvaluepairseq__5FlzKD9bFitYO9cNledb2Z9bA_.flags = 2;
NTIkeyvaluepairseq__5FlzKD9bFitYO9cNledb2Z9bA_.marker = Marker_tySequence__5FlzKD9bFitYO9cNledb2Z9bA;
}
AST
nnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
nnkBracket.newTree(
newIdentNode("json"),
newIdentNode("jsonutils"),
newIdentNode("tables")
)
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkTableConstr.newTree(
nnkExprColonExpr.newTree(
newLit(9),
nnkDotExpr.newTree(
newLit("X"),
newIdentNode("toJson")
)
)
),
newIdentNode("toTable")
),
newIdentNode("toJson")
)
)
)
1.6.0 :-1: FAIL
Output
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Traceback (most recent call last)
/home/runner/work/Nim/Nim/temp.nim temp
/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/json.nim $
/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/json.nim toUgly
/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/json.nim toUgly
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp '
Stats
- Created
2023-07-07T00:09:40Z
- Started
2023-07-07T00:10:22
- Finished
2023-07-07T00:10:24
- Duration
1 minute
- Commands
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q;
typedef struct tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw;
typedef struct tySequence__5Ga1D66I0eFcTv1wGMgxVA tySequence__5Ga1D66I0eFcTv1wGMgxVA;
typedef struct tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ;
typedef struct tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg;
typedef struct tySequence__MlAD6nAPq9bHKla9cWiIZP0g tySequence__MlAD6nAPq9bHKla9cWiIZP0g;
typedef struct tySequence__oLpBKXzW3hF9aCVMo5EymfQ tySequence__oLpBKXzW3hF9aCVMo5EymfQ;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyTuple__rqELgnZHaqWR0LOe7Lm7lQ tyTuple__rqELgnZHaqWR0LOe7Lm7lQ;
typedef struct tyTuple__awOivLjlO76sGdHY7nQUjQ tyTuple__awOivLjlO76sGdHY7nQUjQ;
typedef struct tyTuple__rwWrjn23eYSTMhtcUuqyIQ tyTuple__rwWrjn23eYSTMhtcUuqyIQ;
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NimStringDesc* tyArray__nHXaesL0DJZHyVS07ARPRA[1];
struct tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw {
tySequence__5Ga1D66I0eFcTv1wGMgxVA* data;
NI counter;
};
typedef NU8 tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg;
typedef NU8 tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ;
struct tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ {
tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg enumMode;
tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ jsonNodeMode;
};
typedef NU8 tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg;
struct tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg {
tySequence__MlAD6nAPq9bHKla9cWiIZP0g* data;
NI counter;
NI first;
NI last;
};
struct tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q {
NIM_BOOL isUnquoted;
tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg kind;
union{
struct {NimStringDesc* str;
} _kind_1;
struct {NI64 num;
} _kind_2;
struct {NF fnum;
} _kind_3;
struct {NIM_BOOL bval;
} _kind_4;
struct {tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg fields;
} _kind_6;
struct {tySequence__oLpBKXzW3hF9aCVMo5EymfQ* elems;
} _kind_7;
};
};
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
NI align;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct tyTuple__rqELgnZHaqWR0LOe7Lm7lQ {
NI Field0;
NI Field1;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field2;
};
typedef NimStringDesc* tyArray__DLxB9cOndPvLDyky9bY9ccM3g[7];
struct tyTuple__awOivLjlO76sGdHY7nQUjQ {
NI Field0;
NI Field1;
NimStringDesc* Field2;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field3;
};
struct tyTuple__rwWrjn23eYSTMhtcUuqyIQ {
NI Field0;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field1;
};
struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
typedef tyTuple__rwWrjn23eYSTMhtcUuqyIQ tyArray__AkUi9b3wZe4og9ahIKMIHS1Q[1];
struct tySequence__5Ga1D66I0eFcTv1wGMgxVA {
TGenericSeq Sup;
tyTuple__rqELgnZHaqWR0LOe7Lm7lQ data[SEQ_DECL_SIZE];
};
struct tySequence__oLpBKXzW3hF9aCVMo5EymfQ {
TGenericSeq Sup;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* data[SEQ_DECL_SIZE];
};
struct tySequence__MlAD6nAPq9bHKla9cWiIZP0g {
TGenericSeq Sup;
tyTuple__awOivLjlO76sGdHY7nQUjQ data[SEQ_DECL_SIZE];
};
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem_systemZmemory_7)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar__pureZjson_4542)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* node);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1378)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, newJObject_pureZjson_91)(void);
static N_INLINE(void, X5BX5Deq__pureZjson_1932)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* obj, NimStringDesc* key, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* val);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl_systemZassertions_56)(NimStringDesc* msg);
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq__pureZjson_290)(tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg* t, NimStringDesc* key, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* val);
N_LIB_PRIVATE N_NOINLINE(void, raiseFieldError2)(NimStringDesc* f, NimStringDesc* discVal);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, reprDiscriminant)(NI e, TNimType* typ);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached_system_2997)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1447)(tySequence__5Ga1D66I0eFcTv1wGMgxVA* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, newJArray_pureZjson_122)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
N_LIB_PRIVATE N_NIMCALL(void, add_pureZjson_221)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* father, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* child);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1532)(tyTuple__rqELgnZHaqWR0LOe7Lm7lQ a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1601)(NI a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, percent__pureZjson_1809)(NI n);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1615)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, copy_pureZjson_4334)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* p);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, newJNull_pureZjson_89)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1627)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1640)(NIM_BOOL a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, percent__pureZjson_1825)(NIM_BOOL b);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1649)(tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_stdZjsonutils_620)(NimStringDesc* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, symbolName_temp_1665)(tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg a);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, reprEnum)(NI e, TNimType* typ);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1777)(NI64 a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, percent__pureZjson_1819)(NI64 n);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1787)(NF a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, percent__pureZjson_1822)(NF n);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1802)(tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJsonHook_temp_1879)(tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg* t);
static N_INLINE(NI, len_pureZjson_2162)(tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg* t);
static N_INLINE(NIM_BOOL, isFilled_pureZcollectionsZtables_31)(NI hcode);
N_LIB_PRIVATE N_NIMCALL(tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ, initToJsonOptions_stdZjsonutils_33)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1895)(tySequence__oLpBKXzW3hF9aCVMo5EymfQ* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt);
N_LIB_PRIVATE N_NIMCALL(void, toTable_temp_8)(tyTuple__rwWrjn23eYSTMhtcUuqyIQ* pairs, NI pairsLen_0, tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* Result);
N_LIB_PRIVATE N_NIMCALL(void, initTable_temp_18)(NI initialSize, tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* Result);
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
static N_INLINE(NI, slotsNeeded_pureZcollectionsZtables_42)(NI count);
N_LIB_PRIVATE N_NIMCALL(NI, nextPowerOfTwo_pureZmath_181)(NI x);
N_LIB_PRIVATE N_NOINLINE(void, raiseDivByZero)(void);
static N_INLINE(NIM_BOOL, nimDivInt)(NI a, NI b, NI* res);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b);
N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tySequence__5Ga1D66I0eFcTv1wGMgxVA)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq__temp_95)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* t, NI key, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* val);
static N_INLINE(NI, rawGet_temp_156)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw t, NI key, NI* hc);
static N_INLINE(NI, hash_pureZhashes_128)(NI x);
static N_INLINE(NI, hashWangYi1_pureZhashes_136)(NU64 x);
static N_INLINE(NU64, hiXorLo_pureZhashes_79)(NU64 a, NU64 b);
static N_INLINE(NI, nextTry_pureZcollectionsZtables_34)(NI h, NI maxHash);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef_system_5337)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, pluspercent__system_696)(NI x, NI y);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_system_5299)(void* usr);
static N_INLINE(NI, minuspercent__system_716)(NI x, NI y);
static N_INLINE(void, decRef_system_5344)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NIM_BOOL, ltpercent__system_1005)(NI x, NI y);
static N_INLINE(void, rtlAddZCT_system_5342)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT_system_5293)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NIM_BOOL, mustRehash_temp_495)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw t);
N_LIB_PRIVATE N_NIMCALL(void, enlarge_temp_650)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* t);
N_LIB_PRIVATE N_NIMCALL(void, rawInsert_temp_954)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* t, tySequence__5Ga1D66I0eFcTv1wGMgxVA** data, NI key, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* val, NI hc, NI h);
static N_INLINE(NI, rawGetKnownHC_temp_1123)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw t, NI key, NI hc);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_jsonDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, tempDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/json.nim(389, 9) `obj.kind == JObject` ", 93);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "field \'fields\' is not accessible for type \'JsonNodeObj\' using \'kind = ", 70);
extern TNimType NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "data", 4);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "hcode", 5);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_6, "key", 3);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_7, "val", 3);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_8, "isUnquoted", 10);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_9, "kind", 4);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_10, "JNull", 5);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_11, "JBool", 5);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_12, "JInt", 4);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_13, "JFloat", 6);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_14, "JString", 7);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_15, "JObject", 7);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_16, "JArray", 6);
N_LIB_PRIVATE NIM_CONST tyArray__DLxB9cOndPvLDyky9bY9ccM3g names_temp_1679 = {((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_10),
((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_11),
((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_12),
((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_13),
((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_14),
((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_15),
((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_16)}
;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_18, "str", 3);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_19, "field \'str\' is not accessible for type \'JsonNodeObj\' using \'kind = ", 67);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_20, "num", 3);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_21, "field \'num\' is not accessible for type \'JsonNodeObj\' using \'kind = ", 67);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_22, "fnum", 4);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_23, "field \'fnum\' is not accessible for type \'JsonNodeObj\' using \'kind = ", 68);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_24, "bval", 4);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_25, "field \'bval\' is not accessible for type \'JsonNodeObj\' using \'kind = ", 68);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_26, "fields", 6);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_27, "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/tables.nim(1720, 11) `len(t) == L` the length of the table changed while iterating over it", 156);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_28, "elems", 5);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_30, "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it", 146);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_31, "field \'elems\' is not accessible for type \'JsonNodeObj\' using \'kind = ", 69);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_33, "counter", 7);
N_LIB_PRIVATE TNimType NTIkeyvaluepair__rqELgnZHaqWR0LOe7Lm7lQ_;
extern TNimType NTIint__rR5Bzr1D5krxoo1NcNyeMA_;
extern TNimType NTIjsonnode__zfzzuQ8txrdZAYK0WGWpHg_;
N_LIB_PRIVATE TNimType NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_40, "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/hashcommon.nim(29, 9) `\012t.counter < t.dataLen` ", 113);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_50, "X", 1);
extern TFrame* framePtr_system_2564;
extern TFrame* framePtr_system_2564;
extern TFrame* framePtr_system_2564;
extern TFrame* framePtr_system_2564;
extern TFrame* framePtr_system_2564;
extern TFrame* framePtr_system_2564;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch_system_5246;
static N_INLINE(void, nimSetMem_systemZmemory_7)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem_systemZmemory_7(p, ((int) 0), size);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr_system_2564 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr_system_2564).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr_system_2564;
framePtr_system_2564 = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached_system_2997();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr_system_2564 = (*framePtr_system_2564).prev;
}
static N_INLINE(void, X5BX5Deq__pureZjson_1932)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* obj, NimStringDesc* key, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* val) {
nimfr_("[]=", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/json.nim");
{
if (!!(((*obj).kind == ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 5)))) goto LA3_;
failedAssertImpl_systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2));
}
LA3_: ;
if (!(((32 &((NU8)1<<((NU)((*obj).kind)&7U)))!=0))) { raiseFieldError2(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3), reprDiscriminant(((NI)(*obj).kind) + (NI)IL64(0), (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_))); }
X5BX5Deq__pureZjson_290((&(*obj)._kind_6.fields), key, val);
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1601)(NI a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = percent__pureZjson_1809(a);
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1640)(NIM_BOOL a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = percent__pureZjson_1825(a);
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, symbolName_temp_1665)(tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg a) {
NimStringDesc* result;
NI TM__SRd76hP9cMfCzdUO857UhQQ_17;
nimfr_("symbolName", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/enumutils.nim");
result = (NimStringDesc*)0;
if (nimSubInt(a, ((NI) 0), &TM__SRd76hP9cMfCzdUO857UhQQ_17)) { raiseOverflow(); };
if ((NU)((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_17)) > (NU)(6)){ raiseIndexError2((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_17), 6); }
result = copyString(names_temp_1679[((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_17))- 0]);
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1649)(tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
switch (opt.enumMode) {
case ((tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg) 0):
{
result = percent__pureZjson_1809(a);
}
break;
case ((tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg) 1):
{
NimStringDesc* T3_;
T3_ = (NimStringDesc*)0;
T3_ = symbolName_temp_1665(a);
result = toJson_stdZjsonutils_620(T3_, opt);
}
break;
case ((tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg) 2):
{
result = toJson_stdZjsonutils_620(reprEnum((NI)a, (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_)), opt);
}
break;
}
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1777)(NI64 a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = percent__pureZjson_1819(a);
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1787)(NF a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = percent__pureZjson_1822(a);
popFrame();
return result;
}
static N_INLINE(NI, len_pureZjson_2162)(tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg* t) {
NI result;
nimfr_("len", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/tables.nim");
result = (NI)0;
result = (*t).counter;
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, isFilled_pureZcollectionsZtables_31)(NI hcode) {
NIM_BOOL result;
nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/hashcommon.nim");
result = (NIM_BOOL)0;
result = !((hcode == ((NI) 0)));
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJsonHook_temp_1879)(tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg* t) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJsonHook", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = newJObject_pureZjson_91();
{
NimStringDesc* k;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* v;
NI L;
k = (NimStringDesc*)0;
v = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
L = len_pureZjson_2162(t);
{
NI h;
if (!(((NI) 0) < (*t).counter)) goto LA4_;
h = (*t).first;
{
while (1) {
NI nxt;
if (!(((NI) 0) <= h)) goto LA7;
if ((NU)(h) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(h,((*t).data ? (*t).data->Sup.len : 0)-1); }
nxt = (*t).data->data[h].Field1;
{
NIM_BOOL T10_;
tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ T13_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T14_;
if ((NU)(h) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(h,((*t).data ? (*t).data->Sup.len : 0)-1); }
T10_ = (NIM_BOOL)0;
T10_ = isFilled_pureZcollectionsZtables_31((*t).data->data[h].Field0);
if (!T10_) goto LA11_;
if ((NU)(h) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(h,((*t).data ? (*t).data->Sup.len : 0)-1); }
k = (*t).data->data[h].Field2;
if ((NU)(h) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(h,((*t).data ? (*t).data->Sup.len : 0)-1); }
v = (*t).data->data[h].Field3;
T13_ = initToJsonOptions_stdZjsonutils_33();
T14_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T14_ = toJson_temp_1615(v, T13_);
X5BX5Deq__pureZjson_1932(result, k, T14_);
{
NI T17_;
T17_ = (NI)0;
T17_ = len_pureZjson_2162(t);
if (!!((T17_ == L))) goto LA18_;
failedAssertImpl_systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_27));
}
LA18_: ;
}
LA11_: ;
h = nxt;
} LA7: ;
}
}
LA4_: ;
}
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1802)(tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = toJsonHook_temp_1879(a);
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1895)(tySequence__oLpBKXzW3hF9aCVMo5EymfQ* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = newJArray_pureZjson_122();
{
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q** ai;
NI i;
NI L;
NI T2_;
ai = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q**)0;
i = ((NI) 0);
T2_ = (a ? a->Sup.len : 0);
L = T2_;
{
while (1) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T5_;
NI TM__SRd76hP9cMfCzdUO857UhQQ_29;
if (!(i < L)) goto LA4;
if ((NU)(i) >= (NU)(a ? a->Sup.len : 0)){ raiseIndexError2(i,(a ? a->Sup.len : 0)-1); }
ai = &a->data[i];
T5_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T5_ = toJson_temp_1615((*ai), opt);
add_pureZjson_221(result, T5_);
if (nimAddInt(i, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_29)) { raiseOverflow(); };
i = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_29);
{
NI T8_;
T8_ = (a ? a->Sup.len : 0);
if (!!((T8_ == L))) goto LA9_;
failedAssertImpl_systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_30));
}
LA9_: ;
} LA4: ;
}
}
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1627)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T1_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T2_;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = newJObject_pureZjson_91();
T1_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T1_ = toJson_temp_1640((*a).isUnquoted, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_8), T1_);
T2_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T2_ = toJson_temp_1649((*a).kind, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_9), T2_);
switch ((*a).kind) {
case ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 4):
{
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T4_;
if (!(((16 &((NU8)1<<((NU)((*a).kind)&7U)))!=0))) { raiseFieldError2(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_19), reprDiscriminant(((NI)(*a).kind) + (NI)IL64(0), (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_))); }
T4_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T4_ = toJson_stdZjsonutils_620((*a)._kind_1.str, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_18), T4_);
}
break;
case ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 2):
{
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T6_;
if (!(((4 &((NU8)1<<((NU)((*a).kind)&7U)))!=0))) { raiseFieldError2(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_21), reprDiscriminant(((NI)(*a).kind) + (NI)IL64(0), (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_))); }
T6_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T6_ = toJson_temp_1777((*a)._kind_2.num, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_20), T6_);
}
break;
case ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 3):
{
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T8_;
if (!(((8 &((NU8)1<<((NU)((*a).kind)&7U)))!=0))) { raiseFieldError2(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_23), reprDiscriminant(((NI)(*a).kind) + (NI)IL64(0), (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_))); }
T8_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T8_ = toJson_temp_1787((*a)._kind_3.fnum, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_22), T8_);
}
break;
case ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 1):
{
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T10_;
if (!(((2 &((NU8)1<<((NU)((*a).kind)&7U)))!=0))) { raiseFieldError2(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_25), reprDiscriminant(((NI)(*a).kind) + (NI)IL64(0), (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_))); }
T10_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T10_ = toJson_temp_1640((*a)._kind_4.bval, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_24), T10_);
}
break;
case ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 0):
{
}
break;
case ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 5):
{
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T13_;
if (!(((32 &((NU8)1<<((NU)((*a).kind)&7U)))!=0))) { raiseFieldError2(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3), reprDiscriminant(((NI)(*a).kind) + (NI)IL64(0), (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_))); }
T13_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T13_ = toJson_temp_1802((&(*a)._kind_6.fields), opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_26), T13_);
}
break;
case ((tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg) 6):
{
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T15_;
if (!(((64 &((NU8)1<<((NU)((*a).kind)&7U)))!=0))) { raiseFieldError2(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_31), reprDiscriminant(((NI)(*a).kind) + (NI)IL64(0), (&NTIjsonnodekind__RUngo7nCHe6O8aBGIcrhtg_))); }
T15_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T15_ = toJson_temp_1895((*a)._kind_7.elems, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_28), T15_);
}
break;
}
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1615)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
switch (opt.jsonNodeMode) {
case ((tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ) 0):
{
result = a;
}
break;
case ((tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ) 1):
{
result = copy_pureZjson_4334(a);
}
break;
case ((tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ) 2):
{
{
if (!(a == ((tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*) NIM_NIL))) goto LA6_;
result = newJNull_pureZjson_89();
}
goto LA4_;
LA6_: ;
{
result = toJson_temp_1627((&(*a)), opt);
}
LA4_: ;
}
break;
}
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1532)(tyTuple__rqELgnZHaqWR0LOe7Lm7lQ a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T1_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T2_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T3_;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = newJObject_pureZjson_91();
T1_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T1_ = toJson_temp_1601(a.Field0, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5), T1_);
T2_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T2_ = toJson_temp_1601(a.Field1, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_6), T2_);
T3_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T3_ = toJson_temp_1615(a.Field2, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_7), T3_);
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1447)(tySequence__5Ga1D66I0eFcTv1wGMgxVA* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = newJArray_pureZjson_122();
{
tyTuple__rqELgnZHaqWR0LOe7Lm7lQ* ai;
NI i;
NI L;
NI T2_;
ai = (tyTuple__rqELgnZHaqWR0LOe7Lm7lQ*)0;
i = ((NI) 0);
T2_ = (a ? a->Sup.len : 0);
L = T2_;
{
while (1) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T5_;
NI TM__SRd76hP9cMfCzdUO857UhQQ_32;
if (!(i < L)) goto LA4;
if ((NU)(i) >= (NU)(a ? a->Sup.len : 0)){ raiseIndexError2(i,(a ? a->Sup.len : 0)-1); }
ai = (&a->data[i]);
T5_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T5_ = toJson_temp_1532((*ai), opt);
add_pureZjson_221(result, T5_);
if (nimAddInt(i, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_32)) { raiseOverflow(); };
i = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_32);
{
NI T8_;
T8_ = (a ? a->Sup.len : 0);
if (!!((T8_ == L))) goto LA9_;
failedAssertImpl_systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_30));
}
LA9_: ;
} LA4: ;
}
}
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson_temp_1378)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T1_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T2_;
nimfr_("toJson", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/std/jsonutils.nim");
result = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
result = newJObject_pureZjson_91();
T1_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T1_ = toJson_temp_1447(a.data, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4), T1_);
T2_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T2_ = toJson_temp_1601(a.counter, opt);
X5BX5Deq__pureZjson_1932(result, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_33), T2_);
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDivInt)(NI a, NI b, NI* res) {
NIM_BOOL result;
result = (NIM_BOOL)0;
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = (a == ((NI) (IL64(-9223372036854775807) - IL64(1))));
if (!(T3_)) goto LA4_;
T3_ = (b == ((NI) -1));
LA4_: ;
if (!T3_) goto LA5_;
result = NIM_TRUE;
}
goto LA1_;
LA5_: ;
{
(*res) = (NI)(a / b);
}
LA1_: ;
return result;
}
static N_INLINE(NI, slotsNeeded_pureZcollectionsZtables_42)(NI count) {
NI result;
NI TM__SRd76hP9cMfCzdUO857UhQQ_34;
NI TM__SRd76hP9cMfCzdUO857UhQQ_35;
NI TM__SRd76hP9cMfCzdUO857UhQQ_36;
nimfr_("slotsNeeded", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/hashcommon.nim");
result = (NI)0;
if (nimMulInt(((NI) (count)), ((NI) 3), &TM__SRd76hP9cMfCzdUO857UhQQ_34)) { raiseOverflow(); };
if (((NI) 2) == 0){ raiseDivByZero(); }
if (nimDivInt((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_34), ((NI) 2), &TM__SRd76hP9cMfCzdUO857UhQQ_35)) { raiseOverflow(); };
if (nimAddInt((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_35), ((NI) 4), &TM__SRd76hP9cMfCzdUO857UhQQ_36)) { raiseOverflow(); };
result = nextPowerOfTwo_pureZmath_181((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_36));
popFrame();
return result;
}
static N_NIMCALL(void, Marker_tySequence__5Ga1D66I0eFcTv1wGMgxVA)(void* p, NI op) {
tySequence__5Ga1D66I0eFcTv1wGMgxVA* a;
NI T1_;
a = (tySequence__5Ga1D66I0eFcTv1wGMgxVA*)p;
T1_ = (NI)0;
for (T1_ = 0; T1_ < (a ? a->Sup.len : 0); T1_++) {
nimGCvisit((void*)a->data[T1_].Field2, op);
}
}
N_LIB_PRIVATE N_NIMCALL(void, initTable_temp_18)(NI initialSize, tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* Result) {
NI correctSizeX60gensym0_;
nimfr_("initTable", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/tables.nim");
unsureAsgnRef((void**)&(*Result).data, NIM_NIL);
(*Result).counter = 0;
if ((initialSize) < ((NI) 0) || (initialSize) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(initialSize, ((NI) 0), ((NI) IL64(9223372036854775807))); }
correctSizeX60gensym0_ = slotsNeeded_pureZcollectionsZtables_42(((NI) (initialSize)));
(*Result).counter = ((NI) 0);
if ((correctSizeX60gensym0_) < ((NI) 0) || (correctSizeX60gensym0_) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(correctSizeX60gensym0_, ((NI) 0), ((NI) IL64(9223372036854775807))); }
unsureAsgnRef((void**) (&(*Result).data), (tySequence__5Ga1D66I0eFcTv1wGMgxVA*) newSeq((&NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_), ((NI) (correctSizeX60gensym0_))));
popFrame();
}
static N_INLINE(NU64, hiXorLo_pureZhashes_79)(NU64 a, NU64 b) {
NU64 result;
nimfr_("hiXorLo", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/hashes.nim");
result = (NU64)0;
__uint128_t r = a; r *= b; result = (r >> 64) ^ r;
popFrame();
return result;
}
static N_INLINE(NI, hashWangYi1_pureZhashes_136)(NU64 x) {
NI result;
NU64 T1_;
NU64 T2_;
nimfr_("hashWangYi1", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/hashes.nim");
result = (NI)0;
T1_ = (NU64)0;
T1_ = hiXorLo_pureZhashes_79(11562461410679940143ULL, (NU64)(x ^ 16646288086500911323ULL));
T2_ = (NU64)0;
T2_ = hiXorLo_pureZhashes_79(T1_, 16952864883938283885ULL);
result = ((NI) (T2_));
popFrame();
return result;
}
static N_INLINE(NI, hash_pureZhashes_128)(NI x) {
NI result;
nimfr_("hash", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/hashes.nim");
result = (NI)0;
result = hashWangYi1_pureZhashes_136(((NU64) (x)));
popFrame();
return result;
}
static N_INLINE(NI, nextTry_pureZcollectionsZtables_34)(NI h, NI maxHash) {
NI result;
NI TM__SRd76hP9cMfCzdUO857UhQQ_38;
nimfr_("nextTry", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/hashcommon.nim");
result = (NI)0;
if (nimAddInt(h, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_38)) { raiseOverflow(); };
result = (NI)((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_38) & maxHash);
popFrame();
return result;
}
static N_INLINE(NI, rawGet_temp_156)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw t, NI key, NI* hc) {
NI result;
NI h;
NI T10_;
NI TM__SRd76hP9cMfCzdUO857UhQQ_39;
nimfr_("rawGet", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/hashcommon.nim");
{ result = (NI)0;
(*hc) = hash_pureZhashes_128(key);
{
if (!((*hc) == ((NI) 0))) goto LA3_;
(*hc) = ((NI) 314159265);
}
LA3_: ;
{
NI T7_;
T7_ = (t.data ? t.data->Sup.len : 0);
if (!(T7_ == ((NI) 0))) goto LA8_;
result = ((NI) -1);
goto BeforeRet_;
}
LA8_: ;
T10_ = ((t.data ? t.data->Sup.len : 0)-1);
h = (NI)((*hc) & T10_);
{
while (1) {
NIM_BOOL T13_;
NI T20_;
if ((NU)(h) >= (NU)(t.data ? t.data->Sup.len : 0)){ raiseIndexError2(h,(t.data ? t.data->Sup.len : 0)-1); }
T13_ = (NIM_BOOL)0;
T13_ = isFilled_pureZcollectionsZtables_31(t.data->data[h].Field0);
if (!T13_) goto LA12;
{
NIM_BOOL T16_;
T16_ = (NIM_BOOL)0;
if ((NU)(h) >= (NU)(t.data ? t.data->Sup.len : 0)){ raiseIndexError2(h,(t.data ? t.data->Sup.len : 0)-1); }
T16_ = (t.data->data[h].Field0 == (*hc));
if (!(T16_)) goto LA17_;
if ((NU)(h) >= (NU)(t.data ? t.data->Sup.len : 0)){ raiseIndexError2(h,(t.data ? t.data->Sup.len : 0)-1); }
T16_ = (t.data->data[h].Field1 == key);
LA17_: ;
if (!T16_) goto LA18_;
result = h;
goto BeforeRet_;
}
LA18_: ;
T20_ = ((t.data ? t.data->Sup.len : 0)-1);
h = nextTry_pureZcollectionsZtables_34(h, T20_);
} LA12: ;
}
if (nimSubInt(((NI) -1), h, &TM__SRd76hP9cMfCzdUO857UhQQ_39)) { raiseOverflow(); };
result = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_39);
}BeforeRet_: ;
popFrame();
return result;
}
static N_INLINE(NI, pluspercent__system_696)(NI x, NI y) {
NI result;
nimfr_("+%", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/arithmetics.nim");
result = (NI)0;
result = ((NI) ((NU)((NU64)(((NU) (x))) + (NU64)(((NU) (y))))));
popFrame();
return result;
}
static N_INLINE(void, incRef_system_5337)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
nimfr_("incRef", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/gc.nim");
(*c).refcount = pluspercent__system_696((*c).refcount, ((NI) 8));
popFrame();
}
static N_INLINE(NI, minuspercent__system_716)(NI x, NI y) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/arithmetics.nim");
result = (NI)0;
result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
popFrame();
return result;
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_system_5299)(void* usr) {
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
NI T1_;
nimfr_("usrToCell", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/gc.nim");
result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T1_ = (NI)0;
T1_ = minuspercent__system_716(((NI) (ptrdiff_t) (usr)), ((NI) 16));
result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, ltpercent__system_1005)(NI x, NI y) {
NIM_BOOL result;
nimfr_("<%", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/comparisons.nim");
result = (NIM_BOOL)0;
result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
popFrame();
return result;
}
static N_INLINE(void, rtlAddZCT_system_5342)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
nimfr_("rtlAddZCT", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/gc.nim");
addZCT_system_5293((&gch_system_5246.zct), c);
popFrame();
}
static N_INLINE(void, decRef_system_5344)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
nimfr_("decRef", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/gc.nim");
(*c).refcount = minuspercent__system_716((*c).refcount, ((NI) 8));
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = ltpercent__system_1005((*c).refcount, ((NI) 8));
if (!T3_) goto LA4_;
rtlAddZCT_system_5342(c);
}
LA4_: ;
popFrame();
}
static N_INLINE(void, asgnRef)(void** dest, void* src) {
nimfr_("asgnRef", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/system/gc.nim");
{
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
if (!!((src == NIM_NIL))) goto LA3_;
T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T5_ = usrToCell_system_5299(src);
incRef_system_5337(T5_);
}
LA3_: ;
{
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
if (!!(((*dest) == NIM_NIL))) goto LA8_;
T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T10_ = usrToCell_system_5299((*dest));
decRef_system_5344(T10_);
}
LA8_: ;
(*dest) = src;
popFrame();
}
static N_INLINE(NIM_BOOL, mustRehash_temp_495)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw t) {
NIM_BOOL result;
NIM_BOOL T6_;
NI T7_;
NI TM__SRd76hP9cMfCzdUO857UhQQ_41;
NI TM__SRd76hP9cMfCzdUO857UhQQ_42;
NI T9_;
NI TM__SRd76hP9cMfCzdUO857UhQQ_43;
nimfr_("mustRehash", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/hashcommon.nim");
result = (NIM_BOOL)0;
{
NI T3_;
T3_ = (t.data ? t.data->Sup.len : 0);
if (!!((t.counter < T3_))) goto LA4_;
failedAssertImpl_systemZassertions_56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_40));
}
LA4_: ;
T6_ = (NIM_BOOL)0;
T7_ = (t.data ? t.data->Sup.len : 0);
if (nimMulInt(T7_, ((NI) 2), &TM__SRd76hP9cMfCzdUO857UhQQ_41)) { raiseOverflow(); };
if (nimMulInt(t.counter, ((NI) 3), &TM__SRd76hP9cMfCzdUO857UhQQ_42)) { raiseOverflow(); };
T6_ = ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_41) < (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_42));
if (T6_) goto LA8_;
T9_ = (t.data ? t.data->Sup.len : 0);
if (nimSubInt(T9_, t.counter, &TM__SRd76hP9cMfCzdUO857UhQQ_43)) { raiseOverflow(); };
T6_ = ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_43) < ((NI) 4));
LA8_: ;
result = T6_;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, rawInsert_temp_954)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* t, tySequence__5Ga1D66I0eFcTv1wGMgxVA** data, NI key, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* val, NI hc, NI h) {
nimfr_("rawInsert", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/tableimpl.nim");
if ((NU)(h) >= (NU)((*data) ? (*data)->Sup.len : 0)){ raiseIndexError2(h,((*data) ? (*data)->Sup.len : 0)-1); }
(*data)->data[h].Field1 = key;
if ((NU)(h) >= (NU)((*data) ? (*data)->Sup.len : 0)){ raiseIndexError2(h,((*data) ? (*data)->Sup.len : 0)-1); }
asgnRef((void**) (&(*data)->data[h].Field2), val);
if ((NU)(h) >= (NU)((*data) ? (*data)->Sup.len : 0)){ raiseIndexError2(h,((*data) ? (*data)->Sup.len : 0)-1); }
(*data)->data[h].Field0 = hc;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, enlarge_temp_650)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* t) {
tySequence__5Ga1D66I0eFcTv1wGMgxVA* n;
NI T1_;
NI TM__SRd76hP9cMfCzdUO857UhQQ_44;
tySequence__5Ga1D66I0eFcTv1wGMgxVA* T2_;
nimfr_("enlarge", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/tables.nim");
n = (tySequence__5Ga1D66I0eFcTv1wGMgxVA*)0;
T1_ = ((*t).data ? (*t).data->Sup.len : 0);
if (nimMulInt(T1_, ((NI) 2), &TM__SRd76hP9cMfCzdUO857UhQQ_44)) { raiseOverflow(); };
if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_44)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_44)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_44), ((NI) 0), ((NI) IL64(9223372036854775807))); }
n = (tySequence__5Ga1D66I0eFcTv1wGMgxVA*) newSeq((&NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_44))));
T2_ = (tySequence__5Ga1D66I0eFcTv1wGMgxVA*)0;
T2_ = (*t).data;
unsureAsgnRef((void**) (&(*t).data), n);
n = T2_;
{
NI i;
NI colontmp_;
NI T4_;
NI res;
i = (NI)0;
colontmp_ = (NI)0;
T4_ = ((n ? n->Sup.len : 0)-1);
colontmp_ = T4_;
res = ((NI) 0);
{
while (1) {
NI eh;
NI TM__SRd76hP9cMfCzdUO857UhQQ_45;
if (!(res <= colontmp_)) goto LA6;
i = res;
if ((NU)(i) >= (NU)(n ? n->Sup.len : 0)){ raiseIndexError2(i,(n ? n->Sup.len : 0)-1); }
eh = n->data[i].Field0;
{
NIM_BOOL T9_;
NI j;
NI T12_;
NI T17_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T18_;
T9_ = (NIM_BOOL)0;
T9_ = isFilled_pureZcollectionsZtables_31(eh);
if (!T9_) goto LA10_;
T12_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
j = (NI)(eh & T12_);
{
while (1) {
NIM_BOOL T15_;
NI T16_;
if ((NU)(j) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(j,((*t).data ? (*t).data->Sup.len : 0)-1); }
T15_ = (NIM_BOOL)0;
T15_ = isFilled_pureZcollectionsZtables_31((*t).data->data[j].Field0);
if (!T15_) goto LA14;
T16_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
j = nextTry_pureZcollectionsZtables_34(j, T16_);
} LA14: ;
}
if ((NU)(i) >= (NU)(n ? n->Sup.len : 0)){ raiseIndexError2(i,(n ? n->Sup.len : 0)-1); }
T17_ = (NI)0;
T17_ = n->data[i].Field1;
n->data[i].Field1 = 0;
if ((NU)(i) >= (NU)(n ? n->Sup.len : 0)){ raiseIndexError2(i,(n ? n->Sup.len : 0)-1); }
T18_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T18_ = n->data[i].Field2;
asgnRef((void**) (&n->data[i].Field2), NIM_NIL);
rawInsert_temp_954(t, (&(*t).data), T17_, T18_, eh, j);
}
LA10_: ;
if (nimAddInt(res, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_45)) { raiseOverflow(); };
res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_45);
} LA6: ;
}
}
popFrame();
}
static N_INLINE(NI, rawGetKnownHC_temp_1123)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw t, NI key, NI hc) {
NI result;
NI h;
NI T6_;
NI TM__SRd76hP9cMfCzdUO857UhQQ_46;
nimfr_("rawGetKnownHC", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/hashcommon.nim");
{ result = (NI)0;
{
NI T3_;
T3_ = (t.data ? t.data->Sup.len : 0);
if (!(T3_ == ((NI) 0))) goto LA4_;
result = ((NI) -1);
goto BeforeRet_;
}
LA4_: ;
T6_ = ((t.data ? t.data->Sup.len : 0)-1);
h = (NI)(hc & T6_);
{
while (1) {
NIM_BOOL T9_;
NI T16_;
if ((NU)(h) >= (NU)(t.data ? t.data->Sup.len : 0)){ raiseIndexError2(h,(t.data ? t.data->Sup.len : 0)-1); }
T9_ = (NIM_BOOL)0;
T9_ = isFilled_pureZcollectionsZtables_31(t.data->data[h].Field0);
if (!T9_) goto LA8;
{
NIM_BOOL T12_;
T12_ = (NIM_BOOL)0;
if ((NU)(h) >= (NU)(t.data ? t.data->Sup.len : 0)){ raiseIndexError2(h,(t.data ? t.data->Sup.len : 0)-1); }
T12_ = (t.data->data[h].Field0 == hc);
if (!(T12_)) goto LA13_;
if ((NU)(h) >= (NU)(t.data ? t.data->Sup.len : 0)){ raiseIndexError2(h,(t.data ? t.data->Sup.len : 0)-1); }
T12_ = (t.data->data[h].Field1 == key);
LA13_: ;
if (!T12_) goto LA14_;
result = h;
goto BeforeRet_;
}
LA14_: ;
T16_ = ((t.data ? t.data->Sup.len : 0)-1);
h = nextTry_pureZcollectionsZtables_34(h, T16_);
} LA8: ;
}
if (nimSubInt(((NI) -1), h, &TM__SRd76hP9cMfCzdUO857UhQQ_46)) { raiseOverflow(); };
result = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_46);
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq__temp_95)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* t, NI key, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* val) {
NI hc;
NI index;
nimfr_("[]=", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/tables.nim");
{
NI T3_;
NI correctSizeX60gensym3_;
T3_ = ((*t).data ? (*t).data->Sup.len : 0);
if (!(T3_ == ((NI) 0))) goto LA4_;
correctSizeX60gensym3_ = slotsNeeded_pureZcollectionsZtables_42(((NI) 32));
(*t).counter = ((NI) 0);
if ((correctSizeX60gensym3_) < ((NI) 0) || (correctSizeX60gensym3_) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(correctSizeX60gensym3_, ((NI) 0), ((NI) IL64(9223372036854775807))); }
unsureAsgnRef((void**) (&(*t).data), (tySequence__5Ga1D66I0eFcTv1wGMgxVA*) newSeq((&NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_), ((NI) (correctSizeX60gensym3_))));
}
LA4_: ;
hc = (NI)0;
index = rawGet_temp_156((*t), key, (&hc));
{
if (!(((NI) 0) <= index)) goto LA8_;
if ((NU)(index) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(index,((*t).data ? (*t).data->Sup.len : 0)-1); }
asgnRef((void**) (&(*t).data->data[index].Field2), val);
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_47;
NI TM__SRd76hP9cMfCzdUO857UhQQ_48;
{
NI T13_;
NI correctSizeX60gensym8_;
T13_ = ((*t).data ? (*t).data->Sup.len : 0);
if (!(T13_ == ((NI) 0))) goto LA14_;
correctSizeX60gensym8_ = slotsNeeded_pureZcollectionsZtables_42(((NI) 32));
(*t).counter = ((NI) 0);
if ((correctSizeX60gensym8_) < ((NI) 0) || (correctSizeX60gensym8_) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(correctSizeX60gensym8_, ((NI) 0), ((NI) IL64(9223372036854775807))); }
unsureAsgnRef((void**) (&(*t).data), (tySequence__5Ga1D66I0eFcTv1wGMgxVA*) newSeq((&NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_), ((NI) (correctSizeX60gensym8_))));
}
LA14_: ;
{
NIM_BOOL T18_;
T18_ = (NIM_BOOL)0;
T18_ = mustRehash_temp_495((*t));
if (!T18_) goto LA19_;
enlarge_temp_650(t);
index = rawGetKnownHC_temp_1123((*t), key, hc);
}
LA19_: ;
if (nimSubInt(((NI) -1), index, &TM__SRd76hP9cMfCzdUO857UhQQ_47)) { raiseOverflow(); };
index = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_47);
rawInsert_temp_954(t, (&(*t).data), key, val, hc, index);
if (nimAddInt((*t).counter, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_48)) { raiseOverflow(); };
(*t).counter = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_48);
}
LA6_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, toTable_temp_8)(tyTuple__rwWrjn23eYSTMhtcUuqyIQ* pairs, NI pairsLen_0, tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* Result) {
nimfr_("toTable", "/home/runner/.choosenim/toolchains/nim-1.6.0/lib/pure/collections/tables.nim");
initTable_temp_18(pairsLen_0, Result);
{
NI* key;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q** val;
NI i;
key = (NI*)0;
val = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q**)0;
i = ((NI) 0);
{
while (1) {
NI TM__SRd76hP9cMfCzdUO857UhQQ_49;
if (!(i < pairsLen_0)) goto LA3;
if ((NU)(i) >= (NU)(pairsLen_0)){ raiseIndexError2(i,pairsLen_0-1); }
key = (&pairs[i].Field0);
if ((NU)(i) >= (NU)(pairsLen_0)){ raiseIndexError2(i,pairsLen_0-1); }
val = &pairs[i].Field1;
X5BX5Deq__temp_95(Result, (*key), (*val));
if (nimAddInt(i, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_49)) { raiseOverflow(); };
i = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_49);
} LA3: ;
}
}
popFrame();
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
N_LIB_PRIVATE void PreMainInner(void) {
stdlib_timesInit000();
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_jsonDatInit000();
stdlib_timesDatInit000();
tempDatInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyArray__nHXaesL0DJZHyVS07ARPRA T1_;
tyArray__AkUi9b3wZe4og9ahIKMIHS1Q T2_;
tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ T3_;
tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw T4_;
tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ T5_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T6_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimZeroMem((void*)T1_, sizeof(tyArray__nHXaesL0DJZHyVS07ARPRA));
nimZeroMem((void*)T2_, sizeof(tyArray__AkUi9b3wZe4og9ahIKMIHS1Q));
T2_[0].Field0 = ((NI) 9);
T3_ = initToJsonOptions_stdZjsonutils_33();
T2_[0].Field1 = toJson_stdZjsonutils_620(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_50), T3_);
nimZeroMem((void*)(&T4_), sizeof(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw));
toTable_temp_8(T2_, 1, (&T4_));
T5_ = initToJsonOptions_stdZjsonutils_33();
T6_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T6_ = toJson_temp_1378(T4_, T5_);
T1_[0] = dollar__pureZjson_4542(T6_);
echoBinSafe(T1_, 1);
popFrame();
}
}
N_LIB_PRIVATE N_NIMCALL(void, tempDatInit000)(void) {
static TNimNode* TM__SRd76hP9cMfCzdUO857UhQQ_37_3[3];
static TNimNode TM__SRd76hP9cMfCzdUO857UhQQ_0[4];
NTIkeyvaluepair__rqELgnZHaqWR0LOe7Lm7lQ_.size = sizeof(tyTuple__rqELgnZHaqWR0LOe7Lm7lQ);
NTIkeyvaluepair__rqELgnZHaqWR0LOe7Lm7lQ_.align = NIM_ALIGNOF(tyTuple__rqELgnZHaqWR0LOe7Lm7lQ);
NTIkeyvaluepair__rqELgnZHaqWR0LOe7Lm7lQ_.kind = 18;
NTIkeyvaluepair__rqELgnZHaqWR0LOe7Lm7lQ_.base = 0;
TM__SRd76hP9cMfCzdUO857UhQQ_37_3[0] = &TM__SRd76hP9cMfCzdUO857UhQQ_0[1];
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].kind = 1;
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].offset = offsetof(tyTuple__rqELgnZHaqWR0LOe7Lm7lQ, Field0);
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].typ = (&NTIint__rR5Bzr1D5krxoo1NcNyeMA_);
TM__SRd76hP9cMfCzdUO857UhQQ_0[1].name = "Field0";
TM__SRd76hP9cMfCzdUO857UhQQ_37_3[1] = &TM__SRd76hP9cMfCzdUO857UhQQ_0[2];
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].kind = 1;
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].offset = offsetof(tyTuple__rqELgnZHaqWR0LOe7Lm7lQ, Field1);
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].typ = (&NTIint__rR5Bzr1D5krxoo1NcNyeMA_);
TM__SRd76hP9cMfCzdUO857UhQQ_0[2].name = "Field1";
TM__SRd76hP9cMfCzdUO857UhQQ_37_3[2] = &TM__SRd76hP9cMfCzdUO857UhQQ_0[3];
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].kind = 1;
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].offset = offsetof(tyTuple__rqELgnZHaqWR0LOe7Lm7lQ, Field2);
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].typ = (&NTIjsonnode__zfzzuQ8txrdZAYK0WGWpHg_);
TM__SRd76hP9cMfCzdUO857UhQQ_0[3].name = "Field2";
TM__SRd76hP9cMfCzdUO857UhQQ_0[0].len = 3; TM__SRd76hP9cMfCzdUO857UhQQ_0[0].kind = 2; TM__SRd76hP9cMfCzdUO857UhQQ_0[0].sons = &TM__SRd76hP9cMfCzdUO857UhQQ_37_3[0];
NTIkeyvaluepair__rqELgnZHaqWR0LOe7Lm7lQ_.node = &TM__SRd76hP9cMfCzdUO857UhQQ_0[0];
NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_.size = sizeof(tySequence__5Ga1D66I0eFcTv1wGMgxVA*);
NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_.align = NIM_ALIGNOF(tySequence__5Ga1D66I0eFcTv1wGMgxVA*);
NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_.kind = 24;
NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_.base = (&NTIkeyvaluepair__rqELgnZHaqWR0LOe7Lm7lQ_);
NTIkeyvaluepairseq__5Ga1D66I0eFcTv1wGMgxVA_.marker = Marker_tySequence__5Ga1D66I0eFcTv1wGMgxVA;
}
AST
nnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
nnkBracket.newTree(
newIdentNode("json"),
newIdentNode("jsonutils"),
newIdentNode("tables")
)
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkTableConstr.newTree(
nnkExprColonExpr.newTree(
newLit(9),
nnkDotExpr.newTree(
newLit("X"),
newIdentNode("toJson")
)
)
),
newIdentNode("toTable")
),
newIdentNode("toJson")
)
)
)
1.4.0 :+1: OK
Output
{"data":[{"hcode":0,"key":0,"val":null},{"hcode":0,"key":0,"val":null},{"hcode":0,"key":0,"val":null},{"hcode":7204881626893065923,"key":9,"val":{"kind":4,"str":"X"}},{"hcode":0,"key":0,"val":null},{"hcode":0,"key":0,"val":null},{"hcode":0,"key":0,"val":null},{"hcode":0,"key":0,"val":null}],"counter":1}
Stats
- Created
2023-07-07T00:09:40Z
- Started
2023-07-07T00:10:26
- Finished
2023-07-07T00:10:28
- Duration
1 minute
- Commands
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
1.2.0 :-1: FAIL
Output
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(1, 11) Error: cannot open file: std/jsonutils
Stats
- Created
2023-07-07T00:09:40Z
- Started
2023-07-07T00:10:43
- Finished
2023-07-07T00:10:43
- Duration
1 minute
- Commands
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q;
typedef struct tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw;
typedef struct tySequence__5Ga1D66I0eFcTv1wGMgxVA tySequence__5Ga1D66I0eFcTv1wGMgxVA;
typedef struct tyTuple__rwWrjn23eYSTMhtcUuqyIQ tyTuple__rwWrjn23eYSTMhtcUuqyIQ;
typedef struct tyTuple__rqELgnZHaqWR0LOe7Lm7lQ tyTuple__rqELgnZHaqWR0LOe7Lm7lQ;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NimStringDesc* tyArray__nHXaesL0DJZHyVS07ARPRA[1];
struct tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw {
tySequence__5Ga1D66I0eFcTv1wGMgxVA* data;
NI counter;
};
struct tyTuple__rwWrjn23eYSTMhtcUuqyIQ {
NI Field0;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field1;
};
typedef tyTuple__rwWrjn23eYSTMhtcUuqyIQ tyArray__AkUi9b3wZe4og9ahIKMIHS1Q[1];
struct tyTuple__rqELgnZHaqWR0LOe7Lm7lQ {
NI Field0;
NI Field1;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field2;
};
struct tySequence__5Ga1D66I0eFcTv1wGMgxVA {
TGenericSeq Sup;
tyTuple__rqELgnZHaqWR0LOe7Lm7lQ data[SEQ_DECL_SIZE];
};
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___79aIqF5QC8ZRJgu2hlv9bdjw)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* node);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson__m4uGWvsZBIAvcS9cnd9ae9cDA)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw a);
N_LIB_PRIVATE N_NIMCALL(void, toTable__wSRARlvjcPj3svDaChXSJw)(tyTuple__rwWrjn23eYSTMhtcUuqyIQ* pairs, NI pairsLen_0, tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* Result);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson__viFZfttT9bGlOKtNpo2E84Q)(NimStringDesc* a);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_tablesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_jsonDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "X", 1);
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
stdlib_timesInit000();
stdlib_osInit000();
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_tablesDatInit000();
stdlib_jsonDatInit000();
stdlib_timesDatInit000();
stdlib_osDatInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyArray__nHXaesL0DJZHyVS07ARPRA T1_;
tyArray__AkUi9b3wZe4og9ahIKMIHS1Q T2_;
tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw T3_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T4_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimZeroMem((void*)T1_, sizeof(tyArray__nHXaesL0DJZHyVS07ARPRA));
nimZeroMem((void*)T2_, sizeof(tyArray__AkUi9b3wZe4og9ahIKMIHS1Q));
T2_[0].Field0 = ((NI) 9);
T2_[0].Field1 = toJson__viFZfttT9bGlOKtNpo2E84Q(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2));
nimZeroMem((void*)(&T3_), sizeof(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw));
toTable__wSRARlvjcPj3svDaChXSJw(T2_, 1, (&T3_));
T4_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T4_ = toJson__m4uGWvsZBIAvcS9cnd9ae9cDA(T3_);
T1_[0] = dollar___79aIqF5QC8ZRJgu2hlv9bdjw(T4_);
echoBinSafe(T1_, 1);
popFrame();
}
}
AST
nnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
nnkBracket.newTree(
newIdentNode("json"),
newIdentNode("jsonutils"),
newIdentNode("tables")
)
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkTableConstr.newTree(
nnkExprColonExpr.newTree(
newLit(9),
nnkDotExpr.newTree(
newLit("X"),
newIdentNode("toJson")
)
)
),
newIdentNode("toTable")
),
newIdentNode("toJson")
)
)
)
1.0.0 :-1: FAIL
Output
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(1, 11) Error: cannot open file: std/jsonutils
Stats
- Created
2023-07-07T00:09:40Z
- Started
2023-07-07T00:10:56
- Finished
2023-07-07T00:10:56
- Duration
now
- Commands
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q;
typedef struct tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw;
typedef struct tySequence__5Ga1D66I0eFcTv1wGMgxVA tySequence__5Ga1D66I0eFcTv1wGMgxVA;
typedef struct tyTuple__rwWrjn23eYSTMhtcUuqyIQ tyTuple__rwWrjn23eYSTMhtcUuqyIQ;
typedef struct tyTuple__rqELgnZHaqWR0LOe7Lm7lQ tyTuple__rqELgnZHaqWR0LOe7Lm7lQ;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NimStringDesc* tyArray__nHXaesL0DJZHyVS07ARPRA[1];
struct tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw {
tySequence__5Ga1D66I0eFcTv1wGMgxVA* data;
NI counter;
};
struct tyTuple__rwWrjn23eYSTMhtcUuqyIQ {
NI Field0;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field1;
};
typedef tyTuple__rwWrjn23eYSTMhtcUuqyIQ tyArray__AkUi9b3wZe4og9ahIKMIHS1Q[1];
struct tyTuple__rqELgnZHaqWR0LOe7Lm7lQ {
NI Field0;
NI Field1;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field2;
};
struct tySequence__5Ga1D66I0eFcTv1wGMgxVA {
TGenericSeq Sup;
tyTuple__rqELgnZHaqWR0LOe7Lm7lQ data[SEQ_DECL_SIZE];
};
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___79aIqF5QC8ZRJgu2hlv9bdjw)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* node);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson__m4uGWvsZBIAvcS9cnd9ae9cDA)(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw a);
N_LIB_PRIVATE N_NIMCALL(void, toTable__wSRARlvjcPj3svDaChXSJw)(tyTuple__rwWrjn23eYSTMhtcUuqyIQ* pairs, NI pairsLen_0, tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw* Result);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson__viFZfttT9bGlOKtNpo2E84Q)(NimStringDesc* a);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_tablesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_jsonDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "X", 1);
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
stdlib_timesInit000();
stdlib_osInit000();
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_tablesDatInit000();
stdlib_jsonDatInit000();
stdlib_timesDatInit000();
stdlib_osDatInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyArray__nHXaesL0DJZHyVS07ARPRA T1_;
tyArray__AkUi9b3wZe4og9ahIKMIHS1Q T2_;
tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw T3_;
tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* T4_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimZeroMem((void*)T1_, sizeof(tyArray__nHXaesL0DJZHyVS07ARPRA));
nimZeroMem((void*)T2_, sizeof(tyArray__AkUi9b3wZe4og9ahIKMIHS1Q));
T2_[0].Field0 = ((NI) 9);
T2_[0].Field1 = toJson__viFZfttT9bGlOKtNpo2E84Q(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2));
nimZeroMem((void*)(&T3_), sizeof(tyObject_Table__7x0tP4Y9bpiSiUCXCpbaNbw));
toTable__wSRARlvjcPj3svDaChXSJw(T2_, 1, (&T3_));
T4_ = (tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*)0;
T4_ = toJson__m4uGWvsZBIAvcS9cnd9ae9cDA(T3_);
T1_[0] = dollar___79aIqF5QC8ZRJgu2hlv9bdjw(T4_);
echoBinSafe(T1_, 1);
popFrame();
}
}
AST
nnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
nnkBracket.newTree(
newIdentNode("json"),
newIdentNode("jsonutils"),
newIdentNode("tables")
)
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkTableConstr.newTree(
nnkExprColonExpr.newTree(
newLit(9),
nnkDotExpr.newTree(
newLit("X"),
newIdentNode("toJson")
)
)
),
newIdentNode("toTable")
),
newIdentNode("toJson")
)
)
)
#24178bf8a :arrow_right: :bug:
Diagnostics
Miran introduced a bug at 2021-08-24 17:15:26 +0200
on commit #24178bf8a with message:
get rid of the warnings during bootstrapping (#18741)
* fix bootstrapping hints and warnings
* revert removals in ccgtypes
The bug is in the files:
compiler/nimlexbase.nim
compiler/semfold.nim
compiler/sighashes.nim
compiler/suggest.nim
The bug can be in the commits:
(Diagnostics sometimes off-by-one).
57 minutes
bisecting 3393
commits at 60
commits per second.
I think it's that you're turning the value "v"
into JsonNode
. It's a strange bug. This works fine.
import std/[json, jsonutils, tables]
echo ${
1: "v"
}.to_table.to_json
However,
let sVal = "v".toJson()
assert sVal.kind == JString
works fine, without a segfault. However,
let sVal = "v".toJson()
assert sVal.kind == JString
echo ${
1: sVal
}.toTable.toJson
produces a segfault, just like you mentioned.
HOWEVER (sorry),
echo ${
"jString": sVal
}.toTable.toJson
does not do that. It seems that when a TableRef[int, JsonNode]
is attempted to be converted to a JsonNode
, a segfault occurs. Upon further inspection, the segfault occurs on all these types as the key's type:
-
int
and all signed and unsigned primitives (int8
,int16
,int32
,int64
,uint8
,uint16
,uint32
,uint64
) -
float
and all its "derivatives" -
bool
There's probably more, but this is all I found for now.
By default, toJson
doesn't handle nil for JsonNode
. But you can use ToJsonOptions
to force treating JsonNode as a regular ref object
import std/[json, jsonutils, tables]
let option = ToJsonOptions(
enumMode: joptEnumOrd,
jsonNodeMode: joptJsonNodeAsObject
) # treats JsonNode as a regular ref object
echo $({ 1: "v".to_json }.to_table.to_json(option))