1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 64
3 #define NIM_EmulateOverflowChecks
4 
5 #include "nimbase.h"
6 #include <string.h>
7 #undef LANGUAGE_C
8 #undef MIPSEB
9 #undef MIPSEL
10 #undef PPC
11 #undef R3000
12 #undef R4000
13 #undef i386
14 #undef linux
15 #undef mips
16 #undef near
17 #undef far
18 #undef powerpc
19 #undef unix
20 #define nimfr_(x, y)
21 #define nimln_(x, y)
22 typedef struct NimStringDesc NimStringDesc;
23 typedef struct TGenericSeq TGenericSeq;
24 typedef struct tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw;
25 typedef struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw;
26 typedef struct tyObject_TType__facALICuu8zUj0hjvbTLFg tyObject_TType__facALICuu8zUj0hjvbTLFg;
27 typedef struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q;
28 typedef struct tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ;
29 typedef struct tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA;
30 typedef struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ;
31 struct TGenericSeq {
32 NI len;
33 NI reserved;
34 };
35 struct NimStringDesc {
36   TGenericSeq Sup;
37 NIM_CHAR data[SEQ_DECL_SIZE];
38 };
39 struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q {
40 NU16 line;
41 NI16 col;
42 NI32 fileIndex;
43 };
44 typedef NU32 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg;
45 typedef NU8 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw;
46 struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw {
47 tyObject_TType__facALICuu8zUj0hjvbTLFg* typ;
48 tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info;
49 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg flags;
50 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind;
51 union{
52 struct {NI64 intVal;
53 } _kind_1;
54 struct {NF floatVal;
55 } _kind_2;
56 struct {NimStringDesc* strVal;
57 } _kind_3;
58 struct {tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* sym;
59 } _kind_4;
60 struct {tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA* ident;
61 } _kind_5;
62 struct {tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ* sons;
63 } _kind_6;
64 };
65 };
66 typedef NU8 tyEnum_ErrorKind__EyDxqE6LKZuEAJ79bRHKz8A;
67 typedef NU16 tySet_tyEnum_TRenderFlag__wrPgUo1ExBlHvFnXN2nSHw;
68 typedef NU8 tyEnum_TPreferedDesc__tnd4qt9c4xddV8oKV5zyusw;
69 typedef NimStringDesc* tyArray__24KAM9afIUgUaqBaEBB6r9bg[3];
70 struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ {
71   TGenericSeq Sup;
72   tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* data[SEQ_DECL_SIZE];
73 };
74 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
75 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a);
76 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, renderTree__renderer_46)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n, tySet_tyEnum_TRenderFlag__wrPgUo1ExBlHvFnXN2nSHw renderFlags);
77 static N_INLINE(NI, len__ast_3198)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
78 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
79 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
80 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
81 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
82 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, typeToString__types_50)(tyObject_TType__facALICuu8zUj0hjvbTLFg* typ, tyEnum_TPreferedDesc__tnd4qt9c4xddV8oKV5zyusw prefer);
83 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
84 static N_INLINE(void, nimZeroMem)(void* p, NI size);
85 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
86 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getProcHeader__types_222)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* sym, tyEnum_TPreferedDesc__tnd4qt9c4xddV8oKV5zyusw prefer, NIM_BOOL getDeclarationPath);
87 STRING_LITERAL(TM__NsPKjREfpp5Tqi9bANLLP9aw_2, "type mismatch", 13);
88 STRING_LITERAL(TM__NsPKjREfpp5Tqi9bANLLP9aw_3, "expression \'$1\' cannot be called", 32);
89 STRING_LITERAL(TM__NsPKjREfpp5Tqi9bANLLP9aw_4, "wrong number of arguments", 25);
90 STRING_LITERAL(TM__NsPKjREfpp5Tqi9bANLLP9aw_5, "(", 1);
91 STRING_LITERAL(TM__NsPKjREfpp5Tqi9bANLLP9aw_6, ", ", 2);
92 STRING_LITERAL(TM__NsPKjREfpp5Tqi9bANLLP9aw_7, ")", 1);
93 STRING_LITERAL(TM__NsPKjREfpp5Tqi9bANLLP9aw_8, "ambiguous call; both $1 and $2 match for: $3", 44);
N_INLINE(NI,len__ast_3198)94 static N_INLINE(NI, len__ast_3198)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
95 	NI result;
96 	NI T1_;
97 	result = (NI)0;
98 	T1_ = ((*n)._kind_6.sons ? (*n)._kind_6.sons->Sup.len : 0);
99 	result = T1_;
100 	return result;
101 }
N_INLINE(void,nimCopyMem)102 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
103 	void* T1_;
104 	T1_ = (void*)0;
105 	T1_ = memcpy(dest, source, ((size_t) (size)));
106 }
N_INLINE(void,copyMem__system_1727)107 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
108 	nimCopyMem(dest, source, size);
109 }
N_INLINE(void,appendString)110 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
111 	{
112 		if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
113 		copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
114 		(*dest).Sup.len += (*src).Sup.len;
115 	}
116 	LA3_: ;
117 }
N_INLINE(void,nimSetMem__systemZmemory_7)118 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
119 	void* T1_;
120 	T1_ = (void*)0;
121 	T1_ = memset(a, v, ((size_t) (size)));
122 }
N_INLINE(void,nimZeroMem)123 static N_INLINE(void, nimZeroMem)(void* p, NI size) {
124 	nimSetMem__systemZmemory_7(p, ((int) 0), size);
125 }
N_NIMCALL(NimStringDesc *,errorToString__errorhandling_107)126 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, errorToString__errorhandling_107)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* config, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
127 	NimStringDesc* result;
128 	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* wrongNode;
129 	result = NIM_NIL;
130 	wrongNode = (*n)._kind_6.sons->data[((NI) 0)];
131 	switch (((tyEnum_ErrorKind__EyDxqE6LKZuEAJ79bRHKz8A) ((*(*n)._kind_6.sons->data[((NI) 1)])._kind_1.intVal))) {
132 	case ((tyEnum_ErrorKind__EyDxqE6LKZuEAJ79bRHKz8A) 0):
133 	{
134 		result = copyString(((NimStringDesc*) &TM__NsPKjREfpp5Tqi9bANLLP9aw_2));
135 	}
136 	break;
137 	case ((tyEnum_ErrorKind__EyDxqE6LKZuEAJ79bRHKz8A) 1):
138 	{
139 		NimStringDesc* T3_;
140 		T3_ = NIM_NIL;
141 		T3_ = renderTree__renderer_46((*wrongNode)._kind_6.sons->data[((NI) 0)], 0);
142 		result = nsuFormatSingleElem(((NimStringDesc*) &TM__NsPKjREfpp5Tqi9bANLLP9aw_3), T3_);
143 	}
144 	break;
145 	case ((tyEnum_ErrorKind__EyDxqE6LKZuEAJ79bRHKz8A) 2):
146 	{
147 		result = copyString((*(*n)._kind_6.sons->data[((NI) 2)])._kind_3.strVal);
148 	}
149 	break;
150 	case ((tyEnum_ErrorKind__EyDxqE6LKZuEAJ79bRHKz8A) 3):
151 	{
152 		result = copyString(((NimStringDesc*) &TM__NsPKjREfpp5Tqi9bANLLP9aw_4));
153 	}
154 	break;
155 	case ((tyEnum_ErrorKind__EyDxqE6LKZuEAJ79bRHKz8A) 4):
156 	{
157 		tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* a;
158 		tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* b;
159 		NimStringDesc* args;
160 		tyArray__24KAM9afIUgUaqBaEBB6r9bg T15_;
161 		a = (*(*n)._kind_6.sons->data[((NI) 2)])._kind_4.sym;
162 		b = (*(*n)._kind_6.sons->data[((NI) 3)])._kind_4.sym;
163 		args = copyString(((NimStringDesc*) &TM__NsPKjREfpp5Tqi9bANLLP9aw_5));
164 		{
165 			NI i;
166 			NI colontmp_;
167 			NI i_2;
168 			i = (NI)0;
169 			colontmp_ = (NI)0;
170 			colontmp_ = len__ast_3198(wrongNode);
171 			i_2 = ((NI) 1);
172 			{
173 				while (1) {
174 					NimStringDesc* T14_;
175 					if (!(i_2 < colontmp_)) goto LA9;
176 					i = i_2;
177 					{
178 						if (!(((NI) 1) < i)) goto LA12_;
179 						args = resizeString(args, 2);
180 appendString(args, ((NimStringDesc*) &TM__NsPKjREfpp5Tqi9bANLLP9aw_6));
181 					}
182 					LA12_: ;
183 					T14_ = NIM_NIL;
184 					T14_ = typeToString__types_50((*(*wrongNode)._kind_6.sons->data[i]).typ, ((tyEnum_TPreferedDesc__tnd4qt9c4xddV8oKV5zyusw) 0));
185 					args = resizeString(args, (T14_ ? T14_->Sup.len : 0) + 0);
186 appendString(args, T14_);
187 					i_2 += ((NI) 1);
188 				} LA9: ;
189 			}
190 		}
191 		args = resizeString(args, 1);
192 appendString(args, ((NimStringDesc*) &TM__NsPKjREfpp5Tqi9bANLLP9aw_7));
193 		nimZeroMem((void*)T15_, sizeof(tyArray__24KAM9afIUgUaqBaEBB6r9bg));
194 		T15_[0] = getProcHeader__types_222(config, a, ((tyEnum_TPreferedDesc__tnd4qt9c4xddV8oKV5zyusw) 0), NIM_TRUE);
195 		T15_[1] = getProcHeader__types_222(config, b, ((tyEnum_TPreferedDesc__tnd4qt9c4xddV8oKV5zyusw) 0), NIM_TRUE);
196 		T15_[2] = copyString(args);
197 		result = nsuFormatOpenArray(((NimStringDesc*) &TM__NsPKjREfpp5Tqi9bANLLP9aw_8), T15_, 3);
198 	}
199 	break;
200 	}
201 	return result;
202 }
203