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