1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 64
3
4 #include "nimbase.h"
5 #include <string.h>
6 #include <stdio.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_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
25 typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
26 typedef struct Exception Exception;
27 typedef struct RootObj RootObj;
28 typedef struct TNimType TNimType;
29 typedef struct TNimNode TNimNode;
30 typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
31 typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
32 typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
33 typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
34 typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
35 typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
36 typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
37 typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
38 typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
39 typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
40 typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
41 typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
42 typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
43 typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
44 typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
45 typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
46 typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
47 typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
48 typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
49 typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
50 typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
51 struct TGenericSeq {
52 NI len;
53 NI reserved;
54 };
55 struct NimStringDesc {
56 TGenericSeq Sup;
57 NIM_CHAR data[SEQ_DECL_SIZE];
58 };
59 typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
60 typedef NI tyArray__9cc9aPiDa8VaWjVcFLabEDZQ[256];
61 typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
62 typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
63 typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
64 typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
65 struct TNimType {
66 NI size;
67 NI align;
68 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
69 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
70 TNimType* base;
71 TNimNode* node;
72 void* finalizer;
73 tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
74 tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
75 };
76 struct RootObj {
77 TNimType* m_type;
78 };
79 struct Exception {
80 RootObj Sup;
81 Exception* parent;
82 NCSTRING name;
83 NimStringDesc* message;
84 tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
85 Exception* up;
86 };
87 struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
88 Exception Sup;
89 };
90 struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
91 tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
92 };
93 typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
94 struct TNimNode {
95 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
96 NI offset;
97 TNimType* typ;
98 NCSTRING name;
99 NI len;
100 TNimNode** sons;
101 };
102 struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
103 NI refcount;
104 TNimType* typ;
105 };
106 struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
107 void* bottom;
108 };
109 struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
110 NI len;
111 NI cap;
112 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
113 };
114 typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
115 typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
116 typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
117 typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
118 typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
119 struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
120 tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
121 };
122 typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
123 struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
124 tyArray__0aOLqZchNi8nWtMTi8ND8w link;
125 NI key;
126 NI upperBound;
127 NI level;
128 };
129 struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
130 tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
131 NI Field1;
132 };
133 typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
134 struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
135 NI len;
136 tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
137 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
138 };
139 struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
140 NI minLargeObj;
141 NI maxLargeObj;
142 tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
143 NU32 flBitmap;
144 tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
145 tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
146 tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
147 NI currMem;
148 NI maxMem;
149 NI freeMem;
150 NI occ;
151 NI lastSize;
152 tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
153 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
154 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
155 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
156 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
157 NIM_BOOL locked;
158 NIM_BOOL blockChunkSizeIncrease;
159 NI nextChunkSize;
160 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
161 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
162 };
163 struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
164 NI stackScans;
165 NI cycleCollections;
166 NI maxThreshold;
167 NI maxStackSize;
168 NI maxStackCells;
169 NI cycleTableSize;
170 NI64 maxPause;
171 };
172 struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
173 NI counter;
174 NI max;
175 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
176 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
177 };
178 struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
179 tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
180 NI cycleThreshold;
181 NI zctThreshold;
182 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
183 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
184 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
185 NI recGcLock;
186 tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
187 tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
188 tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
189 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
190 NI gcThreadId;
191 };
192 typedef NimStringDesc* tyArray__nHXaesL0DJZHyVS07ARPRA[1];
193 struct tyTuple__UV3llMMYFckfui8YMBuUZA {
194 NimStringDesc* Field0;
195 NimStringDesc* Field1;
196 };
197 struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
198 NI a;
199 NI b;
200 };
201 typedef NU8 tyEnum_BinaryPrefixMode__nDtrM19b3byM8T9ab2m7BwvA;
202 typedef NimStringDesc* tyArray__17w6ns39bmjfAZ429aQpCFUA[9];
203 typedef NU8 tyEnum_FloatFormatMode__pNvEoaqwoxKyoASD11vSgQ;
204 typedef NIM_CHAR tyArray__9bPFPkkEEeeNM9bKgiV8Q49cg[6];
205 typedef NIM_CHAR tyArray__Kn8ZOVsorvcNLB4isUeMzQ[2501];
206 typedef NIM_CHAR tyArray__vB7L5YKNrMfbzoUubCEcYg[3];
207 struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
208 NCSTRING procname;
209 NI line;
210 NCSTRING filename;
211 };
212 struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
213 TGenericSeq Sup;
214 NimStringDesc* 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(NimStringDesc*, toHexImpl__pureZstrutils_711)(NU64 x, NI len, NIM_BOOL handleNegative);
221 N_NIMCALL(NimStringDesc*, mnewString)(NI len);
222 static N_INLINE(NIM_CHAR, toLowerAscii__stdZprivateZstrimpl_1)(NIM_CHAR c);
223 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
224 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
225 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
226 static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
227 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_7754)(NimStringDesc* s, NI first, NI last);
228 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
229 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
230 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
231 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
232 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_7766)(NimStringDesc* s, NI first);
233 N_LIB_PRIVATE N_NIMCALL(void, nsuInitSkipTable)(NI* a, NimStringDesc* sub);
234 N_LIB_PRIVATE N_NIMCALL(void, fill__pureZstrutils_1405)(NI* a, NI aLen_0, NI value);
235 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStrA)(tyArray__9cc9aPiDa8VaWjVcFLabEDZQ a, NimStringDesc* s, NimStringDesc* sub, NI start, NI last);
236 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
237 N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
238 N_LIB_PRIVATE N_NIMCALL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
239 N_LIB_PRIVATE N_NOINLINE(void, invalidFormatString__pureZstrutils_2142)(void);
240 N_LIB_PRIVATE N_NOINLINE(void*, newObj)(TNimType* typ, NI size);
241 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
242 static N_INLINE(void, nimGCunrefNoCycle)(void* p);
243 static N_INLINE(void, decRef__system_5324)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
244 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
245 static N_INLINE(void, rtlAddZCT__system_5322)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
246 N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5273)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
247 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5279)(void* usr);
248 static N_INLINE(void, asgnRef)(void** dest, void* src);
249 static N_INLINE(void, incRef__system_5317)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
250 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
251 N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
252 N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
253 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
254 N_LIB_PRIVATE N_NIMCALL(NI, findNormalized__pureZstrutils_2130)(NimStringDesc* x, NimStringDesc** inArray, NI inArrayLen_0);
255 N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
256 N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_56)(NimStringDesc* msg);
257 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last);
258 static N_INLINE(void, nimZeroMem)(void* p, NI size);
259 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
260 N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c);
261 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuStartsWith)(NimStringDesc* s, NimStringDesc* prefix);
262 N_LIB_PRIVATE N_NIMCALL(NI, parseHex__pureZstrutils_895)(NimStringDesc* s, NI* number, NI start, NI maxLen);
263 static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
264 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuEndsWith)(NimStringDesc* s, NimStringDesc* suffix);
265 N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
266 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindCharSet)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars, NI start, NI last);
267 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuContinuesWith)(NimStringDesc* s, NimStringDesc* substr, NI start);
268 N_LIB_PRIVATE N_NIMCALL(NI, npuParseInt)(NimStringDesc* s, NI* number, NI start);
269 N_LIB_PRIVATE N_NIMCALL(NI, npuParseFloat)(NimStringDesc* s, NF* number, NI start);
270 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___systemZdollars_3)(NI x);
271 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
272 static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
273 static N_INLINE(NIM_BOOL, equalMem__system_1735)(void* a, void* b, NI size);
274 static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size);
275 N_LIB_PRIVATE N_NIMCALL(NI, hashString)(NimStringDesc* s);
276 N_LIB_PRIVATE N_NIMCALL(NI, npuParseBiggestInt)(NimStringDesc* s, NI64* number, NI start);
277 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, substrEq__pureZstrutils_229)(NimStringDesc* s, NI pos, NimStringDesc* substr);
278 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__pureZstrutils_1792)(NI x, NI len);
279 static N_INLINE(NimStringDesc*, X5BX5D___pureZunicode_865)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
280 static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___pureZunicode_840)(NI a, NI b);
281 static N_INLINE(NimStringDesc*, X5BX5D___pureZunicode_3215)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
282 static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___stdZenumutils_80)(NI a, NI b);
283 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuUnindent)(NimStringDesc* s, NI count, NimStringDesc* padding);
284 N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c);
285 N_LIB_PRIVATE N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt);
286 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuformatFloat)(NF f, tyEnum_FloatFormatMode__pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep);
287 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuformatBiggestFloat)(NF f, tyEnum_FloatFormatMode__pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep);
288 N_LIB_PRIVATE N_NIMCALL(void, trimZeros__pureZstrutils_1951)(NimStringDesc** x, NIM_CHAR decimalSep);
289 N_LIB_PRIVATE N_NIMCALL(void, nsuDelete)(NimStringDesc** s, NI first, NI last);
290 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_2, "0123456789ABCDEF", 16);
291 extern TNimType NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_;
292 extern TNimType NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_;
293 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_3, "invalid format string", 21);
294 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_4, "strutils.nim(2028, 12) `sub.len > 0` ", 37);
295 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_5, "String does not start with: ", 28);
296 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_6, "\\", 1);
297 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_7, "String does not end in: ", 24);
298 extern TNimType NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_;
299 static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__JGc9b9bh2D3nTdUR7TGyq8aA_8 = {
300 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
301 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
302 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
303 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
304 ;
305 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_9, "invalid hex integer: ", 21);
306 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_10, "invalid integer: ", 17);
307 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_11, "invalid float: ", 15);
308 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_12, "y", 1);
309 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_13, "yes", 3);
310 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_14, "true", 4);
311 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_15, "1", 1);
312 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_16, "on", 2);
313 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_17, "n", 1);
314 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_18, "no", 2);
315 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_19, "false", 5);
316 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_20, "0", 1);
317 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_21, "off", 3);
318 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_22, "cannot interpret as a bool: ", 28);
319 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_23, "strutils.nim(739, 11) `sep.len > 0` ", 36);
320 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_24, "\\x", 2);
321 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_25, "\\\\", 2);
322 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_26, "\\\'", 2);
323 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_27, "\\\"", 2);
324 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_28, "\012", 1);
325 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_29, " ", 1);
326 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_30, "k", 1);
327 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_31, "M", 1);
328 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_32, "G", 1);
329 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_33, "T", 1);
330 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_34, "P", 1);
331 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_35, "E", 1);
332 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_36, "Z", 1);
333 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_37, "Y", 1);
334 N_LIB_PRIVATE NIM_CONST tyArray__17w6ns39bmjfAZ429aQpCFUA collPrefixes__pureZstrutils_1978 = {((NimStringDesc*) NIM_NIL),
335 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_30),
336 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_31),
337 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_32),
338 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_33),
339 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_34),
340 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_35),
341 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_36),
342 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_37)}
343 ;
344 extern TNimType NTIstring__77mFvmsOLKik79ci2hXkHEg_;
345 N_LIB_PRIVATE TNimType NTIarrayL48OO56_stringT__17w6ns39bmjfAZ429aQpCFUA_;
346 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_38, "Ki", 2);
347 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_39, "Mi", 2);
348 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_40, "Gi", 2);
349 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_41, "Ti", 2);
350 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_42, "Pi", 2);
351 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_43, "Ei", 2);
352 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_44, "Zi", 2);
353 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_45, "Yi", 2);
354 N_LIB_PRIVATE NIM_CONST tyArray__17w6ns39bmjfAZ429aQpCFUA iecPrefixes__pureZstrutils_1977 = {((NimStringDesc*) NIM_NIL),
355 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_38),
356 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_39),
357 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_40),
358 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_41),
359 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_42),
360 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_43),
361 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_44),
362 ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_45)}
363 ;
364 N_LIB_PRIVATE NIM_CONST tyArray__vB7L5YKNrMfbzoUubCEcYg floatFormatToChar__pureZstrutils_1864 = {103,
365 102,
366 101}
367 ;
368 STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_46, "B", 1);
369 extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5226;
N_NIMCALL(NimStringDesc *,toHexImpl__pureZstrutils_711)370 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHexImpl__pureZstrutils_711)(NU64 x, NI len, NIM_BOOL handleNegative) {
371 NimStringDesc* result;
372 NU64 n;
373 result = NIM_NIL;
374 n = x;
375 result = mnewString(((NI) (len)));
376 {
377 NI j;
378 NI colontmp_;
379 NI res;
380 j = (NI)0;
381 colontmp_ = (NI)0;
382 colontmp_ = (NI)(((NI) (len)) - ((NI) 1));
383 res = colontmp_;
384 {
385 while (1) {
386 if (!(((NI) 0) <= res)) goto LA3;
387 j = res;
388 result->data[j] = ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_2)->data[(NU64)(n & 15ULL)];
389 n = (NU64)((NU64)(n) >> (NU64)(((NI) 4)));
390 {
391 NIM_BOOL T6_;
392 T6_ = (NIM_BOOL)0;
393 T6_ = (n == 0ULL);
394 if (!(T6_)) goto LA7_;
395 T6_ = handleNegative;
396 LA7_: ;
397 if (!T6_) goto LA8_;
398 n = 18446744073709551615ULL;
399 }
400 LA8_: ;
401 res -= ((NI) 1);
402 } LA3: ;
403 }
404 }
405 return result;
406 }
N_NIMCALL(NimStringDesc *,toHex__pureZstrutils_1792)407 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__pureZstrutils_1792)(NI x, NI len) {
408 NimStringDesc* result;
409 result = NIM_NIL;
410 result = toHexImpl__pureZstrutils_711(((NU64) (x)), len, (x < ((NI) 0)));
411 return result;
412 }
N_INLINE(NIM_CHAR,toLowerAscii__stdZprivateZstrimpl_1)413 static N_INLINE(NIM_CHAR, toLowerAscii__stdZprivateZstrimpl_1)(NIM_CHAR c) {
414 NIM_CHAR result;
415 result = (NIM_CHAR)0;
416 {
417 if (!(((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)))) goto LA3_;
418 result = ((NIM_CHAR) (((NI) ((NI)(((NU8)(c)) + ((NI) 32))))));
419 }
420 goto LA1_;
421 LA3_: ;
422 {
423 result = c;
424 }
425 LA1_: ;
426 return result;
427 }
N_NIMCALL(NI,nsuCmpIgnoreStyle)428 N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b) {
429 NI result;
430 NI aLenX60gensym25_;
431 NI bLenX60gensym25_;
432 NI iX60gensym25_;
433 NI jX60gensym25_;
434 { result = (NI)0;
435 aLenX60gensym25_ = (a ? a->Sup.len : 0);
436 bLenX60gensym25_ = (b ? b->Sup.len : 0);
437 iX60gensym25_ = ((NI) 0);
438 jX60gensym25_ = ((NI) 0);
439 {
440 while (1) {
441 NIM_CHAR aaX60gensym25_;
442 NIM_CHAR bbX60gensym25_;
443 {
444 while (1) {
445 NIM_BOOL T5_;
446 T5_ = (NIM_BOOL)0;
447 T5_ = (iX60gensym25_ < aLenX60gensym25_);
448 if (!(T5_)) goto LA6_;
449 T5_ = ((NU8)(a->data[iX60gensym25_]) == (NU8)(95));
450 LA6_: ;
451 if (!T5_) goto LA4;
452 iX60gensym25_ += ((NI) 1);
453 } LA4: ;
454 }
455 {
456 while (1) {
457 NIM_BOOL T9_;
458 T9_ = (NIM_BOOL)0;
459 T9_ = (jX60gensym25_ < bLenX60gensym25_);
460 if (!(T9_)) goto LA10_;
461 T9_ = ((NU8)(b->data[jX60gensym25_]) == (NU8)(95));
462 LA10_: ;
463 if (!T9_) goto LA8;
464 jX60gensym25_ += ((NI) 1);
465 } LA8: ;
466 }
467 {
468 if (!(iX60gensym25_ < aLenX60gensym25_)) goto LA13_;
469 aaX60gensym25_ = toLowerAscii__stdZprivateZstrimpl_1(a->data[iX60gensym25_]);
470 }
471 goto LA11_;
472 LA13_: ;
473 {
474 aaX60gensym25_ = 0;
475 }
476 LA11_: ;
477 {
478 if (!(jX60gensym25_ < bLenX60gensym25_)) goto LA18_;
479 bbX60gensym25_ = toLowerAscii__stdZprivateZstrimpl_1(b->data[jX60gensym25_]);
480 }
481 goto LA16_;
482 LA18_: ;
483 {
484 bbX60gensym25_ = 0;
485 }
486 LA16_: ;
487 result = (NI)(((NU8)(aaX60gensym25_)) - ((NU8)(bbX60gensym25_)));
488 {
489 if (!!((result == ((NI) 0)))) goto LA23_;
490 goto BeforeRet_;
491 }
492 LA23_: ;
493 {
494 if (!(aLenX60gensym25_ <= iX60gensym25_)) goto LA27_;
495 {
496 if (!(bLenX60gensym25_ <= jX60gensym25_)) goto LA31_;
497 result = ((NI) 0);
498 goto BeforeRet_;
499 }
500 LA31_: ;
501 result = ((NI) -1);
502 goto BeforeRet_;
503 }
504 goto LA25_;
505 LA27_: ;
506 {
507 if (!(bLenX60gensym25_ <= jX60gensym25_)) goto LA34_;
508 result = ((NI) 1);
509 goto BeforeRet_;
510 }
511 goto LA25_;
512 LA34_: ;
513 LA25_: ;
514 iX60gensym25_ += ((NI) 1);
515 jX60gensym25_ += ((NI) 1);
516 }
517 }
518 }BeforeRet_: ;
519 return result;
520 }
N_NIMCALL(NIM_BOOL,allCharsInSet__pureZstrutils_1341)521 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, allCharsInSet__pureZstrutils_1341)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw theSet) {
522 NIM_BOOL result;
523 { result = (NIM_BOOL)0;
524 {
525 NIM_CHAR c;
526 NI i;
527 NI L;
528 c = (NIM_CHAR)0;
529 i = ((NI) 0);
530 L = (s ? s->Sup.len : 0);
531 {
532 while (1) {
533 if (!(i < L)) goto LA3;
534 c = s->data[i];
535 {
536 if (!!(((theSet[(NU)(((NU8)(c)))>>3] &(1U<<((NU)(((NU8)(c)))&7U)))!=0))) goto LA6_;
537 result = NIM_FALSE;
538 goto BeforeRet_;
539 }
540 LA6_: ;
541 i += ((NI) 1);
542 } LA3: ;
543 }
544 }
545 result = NIM_TRUE;
546 goto BeforeRet_;
547 }BeforeRet_: ;
548 return result;
549 }
N_INLINE(NI,minuspercent___system_716)550 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y) {
551 NI result;
552 result = (NI)0;
553 result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
554 return result;
555 }
N_INLINE(NCSTRING,nimToCStringConv)556 static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s) {
557 NCSTRING result;
558 result = (NCSTRING)0;
559 {
560 NIM_BOOL T3_;
561 T3_ = (NIM_BOOL)0;
562 T3_ = (s == ((NimStringDesc*) NIM_NIL));
563 if (T3_) goto LA4_;
564 T3_ = ((*s).Sup.len == ((NI) 0));
565 LA4_: ;
566 if (!T3_) goto LA5_;
567 result = "";
568 }
569 goto LA1_;
570 LA5_: ;
571 {
572 result = ((NCSTRING) ((*s).data));
573 }
574 LA1_: ;
575 return result;
576 }
N_NIMCALL(NI,nsuFindChar)577 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last) {
578 NI result;
579 NI last_2;
580 NI L;
581 { result = (NI)0;
582 {
583 if (!(last == ((NI) 0))) goto LA3_;
584 last_2 = ((s ? s->Sup.len : 0)-1);
585 }
586 goto LA1_;
587 LA3_: ;
588 {
589 last_2 = last;
590 }
591 LA1_: ;
592 L = (NI)((NI)(last_2 - ((NI) (start))) + ((NI) 1));
593 {
594 void* found;
595 if (!(((NI) 0) < L)) goto LA8_;
596 found = memchr(((void*) ((&s->data[start]))), sub, ((size_t) (L)));
597 {
598 if (!!((found == 0))) goto LA12_;
599 result = minuspercent___system_716(((NI) (ptrdiff_t) (found)), ((NI) (nimToCStringConv(s))));
600 goto BeforeRet_;
601 }
602 LA12_: ;
603 }
604 LA8_: ;
605 result = ((NI) -1);
606 goto BeforeRet_;
607 }BeforeRet_: ;
608 return result;
609 }
N_INLINE(void,nimCopyMem)610 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
611 void* T1_;
612 T1_ = (void*)0;
613 T1_ = memcpy(dest, source, ((size_t) (size)));
614 }
N_INLINE(void,copyMem__system_1727)615 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
616 nimCopyMem(dest, source, size);
617 }
N_INLINE(void,appendString)618 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
619 {
620 if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
621 copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
622 (*dest).Sup.len += (*src).Sup.len;
623 }
624 LA3_: ;
625 }
N_NIMCALL(void,fill__pureZstrutils_1405)626 N_LIB_PRIVATE N_NIMCALL(void, fill__pureZstrutils_1405)(NI* a, NI aLen_0, NI value) {
627 NI xX60gensym164_;
628 xX60gensym164_ = ((NI) 0);
629 {
630 while (1) {
631 if (!(xX60gensym164_ <= (aLen_0-1))) goto LA2;
632 a[xX60gensym164_] = value;
633 xX60gensym164_ += ((NI) 1);
634 } LA2: ;
635 }
636 }
N_NIMCALL(void,nsuInitSkipTable)637 N_LIB_PRIVATE N_NIMCALL(void, nsuInitSkipTable)(NI* a, NimStringDesc* sub) {
638 NI m;
639 m = (sub ? sub->Sup.len : 0);
640 fill__pureZstrutils_1405(a, 256, m);
641 {
642 NI i;
643 NI colontmp_;
644 NI i_2;
645 i = (NI)0;
646 colontmp_ = (NI)0;
647 colontmp_ = (NI)(m - ((NI) 1));
648 i_2 = ((NI) 0);
649 {
650 while (1) {
651 if (!(i_2 < colontmp_)) goto LA3;
652 i = i_2;
653 a[(((NU8)(sub->data[i])))- 0] = (NI)((NI)(m - ((NI) 1)) - i);
654 i_2 += ((NI) 1);
655 } LA3: ;
656 }
657 }
658 }
N_NIMCALL(NI,nsuFindStrA)659 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStrA)(tyArray__9cc9aPiDa8VaWjVcFLabEDZQ a, NimStringDesc* s, NimStringDesc* sub, NI start, NI last) {
660 NI result;
661 NI last_2;
662 NI subLast;
663 NI skip;
664 { result = (NI)0;
665 {
666 if (!(last == ((NI) 0))) goto LA3_;
667 last_2 = ((s ? s->Sup.len : 0)-1);
668 }
669 goto LA1_;
670 LA3_: ;
671 {
672 last_2 = last;
673 }
674 LA1_: ;
675 subLast = (NI)((sub ? sub->Sup.len : 0) - ((NI) 1));
676 {
677 if (!(subLast == ((NI) -1))) goto LA8_;
678 result = ((NI) (start));
679 goto BeforeRet_;
680 }
681 LA8_: ;
682 skip = start;
683 {
684 while (1) {
685 NI i;
686 if (!(subLast <= (NI)(last_2 - ((NI) (skip))))) goto LA11;
687 i = subLast;
688 {
689 while (1) {
690 if (!((NU8)(s->data[(NI)(((NI) (skip)) + i)]) == (NU8)(sub->data[i]))) goto LA13;
691 {
692 if (!(i == ((NI) 0))) goto LA16_;
693 result = ((NI) (skip));
694 goto BeforeRet_;
695 }
696 LA16_: ;
697 i -= ((NI) 1);
698 } LA13: ;
699 }
700 skip += a[(((NU8)(s->data[(NI)(((NI) (skip)) + subLast)])))- 0];
701 } LA11: ;
702 }
703 result = ((NI) -1);
704 goto BeforeRet_;
705 }BeforeRet_: ;
706 return result;
707 }
N_NIMCALL(NimStringDesc *,nsuReplaceStr)708 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by) {
709 NimStringDesc* result;
710 NI subLen;
711 result = NIM_NIL;
712 result = ((NimStringDesc*) NIM_NIL);
713 subLen = (sub ? sub->Sup.len : 0);
714 {
715 if (!(subLen == ((NI) 0))) goto LA3_;
716 result = copyString(s);
717 }
718 goto LA1_;
719 LA3_: ;
720 {
721 NIM_CHAR c;
722 NI last;
723 NI i;
724 NimStringDesc* T15_;
725 if (!(subLen == ((NI) 1))) goto LA6_;
726 c = sub->data[((NI) 0)];
727 last = ((s ? s->Sup.len : 0)-1);
728 i = ((NI) 0);
729 {
730 while (1) {
731 NI j;
732 NimStringDesc* T14_;
733 j = nsuFindChar(s, c, ((NI) (i)), last);
734 {
735 if (!(j < ((NI) 0))) goto LA12_;
736 goto LA8;
737 }
738 LA12_: ;
739 T14_ = NIM_NIL;
740 T14_ = substr__system_7754(s, i, (NI)(j - ((NI) 1)));
741 result = resizeString(result, (T14_ ? T14_->Sup.len : 0) + 0);
742 appendString(result, T14_);
743 result = resizeString(result, (by ? by->Sup.len : 0) + 0);
744 appendString(result, by);
745 i = (NI)(j + subLen);
746 }
747 } LA8: ;
748 T15_ = NIM_NIL;
749 T15_ = substr__system_7766(s, i);
750 result = resizeString(result, (T15_ ? T15_->Sup.len : 0) + 0);
751 appendString(result, T15_);
752 }
753 goto LA1_;
754 LA6_: ;
755 {
756 tyArray__9cc9aPiDa8VaWjVcFLabEDZQ a;
757 NI last_2;
758 NI i_2;
759 NimStringDesc* T24_;
760 nsuInitSkipTable(a, sub);
761 last_2 = ((s ? s->Sup.len : 0)-1);
762 i_2 = ((NI) 0);
763 {
764 while (1) {
765 NI j_2;
766 NimStringDesc* T23_;
767 j_2 = nsuFindStrA(a, s, sub, ((NI) (i_2)), last_2);
768 {
769 if (!(j_2 < ((NI) 0))) goto LA21_;
770 goto LA17;
771 }
772 LA21_: ;
773 T23_ = NIM_NIL;
774 T23_ = substr__system_7754(s, i_2, (NI)(j_2 - ((NI) 1)));
775 result = resizeString(result, (T23_ ? T23_->Sup.len : 0) + 0);
776 appendString(result, T23_);
777 result = resizeString(result, (by ? by->Sup.len : 0) + 0);
778 appendString(result, by);
779 i_2 = (NI)(j_2 + subLen);
780 }
781 } LA17: ;
782 T24_ = NIM_NIL;
783 T24_ = substr__system_7766(s, i_2);
784 result = resizeString(result, (T24_ ? T24_->Sup.len : 0) + 0);
785 appendString(result, T24_);
786 }
787 LA1_: ;
788 return result;
789 }
N_NIMCALL(NIM_BOOL,nsuEndsWith)790 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuEndsWith)(NimStringDesc* s, NimStringDesc* suffix) {
791 NIM_BOOL result;
792 NI suffixLenX60gensym146_;
793 NI sLenX60gensym146_;
794 NI iX60gensym146_;
795 NI jX60gensym146_;
796 { result = (NIM_BOOL)0;
797 suffixLenX60gensym146_ = (suffix ? suffix->Sup.len : 0);
798 sLenX60gensym146_ = (s ? s->Sup.len : 0);
799 iX60gensym146_ = ((NI) 0);
800 jX60gensym146_ = (NI)(sLenX60gensym146_ - suffixLenX60gensym146_);
801 {
802 while (1) {
803 NIM_BOOL T3_;
804 T3_ = (NIM_BOOL)0;
805 T3_ = (((NI) 0) <= (NI)(iX60gensym146_ + jX60gensym146_));
806 if (!(T3_)) goto LA4_;
807 T3_ = ((NI)(iX60gensym146_ + jX60gensym146_) < sLenX60gensym146_);
808 LA4_: ;
809 if (!T3_) goto LA2;
810 {
811 if (!!(((NU8)(s->data[(NI)(iX60gensym146_ + jX60gensym146_)]) == (NU8)(suffix->data[iX60gensym146_])))) goto LA7_;
812 result = NIM_FALSE;
813 goto BeforeRet_;
814 }
815 LA7_: ;
816 iX60gensym146_ += ((NI) 1);
817 } LA2: ;
818 }
819 {
820 if (!(suffixLenX60gensym146_ <= iX60gensym146_)) goto LA11_;
821 result = NIM_TRUE;
822 goto BeforeRet_;
823 }
824 LA11_: ;
825 }BeforeRet_: ;
826 return result;
827 }
N_NIMCALL(NimStringDesc *,nsuNormalize)828 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s) {
829 NimStringDesc* result;
830 NI j;
831 result = NIM_NIL;
832 result = mnewString(((NI) ((s ? s->Sup.len : 0))));
833 j = ((NI) 0);
834 {
835 NI i;
836 NI colontmp_;
837 NI res;
838 i = (NI)0;
839 colontmp_ = (NI)0;
840 colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
841 res = ((NI) 0);
842 {
843 while (1) {
844 if (!(res <= colontmp_)) goto LA3;
845 i = res;
846 {
847 if (!(((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)))) goto LA6_;
848 result->data[j] = ((NIM_CHAR) (((NI) ((NI)(((NU8)(s->data[i])) + ((NI) 32))))));
849 j += ((NI) 1);
850 }
851 goto LA4_;
852 LA6_: ;
853 {
854 if (!!(((NU8)(s->data[i]) == (NU8)(95)))) goto LA9_;
855 result->data[j] = s->data[i];
856 j += ((NI) 1);
857 }
858 goto LA4_;
859 LA9_: ;
860 LA4_: ;
861 res += ((NI) 1);
862 } LA3: ;
863 }
864 }
865 {
866 if (!!((j == (s ? s->Sup.len : 0)))) goto LA13_;
867 result = setLengthStr(result, ((NI) (j)));
868 }
869 LA13_: ;
870 return result;
871 }
N_INLINE(NIM_BOOL,ltpercent___system_1005)872 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
873 NIM_BOOL result;
874 result = (NIM_BOOL)0;
875 result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
876 return result;
877 }
N_INLINE(void,rtlAddZCT__system_5322)878 static N_INLINE(void, rtlAddZCT__system_5322)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
879 addZCT__system_5273((&gch__system_5226.zct), c);
880 }
N_INLINE(void,decRef__system_5324)881 static N_INLINE(void, decRef__system_5324)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
882 (*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
883 {
884 NIM_BOOL T3_;
885 T3_ = (NIM_BOOL)0;
886 T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
887 if (!T3_) goto LA4_;
888 rtlAddZCT__system_5322(c);
889 }
890 LA4_: ;
891 }
N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g *,usrToCell__system_5279)892 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5279)(void* usr) {
893 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
894 NI T1_;
895 result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
896 T1_ = (NI)0;
897 T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 16));
898 result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
899 return result;
900 }
N_INLINE(void,nimGCunrefNoCycle)901 static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
902 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
903 T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
904 T1_ = usrToCell__system_5279(p);
905 decRef__system_5324(T1_);
906 }
N_INLINE(NI,pluspercent___system_696)907 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
908 NI result;
909 result = (NI)0;
910 result = ((NI) ((NU)((NU64)(((NU) (x))) + (NU64)(((NU) (y))))));
911 return result;
912 }
N_INLINE(void,incRef__system_5317)913 static N_INLINE(void, incRef__system_5317)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
914 (*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
915 }
N_INLINE(void,asgnRef)916 static N_INLINE(void, asgnRef)(void** dest, void* src) {
917 {
918 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
919 if (!!((src == NIM_NIL))) goto LA3_;
920 T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
921 T5_ = usrToCell__system_5279(src);
922 incRef__system_5317(T5_);
923 }
924 LA3_: ;
925 {
926 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
927 if (!!(((*dest) == NIM_NIL))) goto LA8_;
928 T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
929 T10_ = usrToCell__system_5279((*dest));
930 decRef__system_5324(T10_);
931 }
932 LA8_: ;
933 (*dest) = src;
934 }
N_NOINLINE(void,invalidFormatString__pureZstrutils_2142)935 N_LIB_PRIVATE N_NOINLINE(void, invalidFormatString__pureZstrutils_2142)(void) {
936 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T1_;
937 NimStringDesc* T2_;
938 T1_ = NIM_NIL;
939 T1_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
940 (*T1_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
941 (*T1_).Sup.Sup.name = "ValueError";
942 T2_ = NIM_NIL;
943 T2_ = (*T1_).Sup.Sup.message; (*T1_).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_3));
944 if (T2_) nimGCunrefNoCycle(T2_);
945 asgnRef((void**) (&(*T1_).Sup.Sup.parent), ((Exception*) NIM_NIL));
946 raiseExceptionEx((Exception*)T1_, "ValueError", "invalidFormatString", "strutils.nim", 2664);
947 }
N_NIMCALL(NI,findNormalized__pureZstrutils_2130)948 N_LIB_PRIVATE N_NIMCALL(NI, findNormalized__pureZstrutils_2130)(NimStringDesc* x, NimStringDesc** inArray, NI inArrayLen_0) {
949 NI result;
950 NI i;
951 { result = (NI)0;
952 i = ((NI) 0);
953 {
954 while (1) {
955 if (!(i < (inArrayLen_0-1))) goto LA2;
956 {
957 NI T5_;
958 T5_ = (NI)0;
959 T5_ = nsuCmpIgnoreStyle(x, inArray[i]);
960 if (!(T5_ == ((NI) 0))) goto LA6_;
961 result = i;
962 goto BeforeRet_;
963 }
964 LA6_: ;
965 i += ((NI) 2);
966 } LA2: ;
967 }
968 result = ((NI) -1);
969 goto BeforeRet_;
970 }BeforeRet_: ;
971 return result;
972 }
N_NIMCALL(void,nsuAddf)973 N_LIB_PRIVATE N_NIMCALL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
974 NI i;
975 NI num;
976 i = ((NI) 0);
977 num = ((NI) 0);
978 {
979 while (1) {
980 if (!(i < (formatstr ? formatstr->Sup.len : 0))) goto LA2;
981 {
982 NIM_BOOL T5_;
983 T5_ = (NIM_BOOL)0;
984 T5_ = ((NU8)(formatstr->data[i]) == (NU8)(36));
985 if (!(T5_)) goto LA6_;
986 T5_ = ((NI)(i + ((NI) 1)) < (formatstr ? formatstr->Sup.len : 0));
987 LA6_: ;
988 if (!T5_) goto LA7_;
989 switch (((NU8)(formatstr->data[(NI)(i + ((NI) 1))]))) {
990 case 35:
991 {
992 {
993 if (!((aLen_0-1) < num)) goto LA12_;
994 invalidFormatString__pureZstrutils_2142();
995 }
996 LA12_: ;
997 unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[num] ? a[num]->Sup.len : 0) + 0));
998 appendString((*s), a[num]);
999 i += ((NI) 2);
1000 num += ((NI) 1);
1001 }
1002 break;
1003 case 36:
1004 {
1005 unsureAsgnRef((void**) (&(*s)), addChar((*s), 36));
1006 i += ((NI) 2);
1007 }
1008 break;
1009 case 49 ... 57:
1010 case 45:
1011 {
1012 NI j;
1013 NIM_BOOL negative;
1014 NI idx;
1015 j = ((NI) 0);
1016 i += ((NI) 1);
1017 negative = ((NU8)(formatstr->data[i]) == (NU8)(45));
1018 {
1019 if (!negative) goto LA18_;
1020 i += ((NI) 1);
1021 }
1022 LA18_: ;
1023 {
1024 while (1) {
1025 NIM_BOOL T22_;
1026 T22_ = (NIM_BOOL)0;
1027 T22_ = (i < (formatstr ? formatstr->Sup.len : 0));
1028 if (!(T22_)) goto LA23_;
1029 T22_ = (((NU8)(formatstr->data[i])) >= ((NU8)(48)) && ((NU8)(formatstr->data[i])) <= ((NU8)(57)));
1030 LA23_: ;
1031 if (!T22_) goto LA21;
1032 j = (NI)((NI)((NI)(j * ((NI) 10)) + ((NU8)(formatstr->data[i]))) - ((NI) 48));
1033 i += ((NI) 1);
1034 } LA21: ;
1035 }
1036 {
1037 if (!!(negative)) goto LA26_;
1038 idx = (NI)(j - ((NI) 1));
1039 }
1040 goto LA24_;
1041 LA26_: ;
1042 {
1043 idx = (NI)(aLen_0 - j);
1044 }
1045 LA24_: ;
1046 {
1047 NIM_BOOL T31_;
1048 T31_ = (NIM_BOOL)0;
1049 T31_ = (idx < ((NI) 0));
1050 if (T31_) goto LA32_;
1051 T31_ = ((aLen_0-1) < idx);
1052 LA32_: ;
1053 if (!T31_) goto LA33_;
1054 invalidFormatString__pureZstrutils_2142();
1055 }
1056 LA33_: ;
1057 unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[idx] ? a[idx]->Sup.len : 0) + 0));
1058 appendString((*s), a[idx]);
1059 }
1060 break;
1061 case 123:
1062 {
1063 NI j_2;
1064 NI k;
1065 NIM_BOOL negative_2;
1066 NI isNumber;
1067 j_2 = (NI)(i + ((NI) 2));
1068 k = ((NI) 0);
1069 negative_2 = ((NU8)(formatstr->data[j_2]) == (NU8)(45));
1070 {
1071 if (!negative_2) goto LA38_;
1072 j_2 += ((NI) 1);
1073 }
1074 LA38_: ;
1075 isNumber = ((NI) 0);
1076 {
1077 while (1) {
1078 NIM_BOOL T42_;
1079 T42_ = (NIM_BOOL)0;
1080 T42_ = (j_2 < (formatstr ? formatstr->Sup.len : 0));
1081 if (!(T42_)) goto LA43_;
1082 T42_ = !((((NU8)(formatstr->data[j_2])) == ((NU8)(0)) || ((NU8)(formatstr->data[j_2])) == ((NU8)(125))));
1083 LA43_: ;
1084 if (!T42_) goto LA41;
1085 {
1086 if (!(((NU8)(formatstr->data[j_2])) >= ((NU8)(48)) && ((NU8)(formatstr->data[j_2])) <= ((NU8)(57)))) goto LA46_;
1087 k = (NI)((NI)((NI)(k * ((NI) 10)) + ((NU8)(formatstr->data[j_2]))) - ((NI) 48));
1088 {
1089 if (!(isNumber == ((NI) 0))) goto LA50_;
1090 isNumber = ((NI) 1);
1091 }
1092 LA50_: ;
1093 }
1094 goto LA44_;
1095 LA46_: ;
1096 {
1097 isNumber = ((NI) -1);
1098 }
1099 LA44_: ;
1100 j_2 += ((NI) 1);
1101 } LA41: ;
1102 }
1103 {
1104 NI idx_2;
1105 if (!(isNumber == ((NI) 1))) goto LA55_;
1106 {
1107 if (!!(negative_2)) goto LA59_;
1108 idx_2 = (NI)(k - ((NI) 1));
1109 }
1110 goto LA57_;
1111 LA59_: ;
1112 {
1113 idx_2 = (NI)(aLen_0 - k);
1114 }
1115 LA57_: ;
1116 {
1117 NIM_BOOL T64_;
1118 T64_ = (NIM_BOOL)0;
1119 T64_ = (idx_2 < ((NI) 0));
1120 if (T64_) goto LA65_;
1121 T64_ = ((aLen_0-1) < idx_2);
1122 LA65_: ;
1123 if (!T64_) goto LA66_;
1124 invalidFormatString__pureZstrutils_2142();
1125 }
1126 LA66_: ;
1127 unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[idx_2] ? a[idx_2]->Sup.len : 0) + 0));
1128 appendString((*s), a[idx_2]);
1129 }
1130 goto LA53_;
1131 LA55_: ;
1132 {
1133 NI x;
1134 NimStringDesc* T69_;
1135 T69_ = NIM_NIL;
1136 T69_ = substr__system_7754(formatstr, (NI)(i + ((NI) 2)), (NI)(j_2 - ((NI) 1)));
1137 x = findNormalized__pureZstrutils_2130(T69_, a, aLen_0);
1138 {
1139 NIM_BOOL T72_;
1140 T72_ = (NIM_BOOL)0;
1141 T72_ = (((NI) 0) <= x);
1142 if (!(T72_)) goto LA73_;
1143 T72_ = (x < (aLen_0-1));
1144 LA73_: ;
1145 if (!T72_) goto LA74_;
1146 unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[(NI)(x + ((NI) 1))] ? a[(NI)(x + ((NI) 1))]->Sup.len : 0) + 0));
1147 appendString((*s), a[(NI)(x + ((NI) 1))]);
1148 }
1149 goto LA70_;
1150 LA74_: ;
1151 {
1152 invalidFormatString__pureZstrutils_2142();
1153 }
1154 LA70_: ;
1155 }
1156 LA53_: ;
1157 i = (NI)(j_2 + ((NI) 1));
1158 }
1159 break;
1160 case 97 ... 122:
1161 case 65 ... 90:
1162 case 128 ... 255:
1163 case 95:
1164 {
1165 NI j_3;
1166 NI x_2;
1167 NimStringDesc* T82_;
1168 j_3 = (NI)(i + ((NI) 1));
1169 {
1170 while (1) {
1171 NIM_BOOL T80_;
1172 T80_ = (NIM_BOOL)0;
1173 T80_ = (j_3 < (formatstr ? formatstr->Sup.len : 0));
1174 if (!(T80_)) goto LA81_;
1175 T80_ = (((NU8)(formatstr->data[j_3])) >= ((NU8)(97)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(122)) || ((NU8)(formatstr->data[j_3])) >= ((NU8)(65)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(90)) || ((NU8)(formatstr->data[j_3])) >= ((NU8)(48)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(57)) || ((NU8)(formatstr->data[j_3])) >= ((NU8)(128)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(255)) || ((NU8)(formatstr->data[j_3])) == ((NU8)(95)));
1176 LA81_: ;
1177 if (!T80_) goto LA79;
1178 j_3 += ((NI) 1);
1179 } LA79: ;
1180 }
1181 T82_ = NIM_NIL;
1182 T82_ = substr__system_7754(formatstr, (NI)(i + ((NI) 1)), (NI)(j_3 - ((NI) 1)));
1183 x_2 = findNormalized__pureZstrutils_2130(T82_, a, aLen_0);
1184 {
1185 NIM_BOOL T85_;
1186 T85_ = (NIM_BOOL)0;
1187 T85_ = (((NI) 0) <= x_2);
1188 if (!(T85_)) goto LA86_;
1189 T85_ = (x_2 < (aLen_0-1));
1190 LA86_: ;
1191 if (!T85_) goto LA87_;
1192 unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[(NI)(x_2 + ((NI) 1))] ? a[(NI)(x_2 + ((NI) 1))]->Sup.len : 0) + 0));
1193 appendString((*s), a[(NI)(x_2 + ((NI) 1))]);
1194 }
1195 goto LA83_;
1196 LA87_: ;
1197 {
1198 invalidFormatString__pureZstrutils_2142();
1199 }
1200 LA83_: ;
1201 i = j_3;
1202 }
1203 break;
1204 default:
1205 {
1206 invalidFormatString__pureZstrutils_2142();
1207 }
1208 break;
1209 }
1210 }
1211 goto LA3_;
1212 LA7_: ;
1213 {
1214 unsureAsgnRef((void**) (&(*s)), addChar((*s), formatstr->data[i]));
1215 i += ((NI) 1);
1216 }
1217 LA3_: ;
1218 } LA2: ;
1219 }
1220 }
N_NIMCALL(NimStringDesc *,nsuFormatVarargs)1221 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatVarargs)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
1222 NimStringDesc* result;
1223 result = NIM_NIL;
1224 result = rawNewString(((NI) ((NI)((formatstr ? formatstr->Sup.len : 0) + aLen_0))));
1225 nsuAddf((&result), formatstr, a, aLen_0);
1226 return result;
1227 }
N_NIMCALL(NI,nsuCmpIgnoreCase)1228 N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b) {
1229 NI result;
1230 NI aLenX60gensym21_;
1231 NI bLenX60gensym21_;
1232 NI iX60gensym21_;
1233 NI mX60gensym21_;
1234 { result = (NI)0;
1235 aLenX60gensym21_ = (a ? a->Sup.len : 0);
1236 bLenX60gensym21_ = (b ? b->Sup.len : 0);
1237 iX60gensym21_ = ((NI) 0);
1238 mX60gensym21_ = ((aLenX60gensym21_ <= bLenX60gensym21_) ? aLenX60gensym21_ : bLenX60gensym21_);
1239 {
1240 while (1) {
1241 NIM_CHAR T3_;
1242 NIM_CHAR T4_;
1243 if (!(iX60gensym21_ < mX60gensym21_)) goto LA2;
1244 T3_ = (NIM_CHAR)0;
1245 T3_ = toLowerAscii__stdZprivateZstrimpl_1(a->data[iX60gensym21_]);
1246 T4_ = (NIM_CHAR)0;
1247 T4_ = toLowerAscii__stdZprivateZstrimpl_1(b->data[iX60gensym21_]);
1248 result = (NI)(((NU8)(T3_)) - ((NU8)(T4_)));
1249 {
1250 if (!!((result == ((NI) 0)))) goto LA7_;
1251 goto BeforeRet_;
1252 }
1253 LA7_: ;
1254 iX60gensym21_ += ((NI) 1);
1255 } LA2: ;
1256 }
1257 result = (NI)(aLenX60gensym21_ - bLenX60gensym21_);
1258 }BeforeRet_: ;
1259 return result;
1260 }
N_NIMCALL(NIM_BOOL,nsuStartsWith)1261 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuStartsWith)(NimStringDesc* s, NimStringDesc* prefix) {
1262 NIM_BOOL result;
1263 NI prefixLenX60gensym139_;
1264 NI sLenX60gensym139_;
1265 NI iX60gensym139_;
1266 { result = (NIM_BOOL)0;
1267 prefixLenX60gensym139_ = (prefix ? prefix->Sup.len : 0);
1268 sLenX60gensym139_ = (s ? s->Sup.len : 0);
1269 iX60gensym139_ = ((NI) 0);
1270 {
1271 while (1) {
1272 {
1273 if (!(prefixLenX60gensym139_ <= iX60gensym139_)) goto LA5_;
1274 result = NIM_TRUE;
1275 goto BeforeRet_;
1276 }
1277 LA5_: ;
1278 {
1279 NIM_BOOL T9_;
1280 T9_ = (NIM_BOOL)0;
1281 T9_ = (sLenX60gensym139_ <= iX60gensym139_);
1282 if (T9_) goto LA10_;
1283 T9_ = !(((NU8)(s->data[iX60gensym139_]) == (NU8)(prefix->data[iX60gensym139_])));
1284 LA10_: ;
1285 if (!T9_) goto LA11_;
1286 result = NIM_FALSE;
1287 goto BeforeRet_;
1288 }
1289 LA11_: ;
1290 iX60gensym139_ += ((NI) 1);
1291 }
1292 }
1293 }BeforeRet_: ;
1294 return result;
1295 }
N_NIMCALL(NI,nsuFindStr)1296 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last) {
1297 NI result;
1298 { result = (NI)0;
1299 {
1300 if (!((NI)((s ? s->Sup.len : 0) - ((NI) (start))) < (sub ? sub->Sup.len : 0))) goto LA3_;
1301 result = ((NI) -1);
1302 goto BeforeRet_;
1303 }
1304 LA3_: ;
1305 {
1306 if (!((sub ? sub->Sup.len : 0) == ((NI) 1))) goto LA7_;
1307 result = nsuFindChar(s, sub->data[((NI) 0)], start, last);
1308 goto BeforeRet_;
1309 }
1310 LA7_: ;
1311 {
1312 NIM_BOOL T11_;
1313 NCSTRING found;
1314 T11_ = (NIM_BOOL)0;
1315 T11_ = (last == ((NI) 0));
1316 if (!(T11_)) goto LA12_;
1317 T11_ = (((NI) (start)) < (s ? s->Sup.len : 0));
1318 LA12_: ;
1319 if (!T11_) goto LA13_;
1320 found = strstr(((NCSTRING) ((&s->data[start]))), nimToCStringConv(sub));
1321 {
1322 if (!!((found == 0))) goto LA17_;
1323 result = minuspercent___system_716(((NI) (found)), ((NI) (nimToCStringConv(s))));
1324 }
1325 goto LA15_;
1326 LA17_: ;
1327 {
1328 result = ((NI) -1);
1329 }
1330 LA15_: ;
1331 }
1332 goto LA9_;
1333 LA13_: ;
1334 {
1335 tyArray__9cc9aPiDa8VaWjVcFLabEDZQ a;
1336 nsuInitSkipTable(a, sub);
1337 result = nsuFindStrA(a, s, sub, start, last);
1338 }
1339 LA9_: ;
1340 }BeforeRet_: ;
1341 return result;
1342 }
N_NIMCALL(NI,nsuCountString)1343 N_LIB_PRIVATE N_NIMCALL(NI, nsuCountString)(NimStringDesc* s, NimStringDesc* sub, NIM_BOOL overlapping) {
1344 NI result;
1345 NI i;
1346 result = (NI)0;
1347 {
1348 if (!!((((NI) 0) < (sub ? sub->Sup.len : 0)))) goto LA3_;
1349 failedAssertImpl__systemZassertions_56(((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_4));
1350 }
1351 LA3_: ;
1352 result = ((NI) 0);
1353 i = ((NI) 0);
1354 {
1355 while (1) {
1356 i = nsuFindStr(s, sub, ((NI) (i)), ((NI) 0));
1357 {
1358 if (!(i < ((NI) 0))) goto LA9_;
1359 goto LA5;
1360 }
1361 LA9_: ;
1362 {
1363 if (!overlapping) goto LA13_;
1364 i += ((NI) 1);
1365 }
1366 goto LA11_;
1367 LA13_: ;
1368 {
1369 i += (sub ? sub->Sup.len : 0);
1370 }
1371 LA11_: ;
1372 result += ((NI) 1);
1373 }
1374 } LA5: ;
1375 return result;
1376 }
N_NIMCALL(NimStringDesc *,nsuRepeatChar)1377 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count) {
1378 NimStringDesc* result;
1379 result = NIM_NIL;
1380 result = mnewString(count);
1381 {
1382 NI i;
1383 NI colontmp_;
1384 NI res;
1385 i = (NI)0;
1386 colontmp_ = (NI)0;
1387 colontmp_ = (NI)(((NI) (count)) - ((NI) 1));
1388 res = ((NI) 0);
1389 {
1390 while (1) {
1391 if (!(res <= colontmp_)) goto LA3;
1392 i = res;
1393 result->data[i] = c;
1394 res += ((NI) 1);
1395 } LA3: ;
1396 }
1397 }
1398 return result;
1399 }
N_NIMCALL(NimStringDesc *,nsuFormatOpenArray)1400 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
1401 NimStringDesc* result;
1402 result = NIM_NIL;
1403 result = rawNewString(((NI) ((NI)((formatstr ? formatstr->Sup.len : 0) + (NI)((NU64)(aLen_0) << (NU64)(((NI) 4)))))));
1404 nsuAddf((&result), formatstr, a, aLen_0);
1405 return result;
1406 }
N_INLINE(void,nimSetMem__systemZmemory_7)1407 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
1408 void* T1_;
1409 T1_ = (void*)0;
1410 T1_ = memset(a, v, ((size_t) (size)));
1411 }
N_INLINE(void,nimZeroMem)1412 static N_INLINE(void, nimZeroMem)(void* p, NI size) {
1413 nimSetMem__systemZmemory_7(p, ((int) 0), size);
1414 }
N_NIMCALL(NimStringDesc *,nsuFormatSingleElem)1415 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a) {
1416 NimStringDesc* result;
1417 tyArray__nHXaesL0DJZHyVS07ARPRA T1_;
1418 result = NIM_NIL;
1419 result = rawNewString(((NI) ((NI)((formatstr ? formatstr->Sup.len : 0) + (a ? a->Sup.len : 0)))));
1420 nimZeroMem((void*)T1_, sizeof(tyArray__nHXaesL0DJZHyVS07ARPRA));
1421 T1_[0] = copyString(a);
1422 nsuAddf((&result), formatstr, T1_, 1);
1423 return result;
1424 }
N_NIMCALL(NIM_CHAR,nsuToLowerAsciiChar)1425 N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c) {
1426 NIM_CHAR result;
1427 result = (NIM_CHAR)0;
1428 {
1429 if (!(((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)))) goto LA3_;
1430 result = ((NIM_CHAR) ((NU8)(((NU8) (((NU8)(c)))) ^ ((NU8) 32))));
1431 }
1432 goto LA1_;
1433 LA3_: ;
1434 {
1435 result = c;
1436 }
1437 LA1_: ;
1438 return result;
1439 }
N_NIMCALL(NimStringDesc *,nsuToLowerAsciiStr)1440 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToLowerAsciiStr)(NimStringDesc* s) {
1441 NimStringDesc* result;
1442 result = NIM_NIL;
1443 result = mnewString(((NI) ((s ? s->Sup.len : 0))));
1444 {
1445 NI iX60gensym7_;
1446 NI colontmp_;
1447 NI res;
1448 iX60gensym7_ = (NI)0;
1449 colontmp_ = (NI)0;
1450 colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
1451 res = ((NI) 0);
1452 {
1453 while (1) {
1454 if (!(res <= colontmp_)) goto LA3;
1455 iX60gensym7_ = res;
1456 result->data[iX60gensym7_] = nsuToLowerAsciiChar(s->data[iX60gensym7_]);
1457 res += ((NI) 1);
1458 } LA3: ;
1459 }
1460 }
1461 return result;
1462 }
N_NIMCALL(NIM_BOOL,contains__pureZstrutils_1631)1463 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains__pureZstrutils_1631)(NimStringDesc* s, NimStringDesc* sub) {
1464 NIM_BOOL result;
1465 NI T1_;
1466 { result = (NIM_BOOL)0;
1467 T1_ = (NI)0;
1468 T1_ = nsuFindStr(s, sub, ((NI) 0), ((NI) 0));
1469 result = (((NI) 0) <= T1_);
1470 goto BeforeRet_;
1471 }BeforeRet_: ;
1472 return result;
1473 }
N_NIMCALL(NI,parseHex__pureZstrutils_895)1474 N_LIB_PRIVATE N_NIMCALL(NI, parseHex__pureZstrutils_895)(NimStringDesc* s, NI* number, NI start, NI maxLen) {
1475 NI result;
1476 NI i;
1477 NI output;
1478 NIM_BOOL foundDigit;
1479 NI last;
1480 NI T1_;
1481 result = (NI)0;
1482 i = start;
1483 output = ((NI) 0);
1484 foundDigit = NIM_FALSE;
1485 T1_ = (NI)0;
1486 {
1487 if (!(maxLen == ((NI) 0))) goto LA4_;
1488 T1_ = (s ? s->Sup.len : 0);
1489 }
1490 goto LA2_;
1491 LA4_: ;
1492 {
1493 T1_ = (NI)(i + maxLen);
1494 }
1495 LA2_: ;
1496 last = (((s ? s->Sup.len : 0) <= T1_) ? (s ? s->Sup.len : 0) : T1_);
1497 {
1498 NIM_BOOL T9_;
1499 NIM_BOOL T10_;
1500 T9_ = (NIM_BOOL)0;
1501 T10_ = (NIM_BOOL)0;
1502 T10_ = ((NI)(i + ((NI) 1)) < last);
1503 if (!(T10_)) goto LA11_;
1504 T10_ = ((NU8)(s->data[i]) == (NU8)(48));
1505 LA11_: ;
1506 T9_ = T10_;
1507 if (!(T9_)) goto LA12_;
1508 T9_ = (((NU8)(s->data[(NI)(i + ((NI) 1))])) == ((NU8)(120)) || ((NU8)(s->data[(NI)(i + ((NI) 1))])) == ((NU8)(88)));
1509 LA12_: ;
1510 if (!T9_) goto LA13_;
1511 i += ((NI) 2);
1512 }
1513 goto LA7_;
1514 LA13_: ;
1515 {
1516 NIM_BOOL T16_;
1517 T16_ = (NIM_BOOL)0;
1518 T16_ = (i < last);
1519 if (!(T16_)) goto LA17_;
1520 T16_ = ((NU8)(s->data[i]) == (NU8)(35));
1521 LA17_: ;
1522 if (!T16_) goto LA18_;
1523 i += ((NI) 1);
1524 }
1525 goto LA7_;
1526 LA18_: ;
1527 LA7_: ;
1528 {
1529 while (1) {
1530 if (!(i < last)) goto LA21;
1531 switch (((NU8)(s->data[i]))) {
1532 case 95:
1533 {
1534 }
1535 break;
1536 case 48 ... 57:
1537 {
1538 output = (NI)((NI)((NU64)(output) << (NU64)(((NI) 4))) | (NI)(((NU8)(s->data[i])) - ((NI) 48)));
1539 foundDigit = NIM_TRUE;
1540 }
1541 break;
1542 case 97 ... 102:
1543 {
1544 output = (NI)((NI)((NU64)(output) << (NU64)(((NI) 4))) | (NI)((NI)(((NU8)(s->data[i])) - ((NI) 97)) + ((NI) 10)));
1545 foundDigit = NIM_TRUE;
1546 }
1547 break;
1548 case 65 ... 70:
1549 {
1550 output = (NI)((NI)((NU64)(output) << (NU64)(((NI) 4))) | (NI)((NI)(((NU8)(s->data[i])) - ((NI) 65)) + ((NI) 10)));
1551 foundDigit = NIM_TRUE;
1552 }
1553 break;
1554 default:
1555 {
1556 goto LA20;
1557 }
1558 break;
1559 }
1560 i += ((NI) 1);
1561 } LA21: ;
1562 } LA20: ;
1563 {
1564 if (!foundDigit) goto LA29_;
1565 (*number) = output;
1566 result = (NI)(i - start);
1567 }
1568 LA29_: ;
1569 return result;
1570 }
N_INLINE(void,appendChar)1571 static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
1572 (*dest).data[(*dest).Sup.len] = c;
1573 (*dest).data[(NI)((*dest).Sup.len + ((NI) 1))] = 0;
1574 (*dest).Sup.len += ((NI) 1);
1575 }
N_NIMCALL(NimStringDesc *,nsuUnescape)1576 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuUnescape)(NimStringDesc* s, NimStringDesc* prefix, NimStringDesc* suffix) {
1577 NimStringDesc* result;
1578 NI i;
1579 result = NIM_NIL;
1580 result = rawNewString(((NI) ((s ? s->Sup.len : 0))));
1581 i = (prefix ? prefix->Sup.len : 0);
1582 {
1583 NIM_BOOL T3_;
1584 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T6_;
1585 NimStringDesc* T7_;
1586 T3_ = (NIM_BOOL)0;
1587 T3_ = nsuStartsWith(s, prefix);
1588 if (!!(T3_)) goto LA4_;
1589 T6_ = NIM_NIL;
1590 T6_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
1591 (*T6_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
1592 (*T6_).Sup.Sup.name = "ValueError";
1593 T7_ = NIM_NIL;
1594 T7_ = rawNewString((prefix ? prefix->Sup.len : 0) + 28);
1595 appendString(T7_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_5));
1596 appendString(T7_, prefix);
1597 asgnRef((void**) (&(*T6_).Sup.Sup.message), T7_);
1598 asgnRef((void**) (&(*T6_).Sup.Sup.parent), ((Exception*) NIM_NIL));
1599 raiseExceptionEx((Exception*)T6_, "ValueError", "unescape", "strutils.nim", 2284);
1600 }
1601 LA4_: ;
1602 {
1603 while (1) {
1604 {
1605 if (!((NI)((s ? s->Sup.len : 0) - (suffix ? suffix->Sup.len : 0)) <= i)) goto LA12_;
1606 goto LA8;
1607 }
1608 LA12_: ;
1609 {
1610 if (!((NU8)(s->data[i]) == (NU8)(92))) goto LA16_;
1611 {
1612 if (!((s ? s->Sup.len : 0) <= (NI)(i + ((NI) 1)))) goto LA20_;
1613 result = addChar(result, 92);
1614 goto LA8;
1615 }
1616 LA20_: ;
1617 switch (((NU8)(s->data[(NI)(i + ((NI) 1))]))) {
1618 case 120:
1619 {
1620 NI c;
1621 NI T23_;
1622 i += ((NI) 2);
1623 c = ((NI) 0);
1624 T23_ = (NI)0;
1625 T23_ = parseHex__pureZstrutils_895(s, (&c), i, ((NI) 2));
1626 i += T23_;
1627 result = addChar(result, ((NIM_CHAR) (((NI) (c)))));
1628 i -= ((NI) 2);
1629 }
1630 break;
1631 case 92:
1632 {
1633 result = addChar(result, 92);
1634 }
1635 break;
1636 case 39:
1637 {
1638 result = addChar(result, 39);
1639 }
1640 break;
1641 case 34:
1642 {
1643 result = addChar(result, 34);
1644 }
1645 break;
1646 default:
1647 {
1648 NimStringDesc* T28_;
1649 T28_ = NIM_NIL;
1650 T28_ = rawNewString(2);
1651 appendString(T28_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_6));
1652 appendChar(T28_, s->data[(NI)(i + ((NI) 1))]);
1653 result = resizeString(result, (T28_ ? T28_->Sup.len : 0) + 0);
1654 appendString(result, T28_);
1655 }
1656 break;
1657 }
1658 i += ((NI) 2);
1659 }
1660 goto LA14_;
1661 LA16_: ;
1662 {
1663 result = addChar(result, s->data[i]);
1664 i += ((NI) 1);
1665 }
1666 LA14_: ;
1667 }
1668 } LA8: ;
1669 {
1670 NIM_BOOL T32_;
1671 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T35_;
1672 NimStringDesc* T36_;
1673 T32_ = (NIM_BOOL)0;
1674 T32_ = nsuEndsWith(s, suffix);
1675 if (!!(T32_)) goto LA33_;
1676 T35_ = NIM_NIL;
1677 T35_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
1678 (*T35_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
1679 (*T35_).Sup.Sup.name = "ValueError";
1680 T36_ = NIM_NIL;
1681 T36_ = rawNewString((suffix ? suffix->Sup.len : 0) + 24);
1682 appendString(T36_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_7));
1683 appendString(T36_, suffix);
1684 asgnRef((void**) (&(*T35_).Sup.Sup.message), T36_);
1685 asgnRef((void**) (&(*T35_).Sup.Sup.parent), ((Exception*) NIM_NIL));
1686 raiseExceptionEx((Exception*)T35_, "ValueError", "unescape", "strutils.nim", 2312);
1687 }
1688 LA33_: ;
1689 return result;
1690 }
N_NIMCALL(NI,nsuRFindChar)1691 N_LIB_PRIVATE N_NIMCALL(NI, nsuRFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last) {
1692 NI result;
1693 NI last_2;
1694 { result = (NI)0;
1695 {
1696 if (!(last == ((NI) -1))) goto LA3_;
1697 last_2 = ((s ? s->Sup.len : 0)-1);
1698 }
1699 goto LA1_;
1700 LA3_: ;
1701 {
1702 last_2 = last;
1703 }
1704 LA1_: ;
1705 {
1706 NI i;
1707 NI colontmp_;
1708 NI res;
1709 i = (NI)0;
1710 colontmp_ = (NI)0;
1711 colontmp_ = ((NI) (start));
1712 res = last_2;
1713 {
1714 while (1) {
1715 if (!(colontmp_ <= res)) goto LA8;
1716 i = res;
1717 {
1718 if (!((NU8)(sub) == (NU8)(s->data[i]))) goto LA11_;
1719 result = i;
1720 goto BeforeRet_;
1721 }
1722 LA11_: ;
1723 res -= ((NI) 1);
1724 } LA8: ;
1725 }
1726 }
1727 result = ((NI) -1);
1728 goto BeforeRet_;
1729 }BeforeRet_: ;
1730 return result;
1731 }
N_NIMCALL(NI,nsuRFindStr)1732 N_LIB_PRIVATE N_NIMCALL(NI, nsuRFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last) {
1733 NI result;
1734 NI last_2;
1735 { result = (NI)0;
1736 {
1737 if (!((sub ? sub->Sup.len : 0) == ((NI) 0))) goto LA3_;
1738 result = ((NI) -1);
1739 goto BeforeRet_;
1740 }
1741 LA3_: ;
1742 {
1743 if (!((NI)((s ? s->Sup.len : 0) - ((NI) (start))) < (sub ? sub->Sup.len : 0))) goto LA7_;
1744 result = ((NI) -1);
1745 goto BeforeRet_;
1746 }
1747 LA7_: ;
1748 {
1749 if (!(last == ((NI) -1))) goto LA11_;
1750 last_2 = ((s ? s->Sup.len : 0)-1);
1751 }
1752 goto LA9_;
1753 LA11_: ;
1754 {
1755 last_2 = last;
1756 }
1757 LA9_: ;
1758 result = ((NI) 0);
1759 {
1760 NI i;
1761 NI colontmp_;
1762 NI colontmp__2;
1763 NI res;
1764 i = (NI)0;
1765 colontmp_ = (NI)0;
1766 colontmp__2 = (NI)0;
1767 colontmp_ = (NI)((NI)(last_2 - (sub ? sub->Sup.len : 0)) + ((NI) 1));
1768 colontmp__2 = ((NI) (start));
1769 res = colontmp_;
1770 {
1771 while (1) {
1772 if (!(colontmp__2 <= res)) goto LA16;
1773 i = res;
1774 {
1775 NI j;
1776 NI colontmp__3;
1777 NI res_2;
1778 j = (NI)0;
1779 colontmp__3 = (NI)0;
1780 colontmp__3 = (NI)((sub ? sub->Sup.len : 0) - ((NI) 1));
1781 res_2 = ((NI) 0);
1782 {
1783 while (1) {
1784 if (!(res_2 <= colontmp__3)) goto LA19;
1785 j = res_2;
1786 result = i;
1787 {
1788 if (!!(((NU8)(sub->data[j]) == (NU8)(s->data[(NI)(i + j)])))) goto LA22_;
1789 result = ((NI) -1);
1790 goto LA17;
1791 }
1792 LA22_: ;
1793 res_2 += ((NI) 1);
1794 } LA19: ;
1795 }
1796 } LA17: ;
1797 {
1798 if (!!((result == ((NI) -1)))) goto LA26_;
1799 goto BeforeRet_;
1800 }
1801 LA26_: ;
1802 res -= ((NI) 1);
1803 } LA16: ;
1804 }
1805 }
1806 result = ((NI) -1);
1807 goto BeforeRet_;
1808 }BeforeRet_: ;
1809 return result;
1810 }
N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ *,nsuSplitChar)1811 N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitChar)(NimStringDesc* s, NIM_CHAR sep, NI maxsplit) {
1812 tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
1813 result = NIM_NIL;
1814 result = NIM_NIL;
1815 {
1816 NimStringDesc* xX60gensym67_;
1817 NI lastX60gensym34_;
1818 NI splitsX60gensym34_;
1819 xX60gensym67_ = NIM_NIL;
1820 lastX60gensym34_ = ((NI) 0);
1821 splitsX60gensym34_ = maxsplit;
1822 {
1823 while (1) {
1824 NI firstX60gensym34_;
1825 NI T12_;
1826 NimStringDesc* T13_;
1827 if (!(lastX60gensym34_ <= (s ? s->Sup.len : 0))) goto LA3;
1828 firstX60gensym34_ = lastX60gensym34_;
1829 {
1830 while (1) {
1831 NIM_BOOL T6_;
1832 T6_ = (NIM_BOOL)0;
1833 T6_ = (lastX60gensym34_ < (s ? s->Sup.len : 0));
1834 if (!(T6_)) goto LA7_;
1835 T6_ = !(((NU8)(s->data[lastX60gensym34_]) == (NU8)(sep)));
1836 LA7_: ;
1837 if (!T6_) goto LA5;
1838 lastX60gensym34_ += ((NI) 1);
1839 } LA5: ;
1840 }
1841 {
1842 if (!(splitsX60gensym34_ == ((NI) 0))) goto LA10_;
1843 lastX60gensym34_ = (s ? s->Sup.len : 0);
1844 }
1845 LA10_: ;
1846 xX60gensym67_ = substr__system_7754(s, firstX60gensym34_, (NI)(lastX60gensym34_ - ((NI) 1)));
1847 result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
1848 T12_ = result->Sup.len++;
1849 T13_ = NIM_NIL;
1850 T13_ = result->data[T12_]; result->data[T12_] = copyStringRC1(xX60gensym67_);
1851 if (T13_) nimGCunrefNoCycle(T13_);
1852 {
1853 if (!(splitsX60gensym34_ == ((NI) 0))) goto LA16_;
1854 goto LA2;
1855 }
1856 LA16_: ;
1857 splitsX60gensym34_ -= ((NI) 1);
1858 lastX60gensym34_ += ((NI) 1);
1859 } LA3: ;
1860 } LA2: ;
1861 }
1862 return result;
1863 }
N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ *,nsuSplitLines)1864 N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitLines)(NimStringDesc* s, NIM_BOOL keepEol) {
1865 tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
1866 result = NIM_NIL;
1867 result = NIM_NIL;
1868 {
1869 NimStringDesc* xX60gensym76_;
1870 NI first;
1871 NI last;
1872 NI eolpos;
1873 xX60gensym76_ = NIM_NIL;
1874 first = ((NI) 0);
1875 last = ((NI) 0);
1876 eolpos = ((NI) 0);
1877 {
1878 while (1) {
1879 NI T25_;
1880 NI T31_;
1881 NimStringDesc* T32_;
1882 {
1883 while (1) {
1884 NIM_BOOL T6_;
1885 T6_ = (NIM_BOOL)0;
1886 T6_ = (last < (s ? s->Sup.len : 0));
1887 if (!(T6_)) goto LA7_;
1888 T6_ = !((((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10))));
1889 LA7_: ;
1890 if (!T6_) goto LA5;
1891 last += ((NI) 1);
1892 } LA5: ;
1893 }
1894 eolpos = last;
1895 {
1896 if (!(last < (s ? s->Sup.len : 0))) goto LA10_;
1897 {
1898 if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA14_;
1899 last += ((NI) 1);
1900 }
1901 goto LA12_;
1902 LA14_: ;
1903 {
1904 if (!((NU8)(s->data[last]) == (NU8)(13))) goto LA17_;
1905 last += ((NI) 1);
1906 {
1907 NIM_BOOL T21_;
1908 T21_ = (NIM_BOOL)0;
1909 T21_ = (last < (s ? s->Sup.len : 0));
1910 if (!(T21_)) goto LA22_;
1911 T21_ = ((NU8)(s->data[last]) == (NU8)(10));
1912 LA22_: ;
1913 if (!T21_) goto LA23_;
1914 last += ((NI) 1);
1915 }
1916 LA23_: ;
1917 }
1918 goto LA12_;
1919 LA17_: ;
1920 LA12_: ;
1921 }
1922 LA10_: ;
1923 T25_ = (NI)0;
1924 {
1925 if (!keepEol) goto LA28_;
1926 T25_ = (NI)(last - ((NI) 1));
1927 }
1928 goto LA26_;
1929 LA28_: ;
1930 {
1931 T25_ = (NI)(eolpos - ((NI) 1));
1932 }
1933 LA26_: ;
1934 xX60gensym76_ = substr__system_7754(s, first, T25_);
1935 result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
1936 T31_ = result->Sup.len++;
1937 T32_ = NIM_NIL;
1938 T32_ = result->data[T31_]; result->data[T31_] = copyStringRC1(xX60gensym76_);
1939 if (T32_) nimGCunrefNoCycle(T32_);
1940 {
1941 if (!(eolpos == last)) goto LA35_;
1942 goto LA2;
1943 }
1944 LA35_: ;
1945 first = last;
1946 }
1947 } LA2: ;
1948 }
1949 return result;
1950 }
N_NIMCALL(NimStringDesc *,nsuReplaceChar)1951 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuReplaceChar)(NimStringDesc* s, NIM_CHAR sub, NIM_CHAR by) {
1952 NimStringDesc* result;
1953 NI i;
1954 result = NIM_NIL;
1955 result = mnewString(((NI) ((s ? s->Sup.len : 0))));
1956 i = ((NI) 0);
1957 {
1958 while (1) {
1959 if (!(i < (s ? s->Sup.len : 0))) goto LA2;
1960 {
1961 if (!((NU8)(s->data[i]) == (NU8)(sub))) goto LA5_;
1962 result->data[i] = by;
1963 }
1964 goto LA3_;
1965 LA5_: ;
1966 {
1967 result->data[i] = s->data[i];
1968 }
1969 LA3_: ;
1970 i += ((NI) 1);
1971 } LA2: ;
1972 }
1973 return result;
1974 }
N_NIMCALL(NimStringDesc *,nimIdentNormalize__pureZstrutils_105)1975 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nimIdentNormalize__pureZstrutils_105)(NimStringDesc* s) {
1976 NimStringDesc* result;
1977 NI j;
1978 result = NIM_NIL;
1979 result = mnewString(((NI) ((s ? s->Sup.len : 0))));
1980 {
1981 if (!(((NI) 0) < (s ? s->Sup.len : 0))) goto LA3_;
1982 result->data[((NI) 0)] = s->data[((NI) 0)];
1983 }
1984 LA3_: ;
1985 j = ((NI) 1);
1986 {
1987 NI i;
1988 NI colontmp_;
1989 NI res;
1990 i = (NI)0;
1991 colontmp_ = (NI)0;
1992 colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
1993 res = ((NI) 1);
1994 {
1995 while (1) {
1996 if (!(res <= colontmp_)) goto LA7;
1997 i = res;
1998 {
1999 if (!(((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)))) goto LA10_;
2000 result->data[j] = ((NIM_CHAR) (((NI) ((NI)(((NU8)(s->data[i])) + ((NI) 32))))));
2001 j += ((NI) 1);
2002 }
2003 goto LA8_;
2004 LA10_: ;
2005 {
2006 if (!!(((NU8)(s->data[i]) == (NU8)(95)))) goto LA13_;
2007 result->data[j] = s->data[i];
2008 j += ((NI) 1);
2009 }
2010 goto LA8_;
2011 LA13_: ;
2012 LA8_: ;
2013 res += ((NI) 1);
2014 } LA7: ;
2015 }
2016 }
2017 {
2018 if (!!((j == (s ? s->Sup.len : 0)))) goto LA17_;
2019 result = setLengthStr(result, ((NI) (j)));
2020 }
2021 LA17_: ;
2022 return result;
2023 }
N_NIMCALL(NI,nsuFindCharSet)2024 N_LIB_PRIVATE N_NIMCALL(NI, nsuFindCharSet)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars, NI start, NI last) {
2025 NI result;
2026 NI last_2;
2027 { result = (NI)0;
2028 {
2029 if (!(last == ((NI) 0))) goto LA3_;
2030 last_2 = ((s ? s->Sup.len : 0)-1);
2031 }
2032 goto LA1_;
2033 LA3_: ;
2034 {
2035 last_2 = last;
2036 }
2037 LA1_: ;
2038 {
2039 NI i;
2040 NI colontmp_;
2041 NI res;
2042 i = (NI)0;
2043 colontmp_ = (NI)0;
2044 colontmp_ = ((NI) (start));
2045 res = colontmp_;
2046 {
2047 while (1) {
2048 if (!(res <= last_2)) goto LA8;
2049 i = res;
2050 {
2051 if (!((chars[(NU)(((NU8)(s->data[i])))>>3] &(1U<<((NU)(((NU8)(s->data[i])))&7U)))!=0)) goto LA11_;
2052 result = i;
2053 goto BeforeRet_;
2054 }
2055 LA11_: ;
2056 res += ((NI) 1);
2057 } LA8: ;
2058 }
2059 }
2060 result = ((NI) -1);
2061 goto BeforeRet_;
2062 }BeforeRet_: ;
2063 return result;
2064 }
N_NIMCALL(NIM_BOOL,contains__pureZstrutils_1635)2065 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains__pureZstrutils_1635)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars) {
2066 NIM_BOOL result;
2067 NI T1_;
2068 { result = (NIM_BOOL)0;
2069 T1_ = (NI)0;
2070 T1_ = nsuFindCharSet(s, chars, ((NI) 0), ((NI) 0));
2071 result = (((NI) 0) <= T1_);
2072 goto BeforeRet_;
2073 }BeforeRet_: ;
2074 return result;
2075 }
N_NIMCALL(NIM_BOOL,nsuContinuesWith)2076 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuContinuesWith)(NimStringDesc* s, NimStringDesc* substr, NI start) {
2077 NIM_BOOL result;
2078 NI i;
2079 { result = (NIM_BOOL)0;
2080 i = ((NI) 0);
2081 {
2082 while (1) {
2083 {
2084 if (!((substr ? substr->Sup.len : 0) <= i)) goto LA5_;
2085 result = NIM_TRUE;
2086 goto BeforeRet_;
2087 }
2088 LA5_: ;
2089 {
2090 NIM_BOOL T9_;
2091 T9_ = (NIM_BOOL)0;
2092 T9_ = ((s ? s->Sup.len : 0) <= (NI)(i + ((NI) (start))));
2093 if (T9_) goto LA10_;
2094 T9_ = !(((NU8)(s->data[(NI)(i + ((NI) (start)))]) == (NU8)(substr->data[i])));
2095 LA10_: ;
2096 if (!T9_) goto LA11_;
2097 result = NIM_FALSE;
2098 goto BeforeRet_;
2099 }
2100 LA11_: ;
2101 i += ((NI) 1);
2102 }
2103 }
2104 }BeforeRet_: ;
2105 return result;
2106 }
N_NIMCALL(NimStringDesc *,multiReplace__pureZstrutils_1682)2107 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, multiReplace__pureZstrutils_1682)(NimStringDesc* s, tyTuple__UV3llMMYFckfui8YMBuUZA* replacements, NI replacementsLen_0) {
2108 NimStringDesc* result;
2109 NI i;
2110 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw fastChk;
2111 result = NIM_NIL;
2112 result = rawNewString(((NI) ((s ? s->Sup.len : 0))));
2113 i = ((NI) 0);
2114 nimZeroMem((void*)fastChk, sizeof(tySet_tyChar__nmiMWKVIe46vacnhAFrQvw));
2115 nimCopyMem((void*)fastChk, (NIM_CONST void*)TM__JGc9b9bh2D3nTdUR7TGyq8aA_8, 32);
2116 {
2117 NimStringDesc** sub;
2118 NimStringDesc** by;
2119 NI i_2;
2120 sub = (NimStringDesc**)0;
2121 by = (NimStringDesc**)0;
2122 i_2 = ((NI) 0);
2123 {
2124 while (1) {
2125 if (!(i_2 < replacementsLen_0)) goto LA3;
2126 sub = (&replacements[i_2].Field0);
2127 by = (&replacements[i_2].Field1);
2128 {
2129 if (!(((NI) 0) < ((*sub) ? (*sub)->Sup.len : 0))) goto LA6_;
2130 fastChk[(NU)(((NU8)((*sub)->data[((NI) 0)])))>>3] |=(1U<<(((NU8)((*sub)->data[((NI) 0)]))&7U));
2131 }
2132 LA6_: ;
2133 i_2 += ((NI) 1);
2134 } LA3: ;
2135 }
2136 }
2137 {
2138 while (1) {
2139 if (!(i < (s ? s->Sup.len : 0))) goto LA9;
2140 {
2141 {
2142 if (!((fastChk[(NU)(((NU8)(s->data[i])))>>3] &(1U<<((NU)(((NU8)(s->data[i])))&7U)))!=0)) goto LA13_;
2143 {
2144 NimStringDesc** sub_2;
2145 NimStringDesc** by_2;
2146 NI i_3;
2147 sub_2 = (NimStringDesc**)0;
2148 by_2 = (NimStringDesc**)0;
2149 i_3 = ((NI) 0);
2150 {
2151 while (1) {
2152 if (!(i_3 < replacementsLen_0)) goto LA17;
2153 sub_2 = (&replacements[i_3].Field0);
2154 by_2 = (&replacements[i_3].Field1);
2155 {
2156 NIM_BOOL T20_;
2157 T20_ = (NIM_BOOL)0;
2158 T20_ = (((NI) 0) < ((*sub_2) ? (*sub_2)->Sup.len : 0));
2159 if (!(T20_)) goto LA21_;
2160 T20_ = nsuContinuesWith(s, (*sub_2), ((NI) (i)));
2161 LA21_: ;
2162 if (!T20_) goto LA22_;
2163 result = resizeString(result, ((*by_2) ? (*by_2)->Sup.len : 0) + 0);
2164 appendString(result, (*by_2));
2165 i += ((*sub_2) ? (*sub_2)->Sup.len : 0);
2166 goto LA10;
2167 }
2168 LA22_: ;
2169 i_3 += ((NI) 1);
2170 } LA17: ;
2171 }
2172 }
2173 }
2174 LA13_: ;
2175 result = addChar(result, s->data[i]);
2176 i += ((NI) 1);
2177 } LA10: ;
2178 } LA9: ;
2179 }
2180 return result;
2181 }
N_NIMCALL(NimStringDesc *,nsuJoinSep)2182 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen_0, NimStringDesc* sep) {
2183 NimStringDesc* result;
2184 result = NIM_NIL;
2185 {
2186 NI L;
2187 if (!(((NI) 0) < aLen_0)) goto LA3_;
2188 L = (NI)((sep ? sep->Sup.len : 0) * (NI)(aLen_0 - ((NI) 1)));
2189 {
2190 NI i;
2191 NI colontmp_;
2192 NI res;
2193 i = (NI)0;
2194 colontmp_ = (NI)0;
2195 colontmp_ = (aLen_0-1);
2196 res = ((NI) 0);
2197 {
2198 while (1) {
2199 if (!(res <= colontmp_)) goto LA7;
2200 i = res;
2201 L += (a[i] ? a[i]->Sup.len : 0);
2202 res += ((NI) 1);
2203 } LA7: ;
2204 }
2205 }
2206 result = rawNewString(((NI) (L)));
2207 result = resizeString(result, (a[((NI) 0)] ? a[((NI) 0)]->Sup.len : 0) + 0);
2208 appendString(result, a[((NI) 0)]);
2209 {
2210 NI i_2;
2211 NI colontmp__2;
2212 NI res_2;
2213 i_2 = (NI)0;
2214 colontmp__2 = (NI)0;
2215 colontmp__2 = (aLen_0-1);
2216 res_2 = ((NI) 1);
2217 {
2218 while (1) {
2219 if (!(res_2 <= colontmp__2)) goto LA10;
2220 i_2 = res_2;
2221 result = resizeString(result, (sep ? sep->Sup.len : 0) + 0);
2222 appendString(result, sep);
2223 result = resizeString(result, (a[i_2] ? a[i_2]->Sup.len : 0) + 0);
2224 appendString(result, a[i_2]);
2225 res_2 += ((NI) 1);
2226 } LA10: ;
2227 }
2228 }
2229 }
2230 goto LA1_;
2231 LA3_: ;
2232 {
2233 result = ((NimStringDesc*) NIM_NIL);
2234 }
2235 LA1_: ;
2236 return result;
2237 }
N_NIMCALL(NI,nsuParseHexInt)2238 N_LIB_PRIVATE N_NIMCALL(NI, nsuParseHexInt)(NimStringDesc* s) {
2239 NI result;
2240 NI L;
2241 result = (NI)0;
2242 result = ((NI) 0);
2243 L = parseHex__pureZstrutils_895(s, (&result), ((NI) 0), ((NI) 0));
2244 {
2245 NIM_BOOL T3_;
2246 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T7_;
2247 NimStringDesc* T8_;
2248 T3_ = (NIM_BOOL)0;
2249 T3_ = !((L == (s ? s->Sup.len : 0)));
2250 if (T3_) goto LA4_;
2251 T3_ = (L == ((NI) 0));
2252 LA4_: ;
2253 if (!T3_) goto LA5_;
2254 T7_ = NIM_NIL;
2255 T7_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
2256 (*T7_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
2257 (*T7_).Sup.Sup.name = "ValueError";
2258 T8_ = NIM_NIL;
2259 T8_ = rawNewString((s ? s->Sup.len : 0) + 21);
2260 appendString(T8_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_9));
2261 appendString(T8_, s);
2262 asgnRef((void**) (&(*T7_).Sup.Sup.message), T8_);
2263 asgnRef((void**) (&(*T7_).Sup.Sup.parent), ((Exception*) NIM_NIL));
2264 raiseExceptionEx((Exception*)T7_, "ValueError", "parseHexInt", "strutils.nim", 1154);
2265 }
2266 LA5_: ;
2267 return result;
2268 }
N_NIMCALL(NI,nsuParseInt)2269 N_LIB_PRIVATE N_NIMCALL(NI, nsuParseInt)(NimStringDesc* s) {
2270 NI result;
2271 NI L;
2272 result = (NI)0;
2273 result = ((NI) 0);
2274 L = npuParseInt(s, (&result), ((NI) 0));
2275 {
2276 NIM_BOOL T3_;
2277 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T7_;
2278 NimStringDesc* T8_;
2279 T3_ = (NIM_BOOL)0;
2280 T3_ = !((L == (s ? s->Sup.len : 0)));
2281 if (T3_) goto LA4_;
2282 T3_ = (L == ((NI) 0));
2283 LA4_: ;
2284 if (!T3_) goto LA5_;
2285 T7_ = NIM_NIL;
2286 T7_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
2287 (*T7_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
2288 (*T7_).Sup.Sup.name = "ValueError";
2289 T8_ = NIM_NIL;
2290 T8_ = rawNewString((s ? s->Sup.len : 0) + 17);
2291 appendString(T8_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_10));
2292 appendString(T8_, s);
2293 asgnRef((void**) (&(*T7_).Sup.Sup.message), T8_);
2294 asgnRef((void**) (&(*T7_).Sup.Sup.parent), ((Exception*) NIM_NIL));
2295 raiseExceptionEx((Exception*)T7_, "ValueError", "parseInt", "strutils.nim", 1072);
2296 }
2297 LA5_: ;
2298 return result;
2299 }
N_NIMCALL(NimStringDesc *,nsuToOctal)2300 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToOctal)(NIM_CHAR c) {
2301 NimStringDesc* result;
2302 NI val;
2303 result = NIM_NIL;
2304 result = mnewString(((NI) 3));
2305 val = ((NU8)(c));
2306 {
2307 NI i;
2308 NI res;
2309 i = (NI)0;
2310 res = ((NI) 2);
2311 {
2312 while (1) {
2313 if (!(((NI) 0) <= res)) goto LA3;
2314 i = res;
2315 result->data[i] = ((NIM_CHAR) (((NI) ((NI)((NI)(val % ((NI) 8)) + ((NI) 48))))));
2316 val = (NI)(val / ((NI) 8));
2317 res -= ((NI) 1);
2318 } LA3: ;
2319 }
2320 }
2321 return result;
2322 }
N_NIMCALL(NF,nsuParseFloat)2323 N_LIB_PRIVATE N_NIMCALL(NF, nsuParseFloat)(NimStringDesc* s) {
2324 NF result;
2325 NI L;
2326 result = (NF)0;
2327 result = 0.0;
2328 L = npuParseFloat(s, (&result), ((NI) 0));
2329 {
2330 NIM_BOOL T3_;
2331 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T7_;
2332 NimStringDesc* T8_;
2333 T3_ = (NIM_BOOL)0;
2334 T3_ = !((L == (s ? s->Sup.len : 0)));
2335 if (T3_) goto LA4_;
2336 T3_ = (L == ((NI) 0));
2337 LA4_: ;
2338 if (!T3_) goto LA5_;
2339 T7_ = NIM_NIL;
2340 T7_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
2341 (*T7_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
2342 (*T7_).Sup.Sup.name = "ValueError";
2343 T8_ = NIM_NIL;
2344 T8_ = rawNewString((s ? s->Sup.len : 0) + 15);
2345 appendString(T8_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_11));
2346 appendString(T8_, s);
2347 asgnRef((void**) (&(*T7_).Sup.Sup.message), T8_);
2348 asgnRef((void**) (&(*T7_).Sup.Sup.parent), ((Exception*) NIM_NIL));
2349 raiseExceptionEx((Exception*)T7_, "ValueError", "parseFloat", "strutils.nim", 1114);
2350 }
2351 LA5_: ;
2352 return result;
2353 }
N_NIMCALL(NimStringDesc *,nsuToBin)2354 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToBin)(NI64 x, NI len) {
2355 NimStringDesc* result;
2356 NU64 mask;
2357 NU64 shift;
2358 result = NIM_NIL;
2359 mask = 1ULL;
2360 shift = 0ULL;
2361 result = mnewString(((NI) (len)));
2362 {
2363 NI j;
2364 NI colontmp_;
2365 NI res;
2366 j = (NI)0;
2367 colontmp_ = (NI)0;
2368 colontmp_ = (NI)(((NI) (len)) - ((NI) 1));
2369 res = colontmp_;
2370 {
2371 while (1) {
2372 if (!(((NI) 0) <= res)) goto LA3;
2373 j = res;
2374 result->data[j] = ((NIM_CHAR) (((NI) ((NI)(((NI) ((NU64)((NU64)((NU64)(((NU64) (x)) & mask)) >> (NU64)(shift)))) + ((NI) 48))))));
2375 shift += ((NI) 1);
2376 mask = (NU64)((NU64)(mask) << (NU64)(1ULL));
2377 res -= ((NI) 1);
2378 } LA3: ;
2379 }
2380 }
2381 return result;
2382 }
N_NIMCALL(NimStringDesc *,nsuToOct)2383 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToOct)(NI64 x, NI len) {
2384 NimStringDesc* result;
2385 NU64 mask;
2386 NU64 shift;
2387 result = NIM_NIL;
2388 mask = 7ULL;
2389 shift = 0ULL;
2390 result = mnewString(((NI) (len)));
2391 {
2392 NI j;
2393 NI colontmp_;
2394 NI res;
2395 j = (NI)0;
2396 colontmp_ = (NI)0;
2397 colontmp_ = (NI)(((NI) (len)) - ((NI) 1));
2398 res = colontmp_;
2399 {
2400 while (1) {
2401 if (!(((NI) 0) <= res)) goto LA3;
2402 j = res;
2403 result->data[j] = ((NIM_CHAR) (((NI) ((NI)(((NI) ((NU64)((NU64)((NU64)(((NU64) (x)) & mask)) >> (NU64)(shift)))) + ((NI) 48))))));
2404 shift += ((NI) 3);
2405 mask = (NU64)((NU64)(mask) << (NU64)(3ULL));
2406 res -= ((NI) 1);
2407 } LA3: ;
2408 }
2409 }
2410 return result;
2411 }
N_NIMCALL(NimStringDesc *,nsuStrip)2412 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuStrip)(NimStringDesc* s, NIM_BOOL leading, NIM_BOOL trailing, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars) {
2413 NimStringDesc* result;
2414 NI first;
2415 NI last;
2416 result = NIM_NIL;
2417 first = ((NI) 0);
2418 last = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
2419 {
2420 if (!leading) goto LA3_;
2421 {
2422 while (1) {
2423 NIM_BOOL T7_;
2424 T7_ = (NIM_BOOL)0;
2425 T7_ = (first <= last);
2426 if (!(T7_)) goto LA8_;
2427 T7_ = ((chars[(NU)(((NU8)(s->data[first])))>>3] &(1U<<((NU)(((NU8)(s->data[first])))&7U)))!=0);
2428 LA8_: ;
2429 if (!T7_) goto LA6;
2430 first += ((NI) 1);
2431 } LA6: ;
2432 }
2433 }
2434 LA3_: ;
2435 {
2436 if (!trailing) goto LA11_;
2437 {
2438 while (1) {
2439 NIM_BOOL T15_;
2440 T15_ = (NIM_BOOL)0;
2441 T15_ = (first <= last);
2442 if (!(T15_)) goto LA16_;
2443 T15_ = ((chars[(NU)(((NU8)(s->data[last])))>>3] &(1U<<((NU)(((NU8)(s->data[last])))&7U)))!=0);
2444 LA16_: ;
2445 if (!T15_) goto LA14;
2446 last -= ((NI) 1);
2447 } LA14: ;
2448 }
2449 }
2450 LA11_: ;
2451 result = substr__system_7754(s, first, last);
2452 return result;
2453 }
N_NIMCALL(NimStringDesc *,nsuRepeatStr)2454 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuRepeatStr)(NimStringDesc* s, NI n) {
2455 NimStringDesc* result;
2456 result = NIM_NIL;
2457 result = rawNewString(((NI) ((NI)(((NI) (n)) * (s ? s->Sup.len : 0)))));
2458 {
2459 NI i;
2460 NI colontmp_;
2461 NI res;
2462 i = (NI)0;
2463 colontmp_ = (NI)0;
2464 colontmp_ = ((NI) (n));
2465 res = ((NI) 1);
2466 {
2467 while (1) {
2468 if (!(res <= colontmp_)) goto LA3;
2469 i = res;
2470 result = resizeString(result, (s ? s->Sup.len : 0) + 0);
2471 appendString(result, s);
2472 res += ((NI) 1);
2473 } LA3: ;
2474 }
2475 }
2476 return result;
2477 }
N_NIMCALL(NimStringDesc *,nsuIntToStr)2478 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuIntToStr)(NI x, NI minchars) {
2479 NimStringDesc* result;
2480 result = NIM_NIL;
2481 result = dollar___systemZdollars_3((x > 0? (x) : -(x)));
2482 {
2483 NI i;
2484 NI colontmp_;
2485 NI res;
2486 i = (NI)0;
2487 colontmp_ = (NI)0;
2488 colontmp_ = (NI)(((NI) (minchars)) - (result ? result->Sup.len : 0));
2489 res = ((NI) 1);
2490 {
2491 while (1) {
2492 NimStringDesc* T4_;
2493 if (!(res <= colontmp_)) goto LA3;
2494 i = res;
2495 T4_ = NIM_NIL;
2496 T4_ = rawNewString((result ? result->Sup.len : 0) + 1);
2497 appendChar(T4_, 48);
2498 appendString(T4_, result);
2499 result = T4_;
2500 res += ((NI) 1);
2501 } LA3: ;
2502 }
2503 }
2504 {
2505 NimStringDesc* T9_;
2506 if (!(x < ((NI) 0))) goto LA7_;
2507 T9_ = NIM_NIL;
2508 T9_ = rawNewString((result ? result->Sup.len : 0) + 1);
2509 appendChar(T9_, 45);
2510 appendString(T9_, result);
2511 result = T9_;
2512 }
2513 LA7_: ;
2514 return result;
2515 }
N_INLINE(int,nimCmpMem)2516 static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) {
2517 int result;
2518 result = (int)0;
2519 result = memcmp(a, b, ((size_t) (size)));
2520 return result;
2521 }
N_INLINE(NIM_BOOL,equalMem__system_1735)2522 static N_INLINE(NIM_BOOL, equalMem__system_1735)(void* a, void* b, NI size) {
2523 NIM_BOOL result;
2524 int T1_;
2525 result = (NIM_BOOL)0;
2526 T1_ = (int)0;
2527 T1_ = nimCmpMem(a, b, size);
2528 result = (T1_ == ((NI32) 0));
2529 return result;
2530 }
N_INLINE(NIM_BOOL,eqStrings)2531 static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
2532 NIM_BOOL result;
2533 NI alen;
2534 NI blen;
2535 { result = (NIM_BOOL)0;
2536 alen = (a ? a->Sup.len : 0);
2537 blen = (b ? b->Sup.len : 0);
2538 {
2539 if (!(alen == blen)) goto LA3_;
2540 {
2541 if (!(alen == ((NI) 0))) goto LA7_;
2542 result = NIM_TRUE;
2543 goto BeforeRet_;
2544 }
2545 LA7_: ;
2546 result = equalMem__system_1735(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen)));
2547 goto BeforeRet_;
2548 }
2549 LA3_: ;
2550 }BeforeRet_: ;
2551 return result;
2552 }
N_NIMCALL(NIM_BOOL,parseBool__pureZstrutils_998)2553 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, parseBool__pureZstrutils_998)(NimStringDesc* s) {
2554 NIM_BOOL result;
2555 NimStringDesc* T1_;
2556 result = (NIM_BOOL)0;
2557 T1_ = NIM_NIL;
2558 T1_ = nsuNormalize(s);
2559 switch (hashString(T1_) & 15) {
2560 case 0:
2561 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_13))) goto LA2_;
2562 break;
2563 case 1:
2564 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_17))) goto LA3_;
2565 break;
2566 case 5:
2567 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_14))) goto LA2_;
2568 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_18))) goto LA3_;
2569 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_21))) goto LA3_;
2570 break;
2571 case 8:
2572 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_12))) goto LA2_;
2573 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_16))) goto LA2_;
2574 break;
2575 case 9:
2576 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_15))) goto LA2_;
2577 break;
2578 case 10:
2579 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_19))) goto LA3_;
2580 break;
2581 case 11:
2582 if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_20))) goto LA3_;
2583 break;
2584 }
2585 goto LA4_;
2586 LA2_: ;
2587 {
2588 result = NIM_TRUE;
2589 }
2590 goto LA5_;
2591 LA3_: ;
2592 {
2593 result = NIM_FALSE;
2594 }
2595 goto LA5_;
2596 LA4_: ;
2597 {
2598 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T9_;
2599 NimStringDesc* T10_;
2600 T9_ = NIM_NIL;
2601 T9_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
2602 (*T9_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
2603 (*T9_).Sup.Sup.name = "ValueError";
2604 T10_ = NIM_NIL;
2605 T10_ = rawNewString((s ? s->Sup.len : 0) + 28);
2606 appendString(T10_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_22));
2607 appendString(T10_, s);
2608 asgnRef((void**) (&(*T9_).Sup.Sup.message), T10_);
2609 asgnRef((void**) (&(*T9_).Sup.Sup.parent), ((Exception*) NIM_NIL));
2610 raiseExceptionEx((Exception*)T9_, "ValueError", "parseBool", "strutils.nim", 1216);
2611 }
2612 LA5_: ;
2613 return result;
2614 }
N_NIMCALL(NI64,nsuParseBiggestInt)2615 N_LIB_PRIVATE N_NIMCALL(NI64, nsuParseBiggestInt)(NimStringDesc* s) {
2616 NI64 result;
2617 NI L;
2618 result = (NI64)0;
2619 result = IL64(0);
2620 L = npuParseBiggestInt(s, (&result), ((NI) 0));
2621 {
2622 NIM_BOOL T3_;
2623 tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T7_;
2624 NimStringDesc* T8_;
2625 T3_ = (NIM_BOOL)0;
2626 T3_ = !((L == (s ? s->Sup.len : 0)));
2627 if (T3_) goto LA4_;
2628 T3_ = (L == ((NI) 0));
2629 LA4_: ;
2630 if (!T3_) goto LA5_;
2631 T7_ = NIM_NIL;
2632 T7_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
2633 (*T7_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
2634 (*T7_).Sup.Sup.name = "ValueError";
2635 T8_ = NIM_NIL;
2636 T8_ = rawNewString((s ? s->Sup.len : 0) + 17);
2637 appendString(T8_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_10));
2638 appendString(T8_, s);
2639 asgnRef((void**) (&(*T7_).Sup.Sup.message), T8_);
2640 asgnRef((void**) (&(*T7_).Sup.Sup.parent), ((Exception*) NIM_NIL));
2641 raiseExceptionEx((Exception*)T7_, "ValueError", "parseBiggestInt", "strutils.nim", 1082);
2642 }
2643 LA5_: ;
2644 return result;
2645 }
N_NIMCALL(NIM_CHAR,nsuToUpperAsciiChar)2646 N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c) {
2647 NIM_CHAR result;
2648 result = (NIM_CHAR)0;
2649 {
2650 if (!(((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)))) goto LA3_;
2651 result = ((NIM_CHAR) ((NU8)(((NU8) (((NU8)(c)))) ^ ((NU8) 32))));
2652 }
2653 goto LA1_;
2654 LA3_: ;
2655 {
2656 result = c;
2657 }
2658 LA1_: ;
2659 return result;
2660 }
N_NIMCALL(NIM_BOOL,substrEq__pureZstrutils_229)2661 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, substrEq__pureZstrutils_229)(NimStringDesc* s, NI pos, NimStringDesc* substr) {
2662 NIM_BOOL result;
2663 NI i;
2664 NI length;
2665 { result = (NIM_BOOL)0;
2666 i = ((NI) 0);
2667 length = (substr ? substr->Sup.len : 0);
2668 {
2669 while (1) {
2670 NIM_BOOL T3_;
2671 NIM_BOOL T4_;
2672 T3_ = (NIM_BOOL)0;
2673 T4_ = (NIM_BOOL)0;
2674 T4_ = (i < length);
2675 if (!(T4_)) goto LA5_;
2676 T4_ = ((NI)(pos + i) < (s ? s->Sup.len : 0));
2677 LA5_: ;
2678 T3_ = T4_;
2679 if (!(T3_)) goto LA6_;
2680 T3_ = ((NU8)(s->data[(NI)(pos + i)]) == (NU8)(substr->data[i]));
2681 LA6_: ;
2682 if (!T3_) goto LA2;
2683 i += ((NI) 1);
2684 } LA2: ;
2685 }
2686 result = (i == length);
2687 goto BeforeRet_;
2688 }BeforeRet_: ;
2689 return result;
2690 }
N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ *,nsuSplitString)2691 N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitString)(NimStringDesc* s, NimStringDesc* sep, NI maxsplit) {
2692 tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
2693 result = NIM_NIL;
2694 {
2695 if (!!((((NI) 0) < (sep ? sep->Sup.len : 0)))) goto LA3_;
2696 failedAssertImpl__systemZassertions_56(((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_23));
2697 }
2698 LA3_: ;
2699 result = NIM_NIL;
2700 {
2701 NimStringDesc* xX60gensym72_;
2702 NI lastX60gensym41_;
2703 NI splitsX60gensym41_;
2704 xX60gensym72_ = NIM_NIL;
2705 lastX60gensym41_ = ((NI) 0);
2706 splitsX60gensym41_ = maxsplit;
2707 {
2708 while (1) {
2709 NI firstX60gensym41_;
2710 NI T17_;
2711 NimStringDesc* T18_;
2712 if (!(lastX60gensym41_ <= (s ? s->Sup.len : 0))) goto LA7;
2713 firstX60gensym41_ = lastX60gensym41_;
2714 {
2715 while (1) {
2716 NIM_BOOL T10_;
2717 NIM_BOOL T12_;
2718 T10_ = (NIM_BOOL)0;
2719 T10_ = (lastX60gensym41_ < (s ? s->Sup.len : 0));
2720 if (!(T10_)) goto LA11_;
2721 T12_ = (NIM_BOOL)0;
2722 T12_ = substrEq__pureZstrutils_229(s, lastX60gensym41_, sep);
2723 T10_ = !(T12_);
2724 LA11_: ;
2725 if (!T10_) goto LA9;
2726 lastX60gensym41_ += ((NI) 1);
2727 } LA9: ;
2728 }
2729 {
2730 if (!(splitsX60gensym41_ == ((NI) 0))) goto LA15_;
2731 lastX60gensym41_ = (s ? s->Sup.len : 0);
2732 }
2733 LA15_: ;
2734 xX60gensym72_ = substr__system_7754(s, firstX60gensym41_, (NI)(lastX60gensym41_ - ((NI) 1)));
2735 result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
2736 T17_ = result->Sup.len++;
2737 T18_ = NIM_NIL;
2738 T18_ = result->data[T17_]; result->data[T17_] = copyStringRC1(xX60gensym72_);
2739 if (T18_) nimGCunrefNoCycle(T18_);
2740 {
2741 if (!(splitsX60gensym41_ == ((NI) 0))) goto LA21_;
2742 goto LA6;
2743 }
2744 LA21_: ;
2745 splitsX60gensym41_ -= ((NI) 1);
2746 lastX60gensym41_ += (sep ? sep->Sup.len : 0);
2747 } LA7: ;
2748 } LA6: ;
2749 }
2750 return result;
2751 }
N_NIMCALL(NimStringDesc *,nsuEscape)2752 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuEscape)(NimStringDesc* s, NimStringDesc* prefix, NimStringDesc* suffix) {
2753 NimStringDesc* result;
2754 result = NIM_NIL;
2755 result = rawNewString(((NI) ((NI)((s ? s->Sup.len : 0) + (NI)((NI64)((s ? s->Sup.len : 0)) >> (NU64)(((NI) 2)))))));
2756 result = resizeString(result, (prefix ? prefix->Sup.len : 0) + 0);
2757 appendString(result, prefix);
2758 {
2759 NIM_CHAR c;
2760 NI i;
2761 NI L;
2762 c = (NIM_CHAR)0;
2763 i = ((NI) 0);
2764 L = (s ? s->Sup.len : 0);
2765 {
2766 while (1) {
2767 if (!(i < L)) goto LA3;
2768 c = s->data[i];
2769 switch (((NU8)(c))) {
2770 case 0 ... 31:
2771 case 127 ... 255:
2772 {
2773 NimStringDesc* T5_;
2774 result = resizeString(result, 2);
2775 appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_24));
2776 T5_ = NIM_NIL;
2777 T5_ = toHex__pureZstrutils_1792(((NU8)(c)), ((NI) 2));
2778 result = resizeString(result, (T5_ ? T5_->Sup.len : 0) + 0);
2779 appendString(result, T5_);
2780 }
2781 break;
2782 case 92:
2783 {
2784 result = resizeString(result, 2);
2785 appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_25));
2786 }
2787 break;
2788 case 39:
2789 {
2790 result = resizeString(result, 2);
2791 appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_26));
2792 }
2793 break;
2794 case 34:
2795 {
2796 result = resizeString(result, 2);
2797 appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_27));
2798 }
2799 break;
2800 default:
2801 {
2802 result = addChar(result, c);
2803 }
2804 break;
2805 }
2806 i += ((NI) 1);
2807 } LA3: ;
2808 }
2809 }
2810 result = resizeString(result, (suffix ? suffix->Sup.len : 0) + 0);
2811 appendString(result, suffix);
2812 return result;
2813 }
N_INLINE(NimStringDesc *,X5BX5D___pureZunicode_865)2814 static N_INLINE(NimStringDesc*, X5BX5D___pureZunicode_865)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x) {
2815 NimStringDesc* result;
2816 NI a;
2817 NI L;
2818 result = NIM_NIL;
2819 a = x.a;
2820 L = (NI)((NI)(x.b - a) + ((NI) 1));
2821 result = mnewString(((NI) (L)));
2822 {
2823 NI i;
2824 NI i_2;
2825 i = (NI)0;
2826 i_2 = ((NI) 0);
2827 {
2828 while (1) {
2829 if (!(i_2 < L)) goto LA3;
2830 i = i_2;
2831 result->data[i] = s->data[(NI)(i + a)];
2832 i_2 += ((NI) 1);
2833 } LA3: ;
2834 }
2835 }
2836 return result;
2837 }
N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA,dotdot___pureZunicode_840)2838 static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___pureZunicode_840)(NI a, NI b) {
2839 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
2840 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
2841 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
2842 result.a = a;
2843 result.b = b;
2844 return result;
2845 }
N_INLINE(NimStringDesc *,X5BX5D___pureZunicode_3215)2846 static N_INLINE(NimStringDesc*, X5BX5D___pureZunicode_3215)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x) {
2847 NimStringDesc* result;
2848 NI a;
2849 NI L;
2850 result = NIM_NIL;
2851 a = x.a;
2852 L = (NI)((NI)((NI)((s ? s->Sup.len : 0) - x.b) - a) + ((NI) 1));
2853 result = mnewString(((NI) (L)));
2854 {
2855 NI i;
2856 NI i_2;
2857 i = (NI)0;
2858 i_2 = ((NI) 0);
2859 {
2860 while (1) {
2861 if (!(i_2 < L)) goto LA3;
2862 i = i_2;
2863 result->data[i] = s->data[(NI)(i + a)];
2864 i_2 += ((NI) 1);
2865 } LA3: ;
2866 }
2867 }
2868 return result;
2869 }
N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA,dotdot___stdZenumutils_80)2870 static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___stdZenumutils_80)(NI a, NI b) {
2871 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
2872 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
2873 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
2874 result.a = a;
2875 result.b = b;
2876 return result;
2877 }
N_NIMCALL(NimStringDesc *,nsuUnindent)2878 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuUnindent)(NimStringDesc* s, NI count, NimStringDesc* padding) {
2879 NimStringDesc* result;
2880 NI i;
2881 result = NIM_NIL;
2882 result = ((NimStringDesc*) NIM_NIL);
2883 i = ((NI) 0);
2884 {
2885 NimStringDesc* line;
2886 NI first;
2887 NI last;
2888 NI eolpos;
2889 line = NIM_NIL;
2890 first = ((NI) 0);
2891 last = ((NI) 0);
2892 eolpos = ((NI) 0);
2893 {
2894 while (1) {
2895 NI T25_;
2896 NI indentCount;
2897 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T46_;
2898 NimStringDesc* T47_;
2899 {
2900 while (1) {
2901 NIM_BOOL T6_;
2902 T6_ = (NIM_BOOL)0;
2903 T6_ = (last < (s ? s->Sup.len : 0));
2904 if (!(T6_)) goto LA7_;
2905 T6_ = !((((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10))));
2906 LA7_: ;
2907 if (!T6_) goto LA5;
2908 last += ((NI) 1);
2909 } LA5: ;
2910 }
2911 eolpos = last;
2912 {
2913 if (!(last < (s ? s->Sup.len : 0))) goto LA10_;
2914 {
2915 if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA14_;
2916 last += ((NI) 1);
2917 }
2918 goto LA12_;
2919 LA14_: ;
2920 {
2921 if (!((NU8)(s->data[last]) == (NU8)(13))) goto LA17_;
2922 last += ((NI) 1);
2923 {
2924 NIM_BOOL T21_;
2925 T21_ = (NIM_BOOL)0;
2926 T21_ = (last < (s ? s->Sup.len : 0));
2927 if (!(T21_)) goto LA22_;
2928 T21_ = ((NU8)(s->data[last]) == (NU8)(10));
2929 LA22_: ;
2930 if (!T21_) goto LA23_;
2931 last += ((NI) 1);
2932 }
2933 LA23_: ;
2934 }
2935 goto LA12_;
2936 LA17_: ;
2937 LA12_: ;
2938 }
2939 LA10_: ;
2940 T25_ = (NI)0;
2941 {
2942 if (!NIM_FALSE) goto LA28_;
2943 T25_ = (NI)(last - ((NI) 1));
2944 }
2945 goto LA26_;
2946 LA28_: ;
2947 {
2948 T25_ = (NI)(eolpos - ((NI) 1));
2949 }
2950 LA26_: ;
2951 line = substr__system_7754(s, first, T25_);
2952 {
2953 if (!!((i == ((NI) 0)))) goto LA33_;
2954 result = resizeString(result, 1);
2955 appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_28));
2956 }
2957 LA33_: ;
2958 indentCount = ((NI) 0);
2959 {
2960 NI j;
2961 NI colontmp_;
2962 NI i_2;
2963 j = (NI)0;
2964 colontmp_ = (NI)0;
2965 colontmp_ = ((NI) (count));
2966 i_2 = ((NI) 0);
2967 {
2968 while (1) {
2969 if (!(i_2 < colontmp_)) goto LA37;
2970 j = i_2;
2971 indentCount += ((NI) 1);
2972 {
2973 NIM_BOOL T40_;
2974 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T42_;
2975 NimStringDesc* T43_;
2976 T40_ = (NIM_BOOL)0;
2977 T40_ = ((line ? line->Sup.len : 0) <= (NI)((NI)(j + (padding ? padding->Sup.len : 0)) - ((NI) 1)));
2978 if (T40_) goto LA41_;
2979 T42_ = dotdot___pureZunicode_840(j, (NI)((NI)(j + (padding ? padding->Sup.len : 0)) - ((NI) 1)));
2980 T43_ = NIM_NIL;
2981 T43_ = X5BX5D___pureZunicode_865(line, T42_);
2982 T40_ = !(eqStrings(T43_, padding));
2983 LA41_: ;
2984 if (!T40_) goto LA44_;
2985 indentCount = j;
2986 goto LA35;
2987 }
2988 LA44_: ;
2989 i_2 += ((NI) 1);
2990 } LA37: ;
2991 }
2992 } LA35: ;
2993 T46_ = dotdot___stdZenumutils_80((NI)(indentCount * (padding ? padding->Sup.len : 0)), ((NI) 1));
2994 T47_ = NIM_NIL;
2995 T47_ = X5BX5D___pureZunicode_3215(line, T46_);
2996 result = resizeString(result, (T47_ ? T47_->Sup.len : 0) + 0);
2997 appendString(result, T47_);
2998 i += ((NI) 1);
2999 {
3000 if (!(eolpos == last)) goto LA50_;
3001 goto LA2;
3002 }
3003 LA50_: ;
3004 first = last;
3005 }
3006 } LA2: ;
3007 }
3008 return result;
3009 }
N_NIMCALL(NIM_BOOL,nsuIsAlphaAsciiChar)3010 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuIsAlphaAsciiChar)(NIM_CHAR c) {
3011 NIM_BOOL result;
3012 { result = (NIM_BOOL)0;
3013 result = (((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)) || ((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)));
3014 goto BeforeRet_;
3015 }BeforeRet_: ;
3016 return result;
3017 }
N_NIMCALL(NIM_BOOL,nsuIsAlphaNumericChar)3018 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuIsAlphaNumericChar)(NIM_CHAR c) {
3019 NIM_BOOL result;
3020 { result = (NIM_BOOL)0;
3021 result = (((NU8)(c)) >= ((NU8)(48)) && ((NU8)(c)) <= ((NU8)(57)) || ((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)) || ((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)));
3022 goto BeforeRet_;
3023 }BeforeRet_: ;
3024 return result;
3025 }
N_NIMCALL(NimStringDesc *,nsuDedent)3026 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuDedent)(NimStringDesc* s, NI count) {
3027 NimStringDesc* result;
3028 result = NIM_NIL;
3029 result = nsuUnindent(s, count, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_29));
3030 return result;
3031 }
N_NIMCALL(NI,indentation__pureZstrutils_1194)3032 N_LIB_PRIVATE N_NIMCALL(NI, indentation__pureZstrutils_1194)(NimStringDesc* s) {
3033 NI result;
3034 result = (NI)0;
3035 result = ((NI) IL64(9223372036854775807));
3036 {
3037 NimStringDesc* line;
3038 NI first;
3039 NI last;
3040 NI eolpos;
3041 line = NIM_NIL;
3042 first = ((NI) 0);
3043 last = ((NI) 0);
3044 eolpos = ((NI) 0);
3045 {
3046 while (1) {
3047 NI T25_;
3048 {
3049 while (1) {
3050 NIM_BOOL T6_;
3051 T6_ = (NIM_BOOL)0;
3052 T6_ = (last < (s ? s->Sup.len : 0));
3053 if (!(T6_)) goto LA7_;
3054 T6_ = !((((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10))));
3055 LA7_: ;
3056 if (!T6_) goto LA5;
3057 last += ((NI) 1);
3058 } LA5: ;
3059 }
3060 eolpos = last;
3061 {
3062 if (!(last < (s ? s->Sup.len : 0))) goto LA10_;
3063 {
3064 if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA14_;
3065 last += ((NI) 1);
3066 }
3067 goto LA12_;
3068 LA14_: ;
3069 {
3070 if (!((NU8)(s->data[last]) == (NU8)(13))) goto LA17_;
3071 last += ((NI) 1);
3072 {
3073 NIM_BOOL T21_;
3074 T21_ = (NIM_BOOL)0;
3075 T21_ = (last < (s ? s->Sup.len : 0));
3076 if (!(T21_)) goto LA22_;
3077 T21_ = ((NU8)(s->data[last]) == (NU8)(10));
3078 LA22_: ;
3079 if (!T21_) goto LA23_;
3080 last += ((NI) 1);
3081 }
3082 LA23_: ;
3083 }
3084 goto LA12_;
3085 LA17_: ;
3086 LA12_: ;
3087 }
3088 LA10_: ;
3089 T25_ = (NI)0;
3090 {
3091 if (!NIM_FALSE) goto LA28_;
3092 T25_ = (NI)(last - ((NI) 1));
3093 }
3094 goto LA26_;
3095 LA28_: ;
3096 {
3097 T25_ = (NI)(eolpos - ((NI) 1));
3098 }
3099 LA26_: ;
3100 line = substr__system_7754(s, first, T25_);
3101 {
3102 NI i;
3103 NIM_CHAR c;
3104 NI i_2;
3105 NI L;
3106 i = (NI)0;
3107 c = (NIM_CHAR)0;
3108 i_2 = ((NI) 0);
3109 L = (line ? line->Sup.len : 0);
3110 {
3111 while (1) {
3112 if (!(i_2 < L)) goto LA33;
3113 i = i_2;
3114 c = line->data[i_2];
3115 {
3116 if (!(((NI) (result)) <= i)) goto LA36_;
3117 goto LA31;
3118 }
3119 goto LA34_;
3120 LA36_: ;
3121 {
3122 if (!!(((NU8)(c) == (NU8)(32)))) goto LA39_;
3123 result = ((NI) (i));
3124 goto LA31;
3125 }
3126 goto LA34_;
3127 LA39_: ;
3128 LA34_: ;
3129 i_2 += ((NI) 1);
3130 } LA33: ;
3131 }
3132 } LA31: ;
3133 {
3134 if (!(eolpos == last)) goto LA43_;
3135 goto LA2;
3136 }
3137 LA43_: ;
3138 first = last;
3139 }
3140 } LA2: ;
3141 }
3142 {
3143 if (!(((NI) (result)) == ((NI) IL64(9223372036854775807)))) goto LA47_;
3144 result = ((NI) 0);
3145 }
3146 LA47_: ;
3147 return result;
3148 }
N_NIMCALL(NIM_BOOL,nsuIsDigitChar)3149 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuIsDigitChar)(NIM_CHAR c) {
3150 NIM_BOOL result;
3151 { result = (NIM_BOOL)0;
3152 result = (((NU8)(c)) >= ((NU8)(48)) && ((NU8)(c)) <= ((NU8)(57)));
3153 goto BeforeRet_;
3154 }BeforeRet_: ;
3155 return result;
3156 }
N_NIMCALL(void,nsuDelete)3157 N_LIB_PRIVATE N_NIMCALL(void, nsuDelete)(NimStringDesc** s, NI first, NI last) {
3158 NI i;
3159 NI j;
3160 NI newLen;
3161 i = first;
3162 j = ((((*s) ? (*s)->Sup.len : 0) <= (NI)(last + ((NI) 1))) ? ((*s) ? (*s)->Sup.len : 0) : (NI)(last + ((NI) 1)));
3163 newLen = (NI)((NI)(((*s) ? (*s)->Sup.len : 0) - j) + i);
3164 {
3165 while (1) {
3166 if (!(i < newLen)) goto LA2;
3167 (*s)->data[i] = (*s)->data[j];
3168 i += ((NI) 1);
3169 j += ((NI) 1);
3170 } LA2: ;
3171 }
3172 unsureAsgnRef((void**) (&(*s)), setLengthStr((*s), ((NI) (newLen))));
3173 }
N_NIMCALL(NIM_BOOL,nsuIsUpperAsciiChar)3174 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuIsUpperAsciiChar)(NIM_CHAR c) {
3175 NIM_BOOL result;
3176 { result = (NIM_BOOL)0;
3177 result = (((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)));
3178 goto BeforeRet_;
3179 }BeforeRet_: ;
3180 return result;
3181 }
N_NIMCALL(NimStringDesc *,nsuCapitalizeAscii)3182 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuCapitalizeAscii)(NimStringDesc* s) {
3183 NimStringDesc* result;
3184 result = NIM_NIL;
3185 {
3186 if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
3187 result = ((NimStringDesc*) NIM_NIL);
3188 }
3189 goto LA1_;
3190 LA3_: ;
3191 {
3192 NimStringDesc* T6_;
3193 NIM_CHAR T7_;
3194 NimStringDesc* T8_;
3195 T6_ = NIM_NIL;
3196 T7_ = (NIM_CHAR)0;
3197 T7_ = nsuToUpperAsciiChar(s->data[((NI) 0)]);
3198 T8_ = NIM_NIL;
3199 T8_ = substr__system_7766(s, ((NI) 1));
3200 T6_ = rawNewString((T8_ ? T8_->Sup.len : 0) + 1);
3201 appendChar(T6_, T7_);
3202 appendString(T6_, T8_);
3203 result = T6_;
3204 }
3205 LA1_: ;
3206 return result;
3207 }
N_NIMCALL(NI,nsuCountLines)3208 N_LIB_PRIVATE N_NIMCALL(NI, nsuCountLines)(NimStringDesc* s) {
3209 NI result;
3210 NI i;
3211 result = (NI)0;
3212 result = ((NI) 1);
3213 i = ((NI) 0);
3214 {
3215 while (1) {
3216 if (!(i < (s ? s->Sup.len : 0))) goto LA2;
3217 switch (((NU8)(s->data[i]))) {
3218 case 13:
3219 {
3220 {
3221 NIM_BOOL T6_;
3222 T6_ = (NIM_BOOL)0;
3223 T6_ = ((NI)(i + ((NI) 1)) < (s ? s->Sup.len : 0));
3224 if (!(T6_)) goto LA7_;
3225 T6_ = ((NU8)(s->data[(NI)(i + ((NI) 1))]) == (NU8)(10));
3226 LA7_: ;
3227 if (!T6_) goto LA8_;
3228 i += ((NI) 1);
3229 }
3230 LA8_: ;
3231 result += ((NI) 1);
3232 }
3233 break;
3234 case 10:
3235 {
3236 result += ((NI) 1);
3237 }
3238 break;
3239 default:
3240 {
3241 }
3242 break;
3243 }
3244 i += ((NI) 1);
3245 } LA2: ;
3246 }
3247 return result;
3248 }
N_NIMCALL(NimStringDesc *,nsuAlignString)3249 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuAlignString)(NimStringDesc* s, NI count, NIM_CHAR padding) {
3250 NimStringDesc* result;
3251 result = NIM_NIL;
3252 {
3253 NI spaces;
3254 if (!((s ? s->Sup.len : 0) < ((NI) (count)))) goto LA3_;
3255 result = mnewString(count);
3256 spaces = (NI)(((NI) (count)) - (s ? s->Sup.len : 0));
3257 {
3258 NI i;
3259 NI colontmp_;
3260 NI res;
3261 i = (NI)0;
3262 colontmp_ = (NI)0;
3263 colontmp_ = (NI)(spaces - ((NI) 1));
3264 res = ((NI) 0);
3265 {
3266 while (1) {
3267 if (!(res <= colontmp_)) goto LA7;
3268 i = res;
3269 result->data[i] = padding;
3270 res += ((NI) 1);
3271 } LA7: ;
3272 }
3273 }
3274 {
3275 NI i_2;
3276 NI colontmp__2;
3277 NI res_2;
3278 i_2 = (NI)0;
3279 colontmp__2 = (NI)0;
3280 colontmp__2 = (NI)(((NI) (count)) - ((NI) 1));
3281 res_2 = spaces;
3282 {
3283 while (1) {
3284 if (!(res_2 <= colontmp__2)) goto LA10;
3285 i_2 = res_2;
3286 result->data[i_2] = s->data[(NI)(i_2 - spaces)];
3287 res_2 += ((NI) 1);
3288 } LA10: ;
3289 }
3290 }
3291 }
3292 goto LA1_;
3293 LA3_: ;
3294 {
3295 result = copyString(s);
3296 }
3297 LA1_: ;
3298 return result;
3299 }
N_NIMCALL(NimStringDesc *,nsuformatBiggestFloat)3300 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuformatBiggestFloat)(NF f, tyEnum_FloatFormatMode__pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep) {
3301 NimStringDesc* result;
3302 tyArray__9bPFPkkEEeeNM9bKgiV8Q49cg frmtstr;
3303 tyArray__Kn8ZOVsorvcNLB4isUeMzQ buf;
3304 int L;
3305 result = NIM_NIL;
3306 L = (int)0;
3307 frmtstr[(((NI) 0))- 0] = 37;
3308 {
3309 if (!(((NI) 0) <= ((NI) (precision)))) goto LA3_;
3310 frmtstr[(((NI) 1))- 0] = 35;
3311 frmtstr[(((NI) 2))- 0] = 46;
3312 frmtstr[(((NI) 3))- 0] = 42;
3313 frmtstr[(((NI) 4))- 0] = floatFormatToChar__pureZstrutils_1864[(format)- 0];
3314 frmtstr[(((NI) 5))- 0] = 0;
3315 L = sprintf(((NCSTRING) (buf)), ((NCSTRING) (frmtstr)), precision, f);
3316 }
3317 goto LA1_;
3318 LA3_: ;
3319 {
3320 frmtstr[(((NI) 1))- 0] = floatFormatToChar__pureZstrutils_1864[(format)- 0];
3321 frmtstr[(((NI) 2))- 0] = 0;
3322 L = sprintf(((NCSTRING) (buf)), ((NCSTRING) (frmtstr)), f);
3323 }
3324 LA1_: ;
3325 result = mnewString(((NI) (L)));
3326 {
3327 NI32 i;
3328 NI32 res;
3329 i = (NI32)0;
3330 res = ((NI32) 0);
3331 {
3332 while (1) {
3333 if (!(res < L)) goto LA8;
3334 i = res;
3335 {
3336 if (!(((NU8)(buf[(i)- 0])) == ((NU8)(46)) || ((NU8)(buf[(i)- 0])) == ((NU8)(44)))) goto LA11_;
3337 result->data[i] = decimalSep;
3338 }
3339 goto LA9_;
3340 LA11_: ;
3341 {
3342 result->data[i] = buf[(i)- 0];
3343 }
3344 LA9_: ;
3345 res += ((NI) 1);
3346 } LA8: ;
3347 }
3348 }
3349 return result;
3350 }
N_NIMCALL(NimStringDesc *,nsuformatFloat)3351 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuformatFloat)(NF f, tyEnum_FloatFormatMode__pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep) {
3352 NimStringDesc* result;
3353 result = NIM_NIL;
3354 result = nsuformatBiggestFloat(f, format, precision, decimalSep);
3355 return result;
3356 }
N_NIMCALL(void,trimZeros__pureZstrutils_1951)3357 N_LIB_PRIVATE N_NIMCALL(void, trimZeros__pureZstrutils_1951)(NimStringDesc** x, NIM_CHAR decimalSep) {
3358 NI sPos;
3359 sPos = nsuFindChar((*x), decimalSep, ((NI) 0), ((NI) 0));
3360 {
3361 NI last;
3362 NI pos;
3363 if (!(((NI) 0) <= sPos)) goto LA3_;
3364 last = nsuFindChar((*x), 101, ((NI) (sPos)), ((NI) 0));
3365 {
3366 if (!(((NI) 0) <= last)) goto LA7_;
3367 last = (NI)(last - ((NI) 1));
3368 }
3369 goto LA5_;
3370 LA7_: ;
3371 {
3372 last = (((*x) ? (*x)->Sup.len : 0)-1);
3373 }
3374 LA5_: ;
3375 pos = last;
3376 {
3377 while (1) {
3378 NIM_BOOL T12_;
3379 T12_ = (NIM_BOOL)0;
3380 T12_ = (((NI) 0) <= pos);
3381 if (!(T12_)) goto LA13_;
3382 T12_ = ((NU8)((*x)->data[pos]) == (NU8)(48));
3383 LA13_: ;
3384 if (!T12_) goto LA11;
3385 pos -= ((NI) 1);
3386 } LA11: ;
3387 }
3388 {
3389 if (!(sPos < pos)) goto LA16_;
3390 pos += ((NI) 1);
3391 }
3392 LA16_: ;
3393 nsuDelete(x, pos, last);
3394 }
3395 LA3_: ;
3396 }
N_NIMCALL(NimStringDesc *,formatSize__pureZstrutils_1971)3397 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, formatSize__pureZstrutils_1971)(NI64 bytes, NIM_CHAR decimalSep, tyEnum_BinaryPrefixMode__nDtrM19b3byM8T9ab2m7BwvA prefix, NIM_BOOL includeSpace) {
3398 NimStringDesc* result;
3399 NI64 xb;
3400 NF fbytes;
3401 NI64 lastXb;
3402 NI matchedIndex;
3403 tyArray__17w6ns39bmjfAZ429aQpCFUA prefixes;
3404 result = NIM_NIL;
3405 xb = bytes;
3406 fbytes = (NF)0;
3407 lastXb = bytes;
3408 matchedIndex = ((NI) 0);
3409 nimZeroMem((void*)prefixes, sizeof(tyArray__17w6ns39bmjfAZ429aQpCFUA));
3410 {
3411 if (!(prefix == ((tyEnum_BinaryPrefixMode__nDtrM19b3byM8T9ab2m7BwvA) 1))) goto LA3_;
3412 genericAssign((void*)prefixes, (void*)collPrefixes__pureZstrutils_1978, (&NTIarrayL48OO56_stringT__17w6ns39bmjfAZ429aQpCFUA_));
3413 }
3414 goto LA1_;
3415 LA3_: ;
3416 {
3417 genericAssign((void*)prefixes, (void*)iecPrefixes__pureZstrutils_1977, (&NTIarrayL48OO56_stringT__17w6ns39bmjfAZ429aQpCFUA_));
3418 }
3419 LA1_: ;
3420 {
3421 NI index;
3422 NI i;
3423 index = (NI)0;
3424 i = ((NI) 1);
3425 {
3426 while (1) {
3427 if (!(i < ((NI) 9))) goto LA8;
3428 index = i;
3429 lastXb = xb;
3430 xb = (NI64)(bytes / (NI64)((NU64)(IL64(1)) << (NU64)((NI)(index * ((NI) 10)))));
3431 matchedIndex = index;
3432 {
3433 if (!(xb == IL64(0))) goto LA11_;
3434 xb = lastXb;
3435 matchedIndex = (NI)(index - ((NI) 1));
3436 goto LA6;
3437 }
3438 LA11_: ;
3439 i += ((NI) 1);
3440 } LA8: ;
3441 }
3442 } LA6: ;
3443 fbytes = ((NF)(((NF) (bytes))) / (NF)(((NF) ((NI64)((NU64)(IL64(1)) << (NU64)((NI)(matchedIndex * ((NI) 10))))))));
3444 result = nsuformatFloat(fbytes, ((tyEnum_FloatFormatMode__pNvEoaqwoxKyoASD11vSgQ) 1), ((NI) 3), decimalSep);
3445 trimZeros__pureZstrutils_1951((&result), decimalSep);
3446 {
3447 if (!includeSpace) goto LA15_;
3448 result = resizeString(result, 1);
3449 appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_29));
3450 }
3451 LA15_: ;
3452 result = resizeString(result, (prefixes[(matchedIndex)- 0] ? prefixes[(matchedIndex)- 0]->Sup.len : 0) + 0);
3453 appendString(result, prefixes[(matchedIndex)- 0]);
3454 result = resizeString(result, 1);
3455 appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_46));
3456 return result;
3457 }
N_NIMCALL(void,stdlib_strutilsDatInit000)3458 N_LIB_PRIVATE N_NIMCALL(void, stdlib_strutilsDatInit000)(void) {
3459 NTIarrayL48OO56_stringT__17w6ns39bmjfAZ429aQpCFUA_.size = sizeof(tyArray__17w6ns39bmjfAZ429aQpCFUA);
3460 NTIarrayL48OO56_stringT__17w6ns39bmjfAZ429aQpCFUA_.align = NIM_ALIGNOF(tyArray__17w6ns39bmjfAZ429aQpCFUA);
3461 NTIarrayL48OO56_stringT__17w6ns39bmjfAZ429aQpCFUA_.kind = 16;
3462 NTIarrayL48OO56_stringT__17w6ns39bmjfAZ429aQpCFUA_.base = (&NTIstring__77mFvmsOLKik79ci2hXkHEg_);
3463 }
3464
3465