1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 64
3
4 #include "nimbase.h"
5 #include <string.h>
6 #undef LANGUAGE_C
7 #undef MIPSEB
8 #undef MIPSEL
9 #undef PPC
10 #undef R3000
11 #undef R4000
12 #undef i386
13 #undef linux
14 #undef mips
15 #undef near
16 #undef far
17 #undef powerpc
18 #undef unix
19 #define nimfr_(x, y)
20 #define nimln_(x, y)
21 typedef struct NimStringDesc NimStringDesc;
22 typedef struct TGenericSeq TGenericSeq;
23 typedef struct tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw;
24 typedef struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw;
25 typedef struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q;
26 typedef struct tyObject_TType__facALICuu8zUj0hjvbTLFg tyObject_TType__facALICuu8zUj0hjvbTLFg;
27 typedef struct tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ;
28 typedef struct tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA;
29 typedef struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ;
30 typedef struct tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg;
31 typedef struct tySequence__shxop0zPIs5Ec3k71aCLuQ tySequence__shxop0zPIs5Ec3k71aCLuQ;
32 typedef struct TNimType TNimType;
33 typedef struct TNimNode TNimNode;
34 typedef struct tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ;
35 struct TGenericSeq {
36 NI len;
37 NI reserved;
38 };
39 struct NimStringDesc {
40 TGenericSeq Sup;
41 NIM_CHAR data[SEQ_DECL_SIZE];
42 };
43 struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q {
44 NU16 line;
45 NI16 col;
46 NI32 fileIndex;
47 };
48 typedef NU32 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg;
49 typedef NU8 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw;
50 struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw {
51 tyObject_TType__facALICuu8zUj0hjvbTLFg* typ;
52 tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info;
53 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg flags;
54 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind;
55 union{
56 struct {NI64 intVal;
57 } _kind_1;
58 struct {NF floatVal;
59 } _kind_2;
60 struct {NimStringDesc* strVal;
61 } _kind_3;
62 struct {tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* sym;
63 } _kind_4;
64 struct {tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA* ident;
65 } _kind_5;
66 struct {tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ* sons;
67 } _kind_6;
68 };
69 };
70 struct tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg {
71 tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf;
72 NI lineFirst;
73 tySequence__shxop0zPIs5Ec3k71aCLuQ* lines;
74 };
75 typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
76 typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
77 typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
78 typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
79 struct TNimType {
80 NI size;
81 NI align;
82 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
83 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
84 TNimType* base;
85 TNimNode* node;
86 void* finalizer;
87 tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
88 tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
89 };
90 typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
91 struct TNimNode {
92 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
93 NI offset;
94 TNimType* typ;
95 NCSTRING name;
96 NI len;
97 TNimNode** sons;
98 };
99 struct tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ {
100 NI16 a;
101 NI b;
102 };
103 struct tySequence__shxop0zPIs5Ec3k71aCLuQ {
104 TGenericSeq Sup;
105 NIM_BOOL data[SEQ_DECL_SIZE];
106 };
107 struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ {
108 TGenericSeq Sup;
109 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* data[SEQ_DECL_SIZE];
110 };
111 N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, lastSon__ast_4832)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
112 N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, lastNodeRec__renderverbatim_6)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
113 static N_INLINE(NI, safeLen__ast_3191)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
114 static N_INLINE(NI, len__ast_3198)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
115 N_LIB_PRIVATE N_NIMCALL(NI, numLines__msgs_1090)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, NI32 fileIdx);
116 static N_INLINE(void, nimZeroMem)(void* p, NI size);
117 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
118 N_LIB_PRIVATE N_NIMCALL(void, visitMultilineStrings__renderverbatim_50)(tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg* ldata, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
119 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, tripleStrLitStartsAtNextLine__renderverbatim_27)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
120 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, sourceLine__msgs_1101)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q i);
121 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuContinuesWith)(NimStringDesc* s, NimStringDesc* substr, NI start);
122 N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_56)(NimStringDesc* msg);
123 N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, setLengthSeqV2)(TGenericSeq* s, TNimType* typ, NI newLen);
124 N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
125 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, startOfLineInsideTriple__renderverbatim_89)(tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg ldata, NI line);
126 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isInIndentationBlock__renderverbatim_14)(NimStringDesc* src, NI indent);
127 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
128 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
129 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
130 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
131 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
132 static N_INLINE(NimStringDesc*, X5BX5D___renderverbatim_164)(NimStringDesc* s, tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ x);
133 N_NIMCALL(NimStringDesc*, mnewString)(NI len);
134 static N_INLINE(tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ, dotdot___renderverbatim_137)(NI16 a, NI b);
135 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
136 STRING_LITERAL(TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_2, "\"\"\"", 3);
137 STRING_LITERAL(TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_3, "renderverbatim.nim(42, 12) `src.continuesWith(tripleQuote, col)` ", 65);
138 STRING_LITERAL(TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_4, "renderverbatim.nim(47, 16) `src.len == i` ", 42);
139 extern TNimType NTIseqLboolT__shxop0zPIs5Ec3k71aCLuQ_;
140 STRING_LITERAL(TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_5, "\012", 1);
N_INLINE(NI,len__ast_3198)141 static N_INLINE(NI, len__ast_3198)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
142 NI result;
143 NI T1_;
144 result = (NI)0;
145 T1_ = ((*n)._kind_6.sons ? (*n)._kind_6.sons->Sup.len : 0);
146 result = T1_;
147 return result;
148 }
N_INLINE(NI,safeLen__ast_3191)149 static N_INLINE(NI, safeLen__ast_3191)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
150 NI result;
151 result = (NI)0;
152 {
153 if (!((*n).kind >= ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 0) && (*n).kind <= ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 23))) goto LA3_;
154 result = ((NI) 0);
155 }
156 goto LA1_;
157 LA3_: ;
158 {
159 result = len__ast_3198(n);
160 }
161 LA1_: ;
162 return result;
163 }
N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw *,lastNodeRec__renderverbatim_6)164 N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, lastNodeRec__renderverbatim_6)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
165 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
166 result = NIM_NIL;
167 result = n;
168 {
169 while (1) {
170 NI T3_;
171 NI T4_;
172 T3_ = (NI)0;
173 T3_ = safeLen__ast_3191(result);
174 if (!(((NI) 0) < T3_)) goto LA2;
175 T4_ = (NI)0;
176 T4_ = len__ast_3198(result);
177 result = (*result)._kind_6.sons->data[(NI)(T4_ - ((NI) 1))];
178 } LA2: ;
179 }
180 return result;
181 }
N_INLINE(void,nimSetMem__systemZmemory_7)182 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
183 void* T1_;
184 T1_ = (void*)0;
185 T1_ = memset(a, v, ((size_t) (size)));
186 }
N_INLINE(void,nimZeroMem)187 static N_INLINE(void, nimZeroMem)(void* p, NI size) {
188 nimSetMem__systemZmemory_7(p, ((int) 0), size);
189 }
N_NIMCALL(NIM_BOOL,tripleStrLitStartsAtNextLine__renderverbatim_27)190 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, tripleStrLitStartsAtNextLine__renderverbatim_27)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
191 NIM_BOOL result;
192 NimStringDesc* src;
193 NI16 col;
194 NI16 i;
195 NIM_BOOL onlySpace;
196 { result = (NIM_BOOL)0;
197 src = sourceLine__msgs_1101(conf, (*n).info);
198 col = (*n).info.col;
199 {
200 NIM_BOOL T3_;
201 T3_ = (NIM_BOOL)0;
202 T3_ = nsuContinuesWith(src, ((NimStringDesc*) &TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_2), ((NI) (col)));
203 if (!!(T3_)) goto LA4_;
204 failedAssertImpl__systemZassertions_56(((NimStringDesc*) &TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_3));
205 }
206 LA4_: ;
207 i = (NI16)(col + ((NI16) 3));
208 onlySpace = NIM_TRUE;
209 {
210 while (1) {
211 {
212 if (!((src ? src->Sup.len : 0) <= ((NI) (i)))) goto LA10_;
213 {
214 if (!!(((src ? src->Sup.len : 0) == ((NI) (i))))) goto LA14_;
215 failedAssertImpl__systemZassertions_56(((NimStringDesc*) &TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_4));
216 }
217 LA14_: ;
218 result = onlySpace;
219 goto BeforeRet_;
220 }
221 goto LA8_;
222 LA10_: ;
223 {
224 NIM_BOOL T17_;
225 NIM_BOOL T19_;
226 T17_ = (NIM_BOOL)0;
227 T17_ = nsuContinuesWith(src, ((NimStringDesc*) &TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_2), ((NI) (i)));
228 if (!(T17_)) goto LA18_;
229 T19_ = (NIM_BOOL)0;
230 T19_ = ((src ? src->Sup.len : 0) == ((NI) ((NI16)(i + ((NI16) 3)))));
231 if (T19_) goto LA20_;
232 T19_ = !(((NU8)(src->data[(NI16)(i + ((NI16) 3))]) == (NU8)(34)));
233 LA20_: ;
234 T17_ = T19_;
235 LA18_: ;
236 if (!T17_) goto LA21_;
237 result = NIM_FALSE;
238 goto BeforeRet_;
239 }
240 goto LA8_;
241 LA21_: ;
242 {
243 if (!!(((NU8)(src->data[i]) == (NU8)(32)))) goto LA24_;
244 onlySpace = NIM_FALSE;
245 }
246 goto LA8_;
247 LA24_: ;
248 LA8_: ;
249 i += ((NI) 1);
250 }
251 }
252 }BeforeRet_: ;
253 return result;
254 }
N_NIMCALL(void,visitMultilineStrings__renderverbatim_50)255 N_LIB_PRIVATE N_NIMCALL(void, visitMultilineStrings__renderverbatim_50)(tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg* ldata, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
256 NI cline;
257 cline = (*ldata).lineFirst;
258 switch ((*n).kind) {
259 case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 22):
260 {
261 cline = ((NI) ((*n).info.line));
262 {
263 NIM_BOOL T4_;
264 NI indexX60gensym11_;
265 T4_ = (NIM_BOOL)0;
266 T4_ = tripleStrLitStartsAtNextLine__renderverbatim_27((*ldata).conf, n);
267 if (!T4_) goto LA5_;
268 cline += ((NI) 1);
269 indexX60gensym11_ = (NI)(cline - (*ldata).lineFirst);
270 {
271 NI T9_;
272 T9_ = ((*ldata).lines ? (*ldata).lines->Sup.len : 0);
273 if (!(T9_ < (NI)(indexX60gensym11_ + ((NI) 1)))) goto LA10_;
274 unsureAsgnRef((void**) (&(*ldata).lines), (tySequence__shxop0zPIs5Ec3k71aCLuQ*) setLengthSeqV2(&((*ldata).lines)->Sup, (&NTIseqLboolT__shxop0zPIs5Ec3k71aCLuQ_), ((NI) ((NI)(indexX60gensym11_ + ((NI) 1))))));
275 }
276 LA10_: ;
277 (*ldata).lines->data[indexX60gensym11_] = NIM_TRUE;
278 }
279 LA5_: ;
280 {
281 NIM_CHAR ai;
282 NimStringDesc* colontmp_;
283 NI i;
284 NI L;
285 ai = (NIM_CHAR)0;
286 colontmp_ = NIM_NIL;
287 colontmp_ = (*n)._kind_3.strVal;
288 i = ((NI) 0);
289 L = (colontmp_ ? colontmp_->Sup.len : 0);
290 {
291 while (1) {
292 if (!(i < L)) goto LA14;
293 ai = colontmp_->data[i];
294 switch (((NU8)(ai))) {
295 case 10:
296 {
297 NI indexX60gensym12_;
298 cline += ((NI) 1);
299 indexX60gensym12_ = (NI)(cline - (*ldata).lineFirst);
300 {
301 NI T18_;
302 T18_ = ((*ldata).lines ? (*ldata).lines->Sup.len : 0);
303 if (!(T18_ < (NI)(indexX60gensym12_ + ((NI) 1)))) goto LA19_;
304 unsureAsgnRef((void**) (&(*ldata).lines), (tySequence__shxop0zPIs5Ec3k71aCLuQ*) setLengthSeqV2(&((*ldata).lines)->Sup, (&NTIseqLboolT__shxop0zPIs5Ec3k71aCLuQ_), ((NI) ((NI)(indexX60gensym12_ + ((NI) 1))))));
305 }
306 LA19_: ;
307 (*ldata).lines->data[indexX60gensym12_] = NIM_TRUE;
308 }
309 break;
310 default:
311 {
312 }
313 break;
314 }
315 i += ((NI) 1);
316 } LA14: ;
317 }
318 }
319 }
320 break;
321 default:
322 {
323 {
324 NI i_2;
325 NI colontmp__2;
326 NI i_3;
327 i_2 = (NI)0;
328 colontmp__2 = (NI)0;
329 colontmp__2 = safeLen__ast_3191(n);
330 i_3 = ((NI) 0);
331 {
332 while (1) {
333 if (!(i_3 < colontmp__2)) goto LA25;
334 i_2 = i_3;
335 visitMultilineStrings__renderverbatim_50(ldata, (*n)._kind_6.sons->data[i_2]);
336 i_3 += ((NI) 1);
337 } LA25: ;
338 }
339 }
340 }
341 break;
342 }
343 }
N_NIMCALL(NIM_BOOL,startOfLineInsideTriple__renderverbatim_89)344 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, startOfLineInsideTriple__renderverbatim_89)(tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg ldata, NI line) {
345 NIM_BOOL result;
346 NI index;
347 result = (NIM_BOOL)0;
348 index = (NI)(line - ldata.lineFirst);
349 {
350 NI T3_;
351 T3_ = (ldata.lines ? ldata.lines->Sup.len : 0);
352 if (!(T3_ <= index)) goto LA4_;
353 result = NIM_FALSE;
354 }
355 goto LA1_;
356 LA4_: ;
357 {
358 result = ldata.lines->data[index];
359 }
360 LA1_: ;
361 return result;
362 }
N_NIMCALL(NIM_BOOL,isInIndentationBlock__renderverbatim_14)363 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isInIndentationBlock__renderverbatim_14)(NimStringDesc* src, NI indent) {
364 NIM_BOOL result;
365 { result = (NIM_BOOL)0;
366 {
367 NI j;
368 NI i;
369 j = (NI)0;
370 i = ((NI) 0);
371 {
372 while (1) {
373 if (!(i < indent)) goto LA3;
374 j = i;
375 {
376 if (!((src ? src->Sup.len : 0) <= j)) goto LA6_;
377 result = NIM_TRUE;
378 goto BeforeRet_;
379 }
380 LA6_: ;
381 {
382 if (!!(((NU8)(src->data[j]) == (NU8)(32)))) goto LA10_;
383 result = NIM_FALSE;
384 goto BeforeRet_;
385 }
386 LA10_: ;
387 i += ((NI) 1);
388 } LA3: ;
389 }
390 }
391 result = NIM_TRUE;
392 goto BeforeRet_;
393 }BeforeRet_: ;
394 return result;
395 }
N_INLINE(void,nimCopyMem)396 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
397 void* T1_;
398 T1_ = (void*)0;
399 T1_ = memcpy(dest, source, ((size_t) (size)));
400 }
N_INLINE(void,copyMem__system_1727)401 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
402 nimCopyMem(dest, source, size);
403 }
N_INLINE(void,appendString)404 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
405 {
406 if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
407 copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
408 (*dest).Sup.len += (*src).Sup.len;
409 }
410 LA3_: ;
411 }
N_INLINE(NimStringDesc *,X5BX5D___renderverbatim_164)412 static N_INLINE(NimStringDesc*, X5BX5D___renderverbatim_164)(NimStringDesc* s, tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ x) {
413 NimStringDesc* result;
414 NI a;
415 NI L;
416 result = NIM_NIL;
417 a = ((NI) (x.a));
418 L = (NI)((NI)((NI)((s ? s->Sup.len : 0) - x.b) - a) + ((NI) 1));
419 result = mnewString(((NI) (L)));
420 {
421 NI i;
422 NI i_2;
423 i = (NI)0;
424 i_2 = ((NI) 0);
425 {
426 while (1) {
427 if (!(i_2 < L)) goto LA3;
428 i = i_2;
429 result->data[i] = s->data[(NI)(i + a)];
430 i_2 += ((NI) 1);
431 } LA3: ;
432 }
433 }
434 return result;
435 }
N_INLINE(tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ,dotdot___renderverbatim_137)436 static N_INLINE(tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ, dotdot___renderverbatim_137)(NI16 a, NI b) {
437 tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ result;
438 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ));
439 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ));
440 result.a = a;
441 result.b = b;
442 return result;
443 }
N_NIMCALL(NimStringDesc *,extractRunnableExamplesSource__renderverbatim_97)444 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, extractRunnableExamplesSource__renderverbatim_97)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n, NI indent) {
445 NimStringDesc* result;
446 tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q first;
447 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T1_;
448 tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q last;
449 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T7_;
450 tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info;
451 NI16 indent2;
452 NU16 numLines;
453 NI T8_;
454 NI lastNonemptyPos;
455 tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg ldata;
456 NI T9_;
457 result = NIM_NIL;
458 T1_ = NIM_NIL;
459 T1_ = lastSon__ast_4832(n);
460 first = (*T1_).info;
461 {
462 if (!(first.line == (*(*n)._kind_6.sons->data[((NI) 0)]).info.line)) goto LA4_;
463 }
464 goto LA2_;
465 LA4_: ;
466 {
467 first.line = (NU16)((NU16)((*(*n)._kind_6.sons->data[((NI) 0)]).info.line) + (NU16)(((NU16) 1)));
468 }
469 LA2_: ;
470 T7_ = NIM_NIL;
471 T7_ = lastNodeRec__renderverbatim_6(n);
472 last = (*T7_).info;
473 info = first;
474 indent2 = info.col;
475 T8_ = (NI)0;
476 T8_ = numLines__msgs_1090(conf, info.fileIndex);
477 numLines = ((NU16) (T8_));
478 lastNonemptyPos = ((NI) 0);
479 nimZeroMem((void*)(&ldata), sizeof(tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg));
480 nimZeroMem((void*)(&ldata), sizeof(tyObject_LineData__W79a9bpfDJtmOKaRHvpAcCMg));
481 ldata.lineFirst = ((NI) (first.line));
482 ldata.conf = conf;
483 T9_ = (NI)0;
484 T9_ = len__ast_3198(n);
485 visitMultilineStrings__renderverbatim_50((&ldata), (*n)._kind_6.sons->data[(NI)(T9_ - ((NI) 1))]);
486 result = ((NimStringDesc*) NIM_NIL);
487 {
488 NU16 line;
489 NI res;
490 line = (NU16)0;
491 res = ((NI) (first.line));
492 {
493 while (1) {
494 NimStringDesc* src;
495 NIM_BOOL special;
496 if (!(res <= ((NI) (numLines)))) goto LA12;
497 line = ((NU16) (res));
498 info.line = line;
499 src = sourceLine__msgs_1101(conf, info);
500 special = startOfLineInsideTriple__renderverbatim_89(ldata, ((NI) (line)));
501 {
502 NIM_BOOL T15_;
503 NIM_BOOL T16_;
504 NIM_BOOL T19_;
505 T15_ = (NIM_BOOL)0;
506 T16_ = (NIM_BOOL)0;
507 T16_ = ((NU16)(last.line) < (NU16)(line));
508 if (!(T16_)) goto LA17_;
509 T16_ = !(special);
510 LA17_: ;
511 T15_ = T16_;
512 if (!(T15_)) goto LA18_;
513 T19_ = (NIM_BOOL)0;
514 T19_ = isInIndentationBlock__renderverbatim_14(src, ((NI) (indent2)));
515 T15_ = !(T19_);
516 LA18_: ;
517 if (!T15_) goto LA20_;
518 goto LA10;
519 }
520 LA20_: ;
521 {
522 if (!((NU16)(first.line) < (NU16)(line))) goto LA24_;
523 result = resizeString(result, 1);
524 appendString(result, ((NimStringDesc*) &TM__9bwZ0lZ4vtVZHDwmqgGHGOQ_5));
525 }
526 LA24_: ;
527 {
528 if (!special) goto LA28_;
529 result = resizeString(result, (src ? src->Sup.len : 0) + 0);
530 appendString(result, src);
531 lastNonemptyPos = (result ? result->Sup.len : 0);
532 }
533 goto LA26_;
534 LA28_: ;
535 {
536 tyObject_HSlice__tWbbzDT29cxDfMvWataNEeQ T36_;
537 NimStringDesc* T37_;
538 if (!(((NI) (indent2)) < (src ? src->Sup.len : 0))) goto LA31_;
539 {
540 NI i;
541 NI i_2;
542 i = (NI)0;
543 i_2 = ((NI) 0);
544 {
545 while (1) {
546 if (!(i_2 < indent)) goto LA35;
547 i = i_2;
548 result = addChar(result, 32);
549 i_2 += ((NI) 1);
550 } LA35: ;
551 }
552 }
553 T36_ = dotdot___renderverbatim_137(indent2, ((NI) 1));
554 T37_ = NIM_NIL;
555 T37_ = X5BX5D___renderverbatim_164(src, T36_);
556 result = resizeString(result, (T37_ ? T37_->Sup.len : 0) + 0);
557 appendString(result, T37_);
558 lastNonemptyPos = (result ? result->Sup.len : 0);
559 }
560 goto LA26_;
561 LA31_: ;
562 LA26_: ;
563 res += ((NI) 1);
564 } LA12: ;
565 }
566 } LA10: ;
567 result = setLengthStr(result, ((NI) (lastNonemptyPos)));
568 return result;
569 }
570