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 TNimType TNimType;
22 typedef struct TNimNode TNimNode;
23 typedef struct tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg;
24 typedef struct RootObj RootObj;
25 typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ tySequence__xv3aaFd3JCw8NbmALHiezQ;
26 typedef struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA tyTuple__sPaDkVPSC0MkcoXCxPH9ccA;
27 typedef struct NimStringDesc NimStringDesc;
28 typedef struct TGenericSeq TGenericSeq;
29 typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
30 typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
31 typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
32 typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
33 typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
34 typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
35 typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
36 typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
37 typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
38 typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
39 typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
40 typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
41 typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
42 typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
43 typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
44 typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
45 typedef struct tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag;
46 typedef struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
47 typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
48 typedef struct Exception Exception;
49 typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
50 typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
51 typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
52 typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
53 typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
54 typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
55 struct TNimType {
56 NI size;
57 NI align;
58 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
59 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
60 TNimType* base;
61 TNimNode* node;
62 void* finalizer;
63 tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
64 tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
65 };
66 typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
67 struct TNimNode {
68 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
69 NI offset;
70 TNimType* typ;
71 NCSTRING name;
72 NI len;
73 TNimNode** sons;
74 };
75 struct RootObj {
76 TNimType* m_type;
77 };
78 typedef NU8 tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ;
79 struct tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg {
80 RootObj Sup;
81 NI counter;
82 tySequence__xv3aaFd3JCw8NbmALHiezQ* data;
83 tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ mode;
84 };
85 struct TGenericSeq {
86 NI len;
87 NI reserved;
88 };
89 struct NimStringDesc {
90 TGenericSeq Sup;
91 NIM_CHAR data[SEQ_DECL_SIZE];
92 };
93 struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA {
94 NimStringDesc* Field0;
95 NimStringDesc* Field1;
96 NIM_BOOL Field2;
97 };
98 struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
99 NI refcount;
100 TNimType* typ;
101 };
102 struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
103 void* bottom;
104 };
105 struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
106 NI len;
107 NI cap;
108 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
109 };
110 typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
111 typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
112 typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
113 typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
114 typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
115 struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
116 tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
117 };
118 typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
119 struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
120 tyArray__0aOLqZchNi8nWtMTi8ND8w link;
121 NI key;
122 NI upperBound;
123 NI level;
124 };
125 struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
126 tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
127 NI Field1;
128 };
129 typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
130 struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
131 NI len;
132 tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
133 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
134 };
135 struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
136 NI minLargeObj;
137 NI maxLargeObj;
138 tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
139 NU32 flBitmap;
140 tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
141 tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
142 tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
143 NI currMem;
144 NI maxMem;
145 NI freeMem;
146 NI occ;
147 NI lastSize;
148 tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
149 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
150 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
151 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
152 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
153 NIM_BOOL locked;
154 NIM_BOOL blockChunkSizeIncrease;
155 NI nextChunkSize;
156 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
157 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
158 };
159 struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
160 NI stackScans;
161 NI cycleCollections;
162 NI maxThreshold;
163 NI maxStackSize;
164 NI maxStackCells;
165 NI cycleTableSize;
166 NI64 maxPause;
167 };
168 struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
169 NI counter;
170 NI max;
171 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
172 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
173 };
174 struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
175 tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
176 NI cycleThreshold;
177 NI zctThreshold;
178 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
179 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
180 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
181 NI recGcLock;
182 tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
183 tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
184 tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
185 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
186 NI gcThreadId;
187 };
188 struct Exception {
189 RootObj Sup;
190 Exception* parent;
191 NCSTRING name;
192 NimStringDesc* message;
193 tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
194 Exception* up;
195 };
196 struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
197 Exception Sup;
198 };
199 struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
200 tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
201 };
202 struct tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag {
203 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw Sup;
204 };
205 typedef NU8 tySet_tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg;
206 typedef NU8 tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg;
207 struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
208 NCSTRING procname;
209 NI line;
210 NCSTRING filename;
211 };
212 struct tySequence__xv3aaFd3JCw8NbmALHiezQ {
213 TGenericSeq Sup;
214 tyTuple__sPaDkVPSC0MkcoXCxPH9ccA data[SEQ_DECL_SIZE];
215 };
216 struct tySequence__uB9b75OUPRENsBAu4AnoePA {
217 TGenericSeq Sup;
218 tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
219 };
220 N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
221 static N_NIMCALL(void, Marker_tySequence__xv3aaFd3JCw8NbmALHiezQ)(void* p, NI op);
222 static N_NIMCALL(void, Marker_tyRef__n9cmoMXcDs47wYDFGEXuCfw)(void* p, NI op);
223 N_LIB_PRIVATE N_NOINLINE(void*, newObj)(TNimType* typ, NI size);
224 static N_INLINE(void, nimGCunrefRC1)(void* p);
225 static N_INLINE(void, decRef__system_5316)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
226 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
227 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
228 static N_INLINE(void, rtlAddZCT__system_5314)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
229 N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5265)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
230 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5271)(void* usr);
231 N_LIB_PRIVATE N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
232 N_LIB_PRIVATE N_NIMCALL(NI, rawGet__pureZstrtabs_121)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key);
233 N_LIB_PRIVATE N_NIMCALL(NI, myhash__pureZstrtabs_101)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key);
234 N_LIB_PRIVATE N_NIMCALL(NI, hash__pureZhashes_291)(NimStringDesc* x);
235 N_LIB_PRIVATE N_NIMCALL(NI, hashIgnoreCase__pureZhashes_365)(NimStringDesc* x);
236 N_LIB_PRIVATE N_NIMCALL(NI, hashIgnoreStyle__pureZhashes_302)(NimStringDesc* x);
237 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, myCmp__pureZstrtabs_105)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* a, NimStringDesc* b);
238 N_LIB_PRIVATE N_NIMCALL(NI, cmp__system_1549)(NimStringDesc* x, NimStringDesc* y);
239 N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b);
240 N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
241 static N_INLINE(NI, nextTry__pureZstrtabs_117)(NI h, NI maxHash);
242 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
243 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
244 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
245 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
246 static N_INLINE(void, asgnRef)(void** dest, void* src);
247 static N_INLINE(void, incRef__system_5309)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
248 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
249 N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
250 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
251 static N_INLINE(void, nimGCunrefNoCycle)(void* p);
252 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, mustRehash__pureZstrtabs_110)(NI length, NI counter);
253 N_LIB_PRIVATE N_NIMCALL(void, enlarge__pureZstrtabs_199)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t);
254 N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
255 N_LIB_PRIVATE N_NIMCALL(void, rawInsert__pureZstrtabs_187)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, tySequence__xv3aaFd3JCw8NbmALHiezQ** data, NimStringDesc* key, NimStringDesc* val);
256 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
257 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
258 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getValue__pureZstrtabs_317)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, tySet_tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg flags, NimStringDesc* key);
259 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsthasKey)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key);
260 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getOrDefault__pureZstrtabs_173)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key, NimStringDesc* default_0);
261 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getEnv__pureZos_418)(NimStringDesc* key, NimStringDesc* default_0);
262 static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
263 N_LIB_PRIVATE N_NIMCALL(void, raiseFormatException__pureZstrtabs_314)(NimStringDesc* s);
264 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_7744)(NimStringDesc* s, NI first, NI last);
265 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
266 extern TNimType NTIrootobj__ytyiCJqK439aF9cIibuRVpAg_;
267 N_LIB_PRIVATE TNimType NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_;
268 extern TNimType NTIint__rR5Bzr1D5krxoo1NcNyeMA_;
269 N_LIB_PRIVATE TNimType NTIkeyvaluepair__sPaDkVPSC0MkcoXCxPH9ccA_;
270 extern TNimType NTIstring__77mFvmsOLKik79ci2hXkHEg_;
271 extern TNimType NTIbool__VaVACK0bpYmqIQ0mKcHfQQ_;
272 N_LIB_PRIVATE TNimType NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_;
273 N_LIB_PRIVATE TNimType NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_;
274 N_LIB_PRIVATE TNimType NTIstringtableref__n9cmoMXcDs47wYDFGEXuCfw_;
275 extern TNimType NTIrefkeyerror__8SzoIAgLw9ci2v0yafHj9b6Q_;
276 extern TNimType NTIkeyerror__t7nhKLvXTQS9cS8ByJU9bIag_;
277 STRING_LITERAL(TM__ZT9crccxweoChVXn9cHcxIXQ_7, "key not found: ", 15);
278 extern TNimType NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_;
279 extern TNimType NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_;
280 STRING_LITERAL(TM__ZT9crccxweoChVXn9cHcxIXQ_8, "format string: key not found: ", 30);
281 extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5218;
N_NIMCALL(void,Marker_tySequence__xv3aaFd3JCw8NbmALHiezQ)282 static N_NIMCALL(void, Marker_tySequence__xv3aaFd3JCw8NbmALHiezQ)(void* p, NI op) {
283 tySequence__xv3aaFd3JCw8NbmALHiezQ* a;
284 NI T1_;
285 a = (tySequence__xv3aaFd3JCw8NbmALHiezQ*)p;
286 T1_ = (NI)0;
287 for (T1_ = 0; T1_ < (a ? a->Sup.len : 0); T1_++) {
288 nimGCvisit((void*)a->data[T1_].Field0, op);
289 nimGCvisit((void*)a->data[T1_].Field1, op);
290 }
291 }
N_NIMCALL(void,Marker_tyRef__n9cmoMXcDs47wYDFGEXuCfw)292 static N_NIMCALL(void, Marker_tyRef__n9cmoMXcDs47wYDFGEXuCfw)(void* p, NI op) {
293 tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* a;
294 a = (tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*)p;
295 nimGCvisit((void*)(*a).data, op);
296 }
N_INLINE(NI,minuspercent___system_716)297 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y) {
298 NI result;
299 result = (NI)0;
300 result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
301 return result;
302 }
N_INLINE(NIM_BOOL,ltpercent___system_1005)303 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
304 NIM_BOOL result;
305 result = (NIM_BOOL)0;
306 result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
307 return result;
308 }
N_INLINE(void,rtlAddZCT__system_5314)309 static N_INLINE(void, rtlAddZCT__system_5314)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
310 addZCT__system_5265((&gch__system_5218.zct), c);
311 }
N_INLINE(void,decRef__system_5316)312 static N_INLINE(void, decRef__system_5316)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
313 (*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
314 {
315 NIM_BOOL T3_;
316 T3_ = (NIM_BOOL)0;
317 T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
318 if (!T3_) goto LA4_;
319 rtlAddZCT__system_5314(c);
320 }
321 LA4_: ;
322 }
N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g *,usrToCell__system_5271)323 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5271)(void* usr) {
324 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
325 NI T1_;
326 result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
327 T1_ = (NI)0;
328 T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 16));
329 result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
330 return result;
331 }
N_INLINE(void,nimGCunrefRC1)332 static N_INLINE(void, nimGCunrefRC1)(void* p) {
333 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
334 T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
335 T1_ = usrToCell__system_5271(p);
336 decRef__system_5316(T1_);
337 }
N_NIMCALL(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg *,nstnewStringTable)338 N_LIB_PRIVATE N_NIMCALL(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*, nstnewStringTable)(tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ mode) {
339 tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* result;
340 result = NIM_NIL;
341 result = (tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*) newObj((&NTIstringtableref__n9cmoMXcDs47wYDFGEXuCfw_), sizeof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg));
342 (*result).Sup.m_type = (&NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_);
343 (*result).mode = mode;
344 (*result).counter = ((NI) 0);
345 if ((*result).data) { nimGCunrefRC1((*result).data); (*result).data = NIM_NIL; }
346 (*result).data = (tySequence__xv3aaFd3JCw8NbmALHiezQ*) newSeqRC1((&NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_), ((NI) 64));
347 return result;
348 }
N_NIMCALL(NI,myhash__pureZstrtabs_101)349 N_LIB_PRIVATE N_NIMCALL(NI, myhash__pureZstrtabs_101)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
350 NI result;
351 result = (NI)0;
352 switch ((*t).mode) {
353 case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 0):
354 {
355 result = hash__pureZhashes_291(key);
356 }
357 break;
358 case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 1):
359 {
360 result = hashIgnoreCase__pureZhashes_365(key);
361 }
362 break;
363 case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 2):
364 {
365 result = hashIgnoreStyle__pureZhashes_302(key);
366 }
367 break;
368 }
369 return result;
370 }
N_NIMCALL(NIM_BOOL,myCmp__pureZstrtabs_105)371 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, myCmp__pureZstrtabs_105)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* a, NimStringDesc* b) {
372 NIM_BOOL result;
373 result = (NIM_BOOL)0;
374 switch ((*t).mode) {
375 case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 0):
376 {
377 NI T2_;
378 T2_ = (NI)0;
379 T2_ = cmp__system_1549(a, b);
380 result = (T2_ == ((NI) 0));
381 }
382 break;
383 case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 1):
384 {
385 NI T4_;
386 T4_ = (NI)0;
387 T4_ = nsuCmpIgnoreCase(a, b);
388 result = (T4_ == ((NI) 0));
389 }
390 break;
391 case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 2):
392 {
393 NI T6_;
394 T6_ = (NI)0;
395 T6_ = nsuCmpIgnoreStyle(a, b);
396 result = (T6_ == ((NI) 0));
397 }
398 break;
399 }
400 return result;
401 }
N_INLINE(NI,nextTry__pureZstrtabs_117)402 static N_INLINE(NI, nextTry__pureZstrtabs_117)(NI h, NI maxHash) {
403 NI result;
404 result = (NI)0;
405 result = (NI)((NI)(h + ((NI) 1)) & maxHash);
406 return result;
407 }
N_NIMCALL(NI,rawGet__pureZstrtabs_121)408 N_LIB_PRIVATE N_NIMCALL(NI, rawGet__pureZstrtabs_121)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
409 NI result;
410 NI h;
411 NI T1_;
412 NI T2_;
413 { result = (NI)0;
414 T1_ = (NI)0;
415 T1_ = myhash__pureZstrtabs_101(t, key);
416 T2_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
417 h = (NI)(T1_ & T2_);
418 {
419 while (1) {
420 NI T10_;
421 if (!(*t).data->data[h].Field2) goto LA4;
422 {
423 NIM_BOOL T7_;
424 T7_ = (NIM_BOOL)0;
425 T7_ = myCmp__pureZstrtabs_105(t, (*t).data->data[h].Field0, key);
426 if (!T7_) goto LA8_;
427 result = h;
428 goto BeforeRet_;
429 }
430 LA8_: ;
431 T10_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
432 h = nextTry__pureZstrtabs_117(h, T10_);
433 } LA4: ;
434 }
435 result = ((NI) -1);
436 }BeforeRet_: ;
437 return result;
438 }
N_NIMCALL(NIM_BOOL,nsthasKey)439 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsthasKey)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
440 NIM_BOOL result;
441 NI T1_;
442 result = (NIM_BOOL)0;
443 T1_ = (NI)0;
444 T1_ = rawGet__pureZstrtabs_121(t, key);
445 result = (((NI) 0) <= T1_);
446 return result;
447 }
N_INLINE(void,nimCopyMem)448 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
449 void* T1_;
450 T1_ = (void*)0;
451 T1_ = memcpy(dest, source, ((size_t) (size)));
452 }
N_INLINE(void,copyMem__system_1727)453 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
454 nimCopyMem(dest, source, size);
455 }
N_INLINE(void,appendString)456 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
457 {
458 if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
459 copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
460 (*dest).Sup.len += (*src).Sup.len;
461 }
462 LA3_: ;
463 }
N_INLINE(NI,pluspercent___system_696)464 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
465 NI result;
466 result = (NI)0;
467 result = ((NI) ((NU)((NU64)(((NU) (x))) + (NU64)(((NU) (y))))));
468 return result;
469 }
N_INLINE(void,incRef__system_5309)470 static N_INLINE(void, incRef__system_5309)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
471 (*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
472 }
N_INLINE(void,asgnRef)473 static N_INLINE(void, asgnRef)(void** dest, void* src) {
474 {
475 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
476 if (!!((src == NIM_NIL))) goto LA3_;
477 T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
478 T5_ = usrToCell__system_5271(src);
479 incRef__system_5309(T5_);
480 }
481 LA3_: ;
482 {
483 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
484 if (!!(((*dest) == NIM_NIL))) goto LA8_;
485 T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
486 T10_ = usrToCell__system_5271((*dest));
487 decRef__system_5316(T10_);
488 }
489 LA8_: ;
490 (*dest) = src;
491 }
N_NIMCALL(NimStringDesc **,nstTake)492 N_LIB_PRIVATE N_NIMCALL(NimStringDesc**, nstTake)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
493 NimStringDesc** result;
494 NI indexX60gensym3_;
495 result = (NimStringDesc**)0;
496 indexX60gensym3_ = rawGet__pureZstrtabs_121(t, key);
497 {
498 if (!(((NI) 0) <= indexX60gensym3_)) goto LA3_;
499 result = (&(*t).data->data[indexX60gensym3_].Field1);
500 }
501 goto LA1_;
502 LA3_: ;
503 {
504 tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag* T6_;
505 NimStringDesc* T7_;
506 T6_ = NIM_NIL;
507 T6_ = (tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag*) newObj((&NTIrefkeyerror__8SzoIAgLw9ci2v0yafHj9b6Q_), sizeof(tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag));
508 (*T6_).Sup.Sup.Sup.Sup.m_type = (&NTIkeyerror__t7nhKLvXTQS9cS8ByJU9bIag_);
509 (*T6_).Sup.Sup.Sup.name = "KeyError";
510 T7_ = NIM_NIL;
511 T7_ = rawNewString((key ? key->Sup.len : 0) + 15);
512 appendString(T7_, ((NimStringDesc*) &TM__ZT9crccxweoChVXn9cHcxIXQ_7));
513 appendString(T7_, key);
514 asgnRef((void**) (&(*T6_).Sup.Sup.Sup.message), T7_);
515 asgnRef((void**) (&(*T6_).Sup.Sup.Sup.parent), ((Exception*) NIM_NIL));
516 raiseExceptionEx((Exception*)T6_, "KeyError", "[]", "strtabs.nim", 144);
517 }
518 LA1_: ;
519 return result;
520 }
N_INLINE(void,nimGCunrefNoCycle)521 static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
522 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
523 T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
524 T1_ = usrToCell__system_5271(p);
525 decRef__system_5316(T1_);
526 }
N_NIMCALL(NIM_BOOL,mustRehash__pureZstrtabs_110)527 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, mustRehash__pureZstrtabs_110)(NI length, NI counter) {
528 NIM_BOOL result;
529 NIM_BOOL T1_;
530 result = (NIM_BOOL)0;
531 T1_ = (NIM_BOOL)0;
532 T1_ = ((NI)(length * ((NI) 2)) < (NI)(counter * ((NI) 3)));
533 if (T1_) goto LA2_;
534 T1_ = ((NI)(length - counter) < ((NI) 4));
535 LA2_: ;
536 result = T1_;
537 return result;
538 }
N_NIMCALL(void,rawInsert__pureZstrtabs_187)539 N_LIB_PRIVATE N_NIMCALL(void, rawInsert__pureZstrtabs_187)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, tySequence__xv3aaFd3JCw8NbmALHiezQ** data, NimStringDesc* key, NimStringDesc* val) {
540 NI h;
541 NI T1_;
542 NI T2_;
543 NimStringDesc* T6_;
544 NimStringDesc* T7_;
545 T1_ = (NI)0;
546 T1_ = myhash__pureZstrtabs_101(t, key);
547 T2_ = (((*data) ? (*data)->Sup.len : 0)-1);
548 h = (NI)(T1_ & T2_);
549 {
550 while (1) {
551 NI T5_;
552 if (!(*data)->data[h].Field2) goto LA4;
553 T5_ = (((*data) ? (*data)->Sup.len : 0)-1);
554 h = nextTry__pureZstrtabs_117(h, T5_);
555 } LA4: ;
556 }
557 T6_ = NIM_NIL;
558 T6_ = (*data)->data[h].Field0; (*data)->data[h].Field0 = copyStringRC1(key);
559 if (T6_) nimGCunrefNoCycle(T6_);
560 T7_ = NIM_NIL;
561 T7_ = (*data)->data[h].Field1; (*data)->data[h].Field1 = copyStringRC1(val);
562 if (T7_) nimGCunrefNoCycle(T7_);
563 (*data)->data[h].Field2 = NIM_TRUE;
564 }
N_NIMCALL(void,enlarge__pureZstrtabs_199)565 N_LIB_PRIVATE N_NIMCALL(void, enlarge__pureZstrtabs_199)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t) {
566 tySequence__xv3aaFd3JCw8NbmALHiezQ* n;
567 NI T1_;
568 tySequence__xv3aaFd3JCw8NbmALHiezQ* T12_;
569 n = NIM_NIL;
570 T1_ = ((*t).data ? (*t).data->Sup.len : 0);
571 n = (tySequence__xv3aaFd3JCw8NbmALHiezQ*) newSeq((&NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_), ((NI) ((NI)(T1_ * ((NI) 2)))));
572 {
573 NI i;
574 NI colontmp_;
575 NI T3_;
576 NI res;
577 i = (NI)0;
578 colontmp_ = (NI)0;
579 T3_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
580 colontmp_ = T3_;
581 res = ((NI) 0);
582 {
583 while (1) {
584 if (!(res <= colontmp_)) goto LA5;
585 i = res;
586 {
587 NimStringDesc* T10_;
588 NimStringDesc* T11_;
589 if (!(*t).data->data[i].Field2) goto LA8_;
590 T10_ = NIM_NIL;
591 T10_ = (*t).data->data[i].Field0;
592 asgnRef((void**) (&(*t).data->data[i].Field0), NIM_NIL);
593 T11_ = NIM_NIL;
594 T11_ = (*t).data->data[i].Field1;
595 asgnRef((void**) (&(*t).data->data[i].Field1), NIM_NIL);
596 rawInsert__pureZstrtabs_187(t, (&n), T10_, T11_);
597 }
598 LA8_: ;
599 res += ((NI) 1);
600 } LA5: ;
601 }
602 }
603 T12_ = NIM_NIL;
604 T12_ = (*t).data;
605 asgnRef((void**) (&(*t).data), n);
606 n = T12_;
607 }
N_NIMCALL(void,nstPut)608 N_LIB_PRIVATE N_NIMCALL(void, nstPut)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key, NimStringDesc* val) {
609 NI index;
610 index = rawGet__pureZstrtabs_121(t, key);
611 {
612 NimStringDesc* T5_;
613 if (!(((NI) 0) <= index)) goto LA3_;
614 T5_ = NIM_NIL;
615 T5_ = (*t).data->data[index].Field1; (*t).data->data[index].Field1 = copyStringRC1(val);
616 if (T5_) nimGCunrefNoCycle(T5_);
617 }
618 goto LA1_;
619 LA3_: ;
620 {
621 {
622 NI T9_;
623 NIM_BOOL T10_;
624 T9_ = ((*t).data ? (*t).data->Sup.len : 0);
625 T10_ = (NIM_BOOL)0;
626 T10_ = mustRehash__pureZstrtabs_110(T9_, (*t).counter);
627 if (!T10_) goto LA11_;
628 enlarge__pureZstrtabs_199(t);
629 }
630 LA11_: ;
631 rawInsert__pureZstrtabs_187(t, (&(*t).data), key, val);
632 (*t).counter += ((NI) 1);
633 }
634 LA1_: ;
635 }
N_NIMCALL(void,del__pureZstrtabs_356)636 N_LIB_PRIVATE N_NIMCALL(void, del__pureZstrtabs_356)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
637 NI i;
638 NI msk;
639 NI T1_;
640 i = rawGet__pureZstrtabs_121(t, key);
641 T1_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
642 msk = T1_;
643 {
644 if (!(((NI) 0) <= i)) goto LA4_;
645 (*t).counter -= ((NI) 1);
646 {
647 {
648 while (1) {
649 NI j;
650 NI r;
651 j = i;
652 r = j;
653 (*t).data->data[i].Field2 = NIM_FALSE;
654 asgnRef((void**) (&(*t).data->data[i].Field0), ((NimStringDesc*) NIM_NIL));
655 asgnRef((void**) (&(*t).data->data[i].Field1), ((NimStringDesc*) NIM_NIL));
656 {
657 while (1) {
658 NI T15_;
659 i = (NI)((NI)(i + ((NI) 1)) & msk);
660 {
661 if (!!((*t).data->data[i].Field2)) goto LA13_;
662 goto LA6;
663 }
664 LA13_: ;
665 T15_ = (NI)0;
666 T15_ = myhash__pureZstrtabs_101(t, (*t).data->data[i].Field0);
667 r = (NI)(T15_ & msk);
668 {
669 NIM_BOOL T18_;
670 NIM_BOOL T19_;
671 NIM_BOOL T20_;
672 NIM_BOOL T23_;
673 NIM_BOOL T26_;
674 T18_ = (NIM_BOOL)0;
675 T19_ = (NIM_BOOL)0;
676 T20_ = (NIM_BOOL)0;
677 T20_ = (r <= i);
678 if (!(T20_)) goto LA21_;
679 T20_ = (j < r);
680 LA21_: ;
681 T19_ = T20_;
682 if (T19_) goto LA22_;
683 T23_ = (NIM_BOOL)0;
684 T23_ = (j < r);
685 if (!(T23_)) goto LA24_;
686 T23_ = (i < j);
687 LA24_: ;
688 T19_ = T23_;
689 LA22_: ;
690 T18_ = T19_;
691 if (T18_) goto LA25_;
692 T26_ = (NIM_BOOL)0;
693 T26_ = (i < j);
694 if (!(T26_)) goto LA27_;
695 T26_ = (r <= i);
696 LA27_: ;
697 T18_ = T26_;
698 LA25_: ;
699 if (!!(T18_)) goto LA28_;
700 goto LA9;
701 }
702 LA28_: ;
703 }
704 } LA9: ;
705 asgnRef((void**) (&(*t).data->data[j].Field0), (*t).data->data[i].Field0);
706 asgnRef((void**) (&(*t).data->data[j].Field1), (*t).data->data[i].Field1);
707 (*t).data->data[j].Field2 = (*t).data->data[i].Field2;
708 }
709 }
710 } LA6: ;
711 }
712 LA4_: ;
713 }
N_NIMCALL(NI,nstlen)714 N_LIB_PRIVATE N_NIMCALL(NI, nstlen)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t) {
715 NI result;
716 result = (NI)0;
717 result = (*t).counter;
718 return result;
719 }
N_NIMCALL(NimStringDesc *,getOrDefault__pureZstrtabs_173)720 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getOrDefault__pureZstrtabs_173)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key, NimStringDesc* default_0) {
721 NimStringDesc* result;
722 NI index;
723 result = NIM_NIL;
724 index = rawGet__pureZstrtabs_121(t, key);
725 {
726 if (!(((NI) 0) <= index)) goto LA3_;
727 result = copyString((*t).data->data[index].Field1);
728 }
729 goto LA1_;
730 LA3_: ;
731 {
732 result = copyString(default_0);
733 }
734 LA1_: ;
735 return result;
736 }
N_INLINE(void,appendChar)737 static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
738 (*dest).data[(*dest).Sup.len] = c;
739 (*dest).data[(NI)((*dest).Sup.len + ((NI) 1))] = 0;
740 (*dest).Sup.len += ((NI) 1);
741 }
N_NIMCALL(void,raiseFormatException__pureZstrtabs_314)742 N_LIB_PRIVATE N_NIMCALL(void, raiseFormatException__pureZstrtabs_314)(NimStringDesc* s) {
743 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T1_;
744 NimStringDesc* T2_;
745 T1_ = NIM_NIL;
746 T1_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
747 (*T1_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
748 (*T1_).Sup.Sup.name = "ValueError";
749 T2_ = NIM_NIL;
750 T2_ = rawNewString((s ? s->Sup.len : 0) + 30);
751 appendString(T2_, ((NimStringDesc*) &TM__ZT9crccxweoChVXn9cHcxIXQ_8));
752 appendString(T2_, s);
753 asgnRef((void**) (&(*T1_).Sup.Sup.message), T2_);
754 asgnRef((void**) (&(*T1_).Sup.Sup.parent), ((Exception*) NIM_NIL));
755 raiseExceptionEx((Exception*)T1_, "ValueError", "raiseFormatException", "strtabs.nim", 299);
756 }
N_NIMCALL(NimStringDesc *,getValue__pureZstrtabs_317)757 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getValue__pureZstrtabs_317)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, tySet_tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg flags, NimStringDesc* key) {
758 NimStringDesc* result;
759 { result = NIM_NIL;
760 {
761 NIM_BOOL T3_;
762 T3_ = (NIM_BOOL)0;
763 T3_ = nsthasKey(t, key);
764 if (!T3_) goto LA4_;
765 result = getOrDefault__pureZstrtabs_173(t, key, ((NimStringDesc*) NIM_NIL));
766 goto BeforeRet_;
767 }
768 LA4_: ;
769 {
770 if (!((flags &((NU8)1<<((NU)(((tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg) 0))&7U)))!=0)) goto LA8_;
771 result = getEnv__pureZos_418(key, ((NimStringDesc*) NIM_NIL));
772 }
773 goto LA6_;
774 LA8_: ;
775 {
776 result = ((NimStringDesc*) NIM_NIL);
777 }
778 LA6_: ;
779 {
780 if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA13_;
781 {
782 NimStringDesc* T19_;
783 if (!((flags &((NU8)1<<((NU)(((tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg) 2))&7U)))!=0)) goto LA17_;
784 T19_ = NIM_NIL;
785 T19_ = rawNewString((key ? key->Sup.len : 0) + 1);
786 appendChar(T19_, 36);
787 appendString(T19_, key);
788 result = T19_;
789 }
790 goto LA15_;
791 LA17_: ;
792 {
793 if (!!(((flags &((NU8)1<<((NU)(((tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg) 1))&7U)))!=0))) goto LA21_;
794 raiseFormatException__pureZstrtabs_314(key);
795 }
796 goto LA15_;
797 LA21_: ;
798 LA15_: ;
799 }
800 LA13_: ;
801 }BeforeRet_: ;
802 return result;
803 }
N_NIMCALL(NimStringDesc *,nstFormat)804 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nstFormat)(NimStringDesc* f, tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, tySet_tyEnum_FormatFlag__F4vlKAV4d0Kt9aXmu9cVNBrg flags) {
805 NimStringDesc* result;
806 NI i;
807 result = NIM_NIL;
808 result = ((NimStringDesc*) NIM_NIL);
809 i = ((NI) 0);
810 {
811 while (1) {
812 if (!(i < (f ? f->Sup.len : 0))) goto LA2;
813 {
814 if (!((NU8)(f->data[i]) == (NU8)(36))) goto LA5_;
815 switch (((NU8)(f->data[(NI)(i + ((NI) 1))]))) {
816 case 36:
817 {
818 result = addChar(result, 36);
819 i += ((NI) 2);
820 }
821 break;
822 case 123:
823 {
824 NI j;
825 NimStringDesc* T13_;
826 NimStringDesc* T14_;
827 j = (NI)(i + ((NI) 1));
828 {
829 while (1) {
830 NIM_BOOL T11_;
831 T11_ = (NIM_BOOL)0;
832 T11_ = (j < (f ? f->Sup.len : 0));
833 if (!(T11_)) goto LA12_;
834 T11_ = !(((NU8)(f->data[j]) == (NU8)(125)));
835 LA12_: ;
836 if (!T11_) goto LA10;
837 j += ((NI) 1);
838 } LA10: ;
839 }
840 T13_ = NIM_NIL;
841 T13_ = substr__system_7744(f, (NI)(i + ((NI) 2)), (NI)(j - ((NI) 1)));
842 T14_ = NIM_NIL;
843 T14_ = getValue__pureZstrtabs_317(t, flags, T13_);
844 result = resizeString(result, (T14_ ? T14_->Sup.len : 0) + 0);
845 appendString(result, T14_);
846 i = (NI)(j + ((NI) 1));
847 }
848 break;
849 case 97 ... 122:
850 case 65 ... 90:
851 case 128 ... 255:
852 case 95:
853 {
854 NI j_2;
855 NimStringDesc* T20_;
856 NimStringDesc* T21_;
857 j_2 = (NI)(i + ((NI) 1));
858 {
859 while (1) {
860 NIM_BOOL T18_;
861 T18_ = (NIM_BOOL)0;
862 T18_ = (j_2 < (f ? f->Sup.len : 0));
863 if (!(T18_)) goto LA19_;
864 T18_ = (((NU8)(f->data[j_2])) >= ((NU8)(97)) && ((NU8)(f->data[j_2])) <= ((NU8)(122)) || ((NU8)(f->data[j_2])) >= ((NU8)(65)) && ((NU8)(f->data[j_2])) <= ((NU8)(90)) || ((NU8)(f->data[j_2])) >= ((NU8)(48)) && ((NU8)(f->data[j_2])) <= ((NU8)(57)) || ((NU8)(f->data[j_2])) == ((NU8)(95)) || ((NU8)(f->data[j_2])) >= ((NU8)(128)) && ((NU8)(f->data[j_2])) <= ((NU8)(255)));
865 LA19_: ;
866 if (!T18_) goto LA17;
867 j_2 += ((NI) 1);
868 } LA17: ;
869 }
870 T20_ = NIM_NIL;
871 T20_ = substr__system_7744(f, (NI)(i + ((NI) 1)), (NI)(j_2 - ((NI) 1)));
872 T21_ = NIM_NIL;
873 T21_ = getValue__pureZstrtabs_317(t, flags, T20_);
874 result = resizeString(result, (T21_ ? T21_->Sup.len : 0) + 0);
875 appendString(result, T21_);
876 i = j_2;
877 }
878 break;
879 default:
880 {
881 result = addChar(result, f->data[i]);
882 i += ((NI) 1);
883 }
884 break;
885 }
886 }
887 goto LA3_;
888 LA5_: ;
889 {
890 result = addChar(result, f->data[i]);
891 i += ((NI) 1);
892 }
893 LA3_: ;
894 } LA2: ;
895 }
896 return result;
897 }
N_NIMCALL(void,stdlib_strtabsDatInit000)898 N_LIB_PRIVATE N_NIMCALL(void, stdlib_strtabsDatInit000)(void) {
899 static TNimNode* TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[3];
900 static TNimNode* TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[3];
901 static TNimNode* TM__ZT9crccxweoChVXn9cHcxIXQ_4_3[3];
902 NI TM__ZT9crccxweoChVXn9cHcxIXQ_6;
903 static char* NIM_CONST TM__ZT9crccxweoChVXn9cHcxIXQ_5[3] = {
904 "modeCaseSensitive",
905 "modeCaseInsensitive",
906 "modeStyleInsensitive"};
907 static TNimNode TM__ZT9crccxweoChVXn9cHcxIXQ_0[12];
908 NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_.size = sizeof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg);
909 NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_.align = NIM_ALIGNOF(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg);
910 NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_.kind = 17;
911 NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_.base = (&NTIrootobj__ytyiCJqK439aF9cIibuRVpAg_);
912 TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[0] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[1];
913 TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].kind = 1;
914 TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].offset = offsetof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg, counter);
915 TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].typ = (&NTIint__rR5Bzr1D5krxoo1NcNyeMA_);
916 TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].name = "counter";
917 TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[1] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[2];
918 NTIkeyvaluepair__sPaDkVPSC0MkcoXCxPH9ccA_.size = sizeof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA);
919 NTIkeyvaluepair__sPaDkVPSC0MkcoXCxPH9ccA_.align = NIM_ALIGNOF(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA);
920 NTIkeyvaluepair__sPaDkVPSC0MkcoXCxPH9ccA_.kind = 18;
921 NTIkeyvaluepair__sPaDkVPSC0MkcoXCxPH9ccA_.base = 0;
922 TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[0] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[4];
923 TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].kind = 1;
924 TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].offset = offsetof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA, Field0);
925 TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].typ = (&NTIstring__77mFvmsOLKik79ci2hXkHEg_);
926 TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].name = "Field0";
927 TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[1] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[5];
928 TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].kind = 1;
929 TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].offset = offsetof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA, Field1);
930 TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].typ = (&NTIstring__77mFvmsOLKik79ci2hXkHEg_);
931 TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].name = "Field1";
932 TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[2] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[6];
933 TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].kind = 1;
934 TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].offset = offsetof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA, Field2);
935 TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].typ = (&NTIbool__VaVACK0bpYmqIQ0mKcHfQQ_);
936 TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].name = "Field2";
937 TM__ZT9crccxweoChVXn9cHcxIXQ_0[3].len = 3; TM__ZT9crccxweoChVXn9cHcxIXQ_0[3].kind = 2; TM__ZT9crccxweoChVXn9cHcxIXQ_0[3].sons = &TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[0];
938 NTIkeyvaluepair__sPaDkVPSC0MkcoXCxPH9ccA_.node = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[3];
939 NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_.size = sizeof(tySequence__xv3aaFd3JCw8NbmALHiezQ*);
940 NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_.align = NIM_ALIGNOF(tySequence__xv3aaFd3JCw8NbmALHiezQ*);
941 NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_.kind = 24;
942 NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_.base = (&NTIkeyvaluepair__sPaDkVPSC0MkcoXCxPH9ccA_);
943 NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_.marker = Marker_tySequence__xv3aaFd3JCw8NbmALHiezQ;
944 TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].kind = 1;
945 TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].offset = offsetof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg, data);
946 TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].typ = (&NTIkeyvaluepairseq__xv3aaFd3JCw8NbmALHiezQ_);
947 TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].name = "data";
948 TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[2] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[7];
949 NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_.size = sizeof(tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ);
950 NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_.align = NIM_ALIGNOF(tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ);
951 NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_.kind = 14;
952 NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_.base = 0;
953 NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_.flags = 3;
954 for (TM__ZT9crccxweoChVXn9cHcxIXQ_6 = 0; TM__ZT9crccxweoChVXn9cHcxIXQ_6 < 3; TM__ZT9crccxweoChVXn9cHcxIXQ_6++) {
955 TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8].kind = 1;
956 TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8].offset = TM__ZT9crccxweoChVXn9cHcxIXQ_6;
957 TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8].name = TM__ZT9crccxweoChVXn9cHcxIXQ_5[TM__ZT9crccxweoChVXn9cHcxIXQ_6];
958 TM__ZT9crccxweoChVXn9cHcxIXQ_4_3[TM__ZT9crccxweoChVXn9cHcxIXQ_6] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8];
959 }
960 TM__ZT9crccxweoChVXn9cHcxIXQ_0[11].len = 3; TM__ZT9crccxweoChVXn9cHcxIXQ_0[11].kind = 2; TM__ZT9crccxweoChVXn9cHcxIXQ_0[11].sons = &TM__ZT9crccxweoChVXn9cHcxIXQ_4_3[0];
961 NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_.node = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[11];
962 TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].kind = 1;
963 TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].offset = offsetof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg, mode);
964 TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].typ = (&NTIstringtablemode__G9c4wVDFIzf0xHmQvxso9a9cQ_);
965 TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].name = "mode";
966 TM__ZT9crccxweoChVXn9cHcxIXQ_0[0].len = 3; TM__ZT9crccxweoChVXn9cHcxIXQ_0[0].kind = 2; TM__ZT9crccxweoChVXn9cHcxIXQ_0[0].sons = &TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[0];
967 NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_.node = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[0];
968 NTIstringtableref__n9cmoMXcDs47wYDFGEXuCfw_.size = sizeof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*);
969 NTIstringtableref__n9cmoMXcDs47wYDFGEXuCfw_.align = NIM_ALIGNOF(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*);
970 NTIstringtableref__n9cmoMXcDs47wYDFGEXuCfw_.kind = 22;
971 NTIstringtableref__n9cmoMXcDs47wYDFGEXuCfw_.base = (&NTIstringtableobj__V5PVrt9bIxZEeV7lfvqqtNg_);
972 NTIstringtableref__n9cmoMXcDs47wYDFGEXuCfw_.marker = Marker_tyRef__n9cmoMXcDs47wYDFGEXuCfw;
973 }
974
975