mirror of
https://github.com/status-im/csources-nimble.git
synced 2026-08-30 17:51:13 +00:00
3399 lines
140 KiB
C
3399 lines
140 KiB
C
/* Generated by Nim Compiler v1.7.1 */
|
|
#define NIM_INTBITS 64
|
|
|
|
#include "nimbase.h"
|
|
#include <string.h>
|
|
#include <windows.h>
|
|
#undef LANGUAGE_C
|
|
#undef MIPSEB
|
|
#undef MIPSEL
|
|
#undef PPC
|
|
#undef R3000
|
|
#undef R4000
|
|
#undef i386
|
|
#undef linux
|
|
#undef mips
|
|
#undef near
|
|
#undef far
|
|
#undef powerpc
|
|
#undef unix
|
|
# define nimfr_(proc, file) \
|
|
TFrame FR_; \
|
|
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
|
|
|
|
# define nimfrs_(proc, file, slots, length) \
|
|
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
|
|
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
|
|
|
|
# define nimln_(n, file) \
|
|
FR_.line = n; FR_.filename = file;
|
|
typedef struct NimStringDesc NimStringDesc;
|
|
typedef struct TGenericSeq TGenericSeq;
|
|
typedef struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
|
|
typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
|
|
typedef struct Exception Exception;
|
|
typedef struct RootObj RootObj;
|
|
typedef struct TNimType TNimType;
|
|
typedef struct TNimNode TNimNode;
|
|
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
|
|
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
|
|
typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
|
|
typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
|
|
typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
|
|
typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
|
|
typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
|
|
typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
|
|
typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
|
|
typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
|
|
typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
|
|
typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
|
|
typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
|
|
typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
|
|
typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
|
|
typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
|
|
typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
|
|
typedef struct tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw;
|
|
typedef struct tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg;
|
|
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
|
|
typedef struct tyTuple__gn6QUEIsAwPk7TaTcZe9bEw tyTuple__gn6QUEIsAwPk7TaTcZe9bEw;
|
|
typedef struct tyObject_Version__9bU0a4Oqtl9aJmGyzYi8ZnBA tyObject_Version__9bU0a4Oqtl9aJmGyzYi8ZnBA;
|
|
typedef struct tyObject_Sha1Hash__zQwLVDNef3gJr9bhL9bRloJw tyObject_Sha1Hash__zQwLVDNef3gJr9bhL9bRloJw;
|
|
typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
|
|
struct TGenericSeq {
|
|
NI len;
|
|
NI reserved;
|
|
};
|
|
struct NimStringDesc {
|
|
TGenericSeq Sup;
|
|
NIM_CHAR data[SEQ_DECL_SIZE];
|
|
};
|
|
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
|
|
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
|
|
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
|
|
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
|
|
struct TNimType {
|
|
NI size;
|
|
NI align;
|
|
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
|
|
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
|
|
TNimType* base;
|
|
TNimNode* node;
|
|
void* finalizer;
|
|
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
|
|
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
|
|
};
|
|
struct RootObj {
|
|
TNimType* m_type;
|
|
};
|
|
struct Exception {
|
|
RootObj Sup;
|
|
Exception* parent;
|
|
NCSTRING name;
|
|
NimStringDesc* message;
|
|
tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
|
|
Exception* up;
|
|
};
|
|
struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
|
|
Exception Sup;
|
|
};
|
|
struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
|
|
tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
|
|
};
|
|
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
|
|
struct TNimNode {
|
|
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
|
|
NI offset;
|
|
TNimType* typ;
|
|
NCSTRING name;
|
|
NI len;
|
|
TNimNode** sons;
|
|
};
|
|
struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
|
|
NI refcount;
|
|
TNimType* typ;
|
|
};
|
|
struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
|
|
void* bottom;
|
|
};
|
|
struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
|
|
NI len;
|
|
NI cap;
|
|
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
|
|
};
|
|
typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
|
|
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
|
|
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
|
|
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
|
|
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
|
|
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
|
|
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
|
|
};
|
|
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
|
|
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
|
|
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
|
|
NI key;
|
|
NI upperBound;
|
|
NI level;
|
|
};
|
|
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
|
|
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
|
|
NI Field1;
|
|
};
|
|
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
|
|
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
|
|
NI len;
|
|
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
|
|
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
|
|
};
|
|
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
|
|
NI minLargeObj;
|
|
NI maxLargeObj;
|
|
tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
|
|
NU32 flBitmap;
|
|
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
|
|
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
|
|
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
|
|
NI currMem;
|
|
NI maxMem;
|
|
NI freeMem;
|
|
NI occ;
|
|
NI lastSize;
|
|
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
|
|
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
|
|
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
|
|
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
|
|
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
|
|
NIM_BOOL locked;
|
|
NIM_BOOL blockChunkSizeIncrease;
|
|
NI nextChunkSize;
|
|
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
|
|
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
|
|
};
|
|
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
|
|
NI stackScans;
|
|
NI cycleCollections;
|
|
NI maxThreshold;
|
|
NI maxStackSize;
|
|
NI maxStackCells;
|
|
NI cycleTableSize;
|
|
NI64 maxPause;
|
|
};
|
|
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
|
|
NI counter;
|
|
NI max;
|
|
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
|
|
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
|
|
};
|
|
struct tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw {
|
|
tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg* head;
|
|
tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg* tail;
|
|
CRITICAL_SECTION lock;
|
|
};
|
|
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
|
|
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
|
|
NI cycleThreshold;
|
|
NI zctThreshold;
|
|
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
|
|
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
|
|
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
|
|
NI recGcLock;
|
|
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
|
|
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
|
|
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
|
|
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
|
|
tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw toDispose;
|
|
NI gcThreadId;
|
|
};
|
|
typedef NimStringDesc* tyArray__nHXaesL0DJZHyVS07ARPRA[1];
|
|
typedef NI tyArray__9cc9aPiDa8VaWjVcFLabEDZQ[256];
|
|
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
|
|
typedef NU8 tyEnum_DownloadMethod__IqkMKe5PGkzDG0ayIWPJ6w;
|
|
struct tyObject_Version__9bU0a4Oqtl9aJmGyzYi8ZnBA {
|
|
NimStringDesc* version;
|
|
};
|
|
struct tyObject_Sha1Hash__zQwLVDNef3gJr9bhL9bRloJw {
|
|
NimStringDesc* hashValue;
|
|
};
|
|
struct tyTuple__gn6QUEIsAwPk7TaTcZe9bEw {
|
|
tyObject_Version__9bU0a4Oqtl9aJmGyzYi8ZnBA Field0;
|
|
tyObject_Sha1Hash__zQwLVDNef3gJr9bhL9bRloJw Field1;
|
|
};
|
|
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
|
|
NCSTRING procname;
|
|
NI line;
|
|
NCSTRING filename;
|
|
};
|
|
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
|
|
TGenericSeq Sup;
|
|
NimStringDesc* data[SEQ_DECL_SIZE];
|
|
};
|
|
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
|
|
TGenericSeq Sup;
|
|
tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
|
|
};
|
|
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
|
|
N_LIB_PRIVATE N_NOINLINE(void, invalidFormatString__pureZstrutils_2228)(NimStringDesc* formatstr);
|
|
N_LIB_PRIVATE N_NOINLINE(void*, newObj)(TNimType* typ, NI size);
|
|
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
|
|
static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
|
|
static N_INLINE(void, asgnRef)(void** dest, void* src);
|
|
static N_INLINE(void, incRef__system_5879)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
|
|
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
|
|
static N_INLINE(void, nimFrame)(TFrame* s);
|
|
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_3455)(void);
|
|
static N_INLINE(void, popFrame)(void);
|
|
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5841)(void* usr);
|
|
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
|
|
static N_INLINE(void, decRef__system_5886)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
|
|
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
|
|
static N_INLINE(void, rtlAddZCT__system_5884)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
|
|
N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5835)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
|
|
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
|
|
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, findNormalized__pureZstrutils_2216)(NimStringDesc* x, NimStringDesc** inArray, NI inArrayLen_0);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
|
|
static N_INLINE(NIM_CHAR, toLowerAscii__stdZprivateZstrimpl_1)(NIM_CHAR c);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_8704)(NimStringDesc* s, NI first, NI last);
|
|
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
|
|
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c);
|
|
N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
|
|
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, npuParseInt)(NimStringDesc* s, NI* number, NI start);
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size);
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
|
|
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
|
|
static N_INLINE(NIM_BOOL, equalMem__system_1735)(void* a, void* b, NI size);
|
|
static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, hashString)(NimStringDesc* s);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStrA)(tyArray__9cc9aPiDa8VaWjVcFLabEDZQ a, NimStringDesc* s, NimStringDesc* sub, NI start, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nsuInitNewSkipTable)(NimStringDesc* sub, tyArray__9cc9aPiDa8VaWjVcFLabEDZQ Result);
|
|
N_LIB_PRIVATE N_NIMCALL(void, nsuInitSkipTable)(NI* a, NimStringDesc* sub);
|
|
N_LIB_PRIVATE N_NIMCALL(void, fill__pureZstrutils_1487)(NI* a, NI aLen_0, NI value);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindCharSet)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars, NI start, NI last);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, npuParseBiggestInt)(NimStringDesc* s, NI64* number, NI start);
|
|
N_LIB_PRIVATE N_NIMCALL(NI, npuParseFloat)(NimStringDesc* s, NF* number, NI start);
|
|
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_56)(NimStringDesc* msg);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nimIdentNormalize__pureZstrutils_121)(NimStringDesc* s);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___systemZdollars_8)(NI x);
|
|
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_8716)(NimStringDesc* s, NI first);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHexImpl__pureZstrutils_733)(NU64 x, NI len, NIM_BOOL handleNegative);
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, substrEq__pureZstrutils_245)(NimStringDesc* s, NI pos, NimStringDesc* substr);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___nimble_15297)(tyTuple__gn6QUEIsAwPk7TaTcZe9bEw x);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__pureZstrutils_1878)(NI x, NI len);
|
|
extern TNimType NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_;
|
|
extern TNimType NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_;
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_5, "invalid format string: ", 23);
|
|
extern TNimType NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_;
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_52, "invalid integer: ", 17);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_59, "y", 1);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_60, "yes", 3);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_61, "true", 4);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_62, "1", 1);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_63, "on", 2);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_64, "n", 1);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_65, "no", 2);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_66, "false", 5);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_67, "0", 1);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_68, "off", 3);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_69, "cannot interpret as a bool: ", 28);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_85, "invalid float: ", 15);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_96, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim(261, 11) `len(a) == L` the length of the string changed while iterating over it", 134);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_102, "git", 3);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_103, "hg", 2);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_104, "Invalid enum value: ", 20);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_125, "0123456789ABCDEF", 16);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_135, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim(760, 11) `sep.len > 0` ", 75);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_145, "\\x", 2);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_146, "\\\\", 2);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_147, "\\\'", 2);
|
|
STRING_LITERAL(TM__JGc9b9bh2D3nTdUR7TGyq8aA_148, "\\\"", 2);
|
|
extern NIM_THREADVAR TFrame* framePtr__system_3022;
|
|
extern NIM_THREADVAR TFrame* framePtr__system_3022;
|
|
extern NIM_THREADVAR TFrame* framePtr__system_3022;
|
|
extern NIM_THREADVAR TFrame* framePtr__system_3022;
|
|
extern NIM_THREADVAR TFrame* framePtr__system_3022;
|
|
extern NIM_THREADVAR TFrame* framePtr__system_3022;
|
|
extern NIM_THREADVAR tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5774;
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
|
|
void* T1_;
|
|
T1_ = (void*)0;
|
|
T1_ = memcpy(dest, source, ((size_t) (size)));
|
|
}
|
|
static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
|
|
nimCopyMem(dest, source, size);
|
|
}
|
|
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
|
|
{
|
|
if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
|
|
copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
|
|
(*dest).Sup.len += (*src).Sup.len;
|
|
}
|
|
LA3_: ;
|
|
}
|
|
static N_INLINE(void, nimFrame)(TFrame* s) {
|
|
{
|
|
if (!(framePtr__system_3022 == ((TFrame*) NIM_NIL))) goto LA3_;
|
|
(*s).calldepth = ((NI16) 0);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
(*s).calldepth = (NI16)((*framePtr__system_3022).calldepth + ((NI16) 1));
|
|
}
|
|
LA1_: ;
|
|
(*s).prev = framePtr__system_3022;
|
|
framePtr__system_3022 = s;
|
|
{
|
|
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
|
|
callDepthLimitReached__system_3455();
|
|
}
|
|
LA8_: ;
|
|
}
|
|
static N_INLINE(void, popFrame)(void) {
|
|
framePtr__system_3022 = (*framePtr__system_3022).prev;
|
|
}
|
|
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
|
|
NI result;
|
|
nimfr_("+%", "/home/yyoncho/Sources/nim/Nim/lib/system/arithmetics.nim");
|
|
result = (NI)0;
|
|
nimln_(403, "/home/yyoncho/Sources/nim/Nim/lib/system/arithmetics.nim");
|
|
nimln_(407, "/home/yyoncho/Sources/nim/Nim/lib/system/arithmetics.nim");
|
|
result = ((NI) ((NU)((NU64)(((NU) (x))) + (NU64)(((NU) (y))))));
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(void, incRef__system_5879)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
|
|
nimfr_("incRef", "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
nimln_(231, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
(*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
|
|
popFrame();
|
|
}
|
|
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y) {
|
|
NI result;
|
|
nimfr_("-%", "/home/yyoncho/Sources/nim/Nim/lib/system/arithmetics.nim");
|
|
result = (NI)0;
|
|
nimln_(414, "/home/yyoncho/Sources/nim/Nim/lib/system/arithmetics.nim");
|
|
nimln_(418, "/home/yyoncho/Sources/nim/Nim/lib/system/arithmetics.nim");
|
|
result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5841)(void* usr) {
|
|
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
|
|
NI T1_;
|
|
nimfr_("usrToCell", "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
|
|
nimln_(177, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
T1_ = (NI)0;
|
|
T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 16));
|
|
result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
|
|
NIM_BOOL result;
|
|
nimfr_("<%", "/home/yyoncho/Sources/nim/Nim/lib/system/comparisons.nim");
|
|
result = (NIM_BOOL)0;
|
|
nimln_(186, "/home/yyoncho/Sources/nim/Nim/lib/system/comparisons.nim");
|
|
nimln_(188, "/home/yyoncho/Sources/nim/Nim/lib/system/comparisons.nim");
|
|
result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(void, rtlAddZCT__system_5884)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
|
|
nimfr_("rtlAddZCT", "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
nimln_(243, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
addZCT__system_5835((&gch__system_5774.zct), c);
|
|
popFrame();
|
|
}
|
|
static N_INLINE(void, decRef__system_5886)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
|
|
nimfr_("decRef", "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
nimln_(248, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
(*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
|
|
nimln_(249, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
|
|
if (!T3_) goto LA4_;
|
|
nimln_(250, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
rtlAddZCT__system_5884(c);
|
|
}
|
|
LA4_: ;
|
|
popFrame();
|
|
}
|
|
static N_INLINE(void, asgnRef)(void** dest, void* src) {
|
|
nimfr_("asgnRef", "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
nimln_(286, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
{
|
|
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
|
|
if (!!((src == NIM_NIL))) goto LA3_;
|
|
T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
|
|
T5_ = usrToCell__system_5841(src);
|
|
incRef__system_5879(T5_);
|
|
}
|
|
LA3_: ;
|
|
nimln_(287, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
{
|
|
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
|
|
if (!!(((*dest) == NIM_NIL))) goto LA8_;
|
|
T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
|
|
T10_ = usrToCell__system_5841((*dest));
|
|
decRef__system_5886(T10_);
|
|
}
|
|
LA8_: ;
|
|
nimln_(288, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
(*dest) = src;
|
|
popFrame();
|
|
}
|
|
N_LIB_PRIVATE N_NOINLINE(void, invalidFormatString__pureZstrutils_2228)(NimStringDesc* formatstr) {
|
|
tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T1_;
|
|
NimStringDesc* T2_;
|
|
nimfr_("invalidFormatString", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T1_ = NIM_NIL;
|
|
T1_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
|
|
(*T1_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
|
|
(*T1_).Sup.Sup.name = "ValueError";
|
|
nimln_(2702, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T2_ = NIM_NIL;
|
|
T2_ = rawNewString((formatstr ? formatstr->Sup.len : 0) + 23);
|
|
appendString(T2_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_5));
|
|
appendString(T2_, formatstr);
|
|
asgnRef((void**) (&(*T1_).Sup.Sup.message), T2_);
|
|
asgnRef((void**) (&(*T1_).Sup.Sup.parent), ((Exception*) NIM_NIL));
|
|
raiseExceptionEx((Exception*)T1_, "ValueError", "invalidFormatString", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim", 2702);
|
|
popFrame();
|
|
}
|
|
static N_INLINE(NIM_CHAR, toLowerAscii__stdZprivateZstrimpl_1)(NIM_CHAR c) {
|
|
NIM_CHAR result;
|
|
nimfr_("toLowerAscii", "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
result = (NIM_CHAR)0;
|
|
nimln_(2, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_25;
|
|
if (!(((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)))) goto LA3_;
|
|
nimln_(3, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (nimAddInt(((NU8)(c)), ((NI) 32), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_25)) { raiseOverflow(); };
|
|
if (((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_25)) < ((NI) 0) || ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_25)) > ((NI) 255)){ raiseRangeErrorI((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_25), ((NI) 0), ((NI) 255)); }
|
|
result = ((NIM_CHAR) (((NI) ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_25)))));
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
nimln_(5, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
result = c;
|
|
}
|
|
LA1_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b) {
|
|
NI result;
|
|
NI aLenX60gensym24_;
|
|
NI bLenX60gensym24_;
|
|
NI iX60gensym24_;
|
|
NI jX60gensym24_;
|
|
nimfr_("cmpIgnoreStyle", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
aLenX60gensym24_ = (a ? a->Sup.len : 0);
|
|
bLenX60gensym24_ = (b ? b->Sup.len : 0);
|
|
iX60gensym24_ = ((NI) 0);
|
|
jX60gensym24_ = ((NI) 0);
|
|
{
|
|
while (1) {
|
|
NIM_CHAR aaX60gensym24_;
|
|
NIM_CHAR bbX60gensym24_;
|
|
{
|
|
while (1) {
|
|
NIM_BOOL T5_;
|
|
T5_ = (NIM_BOOL)0;
|
|
T5_ = (iX60gensym24_ < aLenX60gensym24_);
|
|
if (!(T5_)) goto LA6_;
|
|
T5_ = ((NU8)(a->data[iX60gensym24_]) == (NU8)(95));
|
|
LA6_: ;
|
|
if (!T5_) goto LA4;
|
|
iX60gensym24_ += ((NI) 1);
|
|
} LA4: ;
|
|
}
|
|
{
|
|
while (1) {
|
|
NIM_BOOL T9_;
|
|
T9_ = (NIM_BOOL)0;
|
|
T9_ = (jX60gensym24_ < bLenX60gensym24_);
|
|
if (!(T9_)) goto LA10_;
|
|
T9_ = ((NU8)(b->data[jX60gensym24_]) == (NU8)(95));
|
|
LA10_: ;
|
|
if (!T9_) goto LA8;
|
|
jX60gensym24_ += ((NI) 1);
|
|
} LA8: ;
|
|
}
|
|
{
|
|
if (!(iX60gensym24_ < aLenX60gensym24_)) goto LA13_;
|
|
aaX60gensym24_ = toLowerAscii__stdZprivateZstrimpl_1(a->data[iX60gensym24_]);
|
|
}
|
|
goto LA11_;
|
|
LA13_: ;
|
|
{
|
|
aaX60gensym24_ = 0;
|
|
}
|
|
LA11_: ;
|
|
{
|
|
if (!(jX60gensym24_ < bLenX60gensym24_)) goto LA18_;
|
|
bbX60gensym24_ = toLowerAscii__stdZprivateZstrimpl_1(b->data[jX60gensym24_]);
|
|
}
|
|
goto LA16_;
|
|
LA18_: ;
|
|
{
|
|
bbX60gensym24_ = 0;
|
|
}
|
|
LA16_: ;
|
|
result = (NI)(((NU8)(aaX60gensym24_)) - ((NU8)(bbX60gensym24_)));
|
|
{
|
|
if (!!((result == ((NI) 0)))) goto LA23_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA23_: ;
|
|
{
|
|
if (!(aLenX60gensym24_ <= iX60gensym24_)) goto LA27_;
|
|
{
|
|
if (!(bLenX60gensym24_ <= jX60gensym24_)) goto LA31_;
|
|
result = ((NI) 0);
|
|
goto BeforeRet_;
|
|
}
|
|
LA31_: ;
|
|
result = ((NI) -1);
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA25_;
|
|
LA27_: ;
|
|
{
|
|
if (!(bLenX60gensym24_ <= jX60gensym24_)) goto LA34_;
|
|
result = ((NI) 1);
|
|
goto BeforeRet_;
|
|
}
|
|
goto LA25_;
|
|
LA34_: ;
|
|
LA25_: ;
|
|
iX60gensym24_ += ((NI) 1);
|
|
jX60gensym24_ += ((NI) 1);
|
|
}
|
|
}
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, findNormalized__pureZstrutils_2216)(NimStringDesc* x, NimStringDesc** inArray, NI inArrayLen_0) {
|
|
NI result;
|
|
NI i;
|
|
nimfr_("findNormalized", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(2694, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = ((NI) 0);
|
|
{
|
|
nimln_(2695, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_26;
|
|
if (!(i < (inArrayLen_0-1))) goto LA2;
|
|
nimln_(2696, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI T5_;
|
|
if (i < 0 || i >= inArrayLen_0){ raiseIndexError2(i,inArrayLen_0-1); }
|
|
T5_ = (NI)0;
|
|
T5_ = nsuCmpIgnoreStyle(x, inArray[i]);
|
|
if (!(T5_ == ((NI) 0))) goto LA6_;
|
|
result = i;
|
|
goto BeforeRet_;
|
|
}
|
|
LA6_: ;
|
|
nimln_(2697, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 2), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_26)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_26);
|
|
} LA2: ;
|
|
}
|
|
nimln_(2699, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
|
|
NI i;
|
|
NI num;
|
|
nimfr_("addf", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(2708, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = ((NI) 0);
|
|
nimln_(2709, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
num = ((NI) 0);
|
|
{
|
|
nimln_(2710, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
if (!(i < (formatstr ? formatstr->Sup.len : 0))) goto LA2;
|
|
nimln_(2711, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T5_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_3;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_4;
|
|
T5_ = (NIM_BOOL)0;
|
|
if (i < 0 || i >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(i,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
T5_ = ((NU8)(formatstr->data[i]) == (NU8)(36));
|
|
if (!(T5_)) goto LA6_;
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_3)) { raiseOverflow(); };
|
|
T5_ = ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_3) < (formatstr ? formatstr->Sup.len : 0));
|
|
LA6_: ;
|
|
if (!T5_) goto LA7_;
|
|
nimln_(2712, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_4)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_4) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_4) >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_4),(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
switch (((NU8)(formatstr->data[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_4)]))) {
|
|
case 35:
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_6;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_7;
|
|
nimln_(2714, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!((aLen_0-1) < num)) goto LA12_;
|
|
invalidFormatString__pureZstrutils_2228(formatstr);
|
|
}
|
|
LA12_: ;
|
|
nimln_(2715, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (num < 0 || num >= aLen_0){ raiseIndexError2(num,aLen_0-1); }
|
|
unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[num] ? a[num]->Sup.len : 0) + 0));
|
|
appendString((*s), a[num]);
|
|
nimln_(2716, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 2), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_6)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_6);
|
|
nimln_(2717, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(num, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_7)) { raiseOverflow(); };
|
|
num = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_7);
|
|
}
|
|
break;
|
|
case 36:
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_8;
|
|
nimln_(2719, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
unsureAsgnRef((void**) (&(*s)), addChar((*s), 36));
|
|
nimln_(2720, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 2), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_8)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_8);
|
|
}
|
|
break;
|
|
case 49 ... 57:
|
|
case 45:
|
|
{
|
|
NI j;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_9;
|
|
NIM_BOOL negative;
|
|
NI idx;
|
|
nimln_(2722, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
j = ((NI) 0);
|
|
nimln_(2723, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_9)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_9);
|
|
nimln_(2724, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(i,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
negative = ((NU8)(formatstr->data[i]) == (NU8)(45));
|
|
nimln_(2725, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_10;
|
|
if (!negative) goto LA18_;
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_10)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_10);
|
|
}
|
|
LA18_: ;
|
|
{
|
|
nimln_(2726, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T22_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_11;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_12;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_13;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_14;
|
|
T22_ = (NIM_BOOL)0;
|
|
T22_ = (i < (formatstr ? formatstr->Sup.len : 0));
|
|
if (!(T22_)) goto LA23_;
|
|
if (i < 0 || i >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(i,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
T22_ = (((NU8)(formatstr->data[i])) >= ((NU8)(48)) && ((NU8)(formatstr->data[i])) <= ((NU8)(57)));
|
|
LA23_: ;
|
|
if (!T22_) goto LA21;
|
|
nimln_(2727, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimMulInt(j, ((NI) 10), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_11)) { raiseOverflow(); };
|
|
if (i < 0 || i >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(i,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
if (nimAddInt((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_11), ((NU8)(formatstr->data[i])), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_12)) { raiseOverflow(); };
|
|
if (nimSubInt((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_12), ((NI) 48), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_13)) { raiseOverflow(); };
|
|
j = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_13);
|
|
nimln_(2728, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_14)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_14);
|
|
} LA21: ;
|
|
}
|
|
nimln_(2729, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_15;
|
|
if (!!(negative)) goto LA26_;
|
|
if (nimSubInt(j, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_15)) { raiseOverflow(); };
|
|
idx = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_15);
|
|
}
|
|
goto LA24_;
|
|
LA26_: ;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_16;
|
|
if (nimSubInt(aLen_0, j, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_16)) { raiseOverflow(); };
|
|
idx = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_16);
|
|
}
|
|
LA24_: ;
|
|
nimln_(2730, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T31_;
|
|
T31_ = (NIM_BOOL)0;
|
|
T31_ = (idx < ((NI) 0));
|
|
if (T31_) goto LA32_;
|
|
T31_ = ((aLen_0-1) < idx);
|
|
LA32_: ;
|
|
if (!T31_) goto LA33_;
|
|
invalidFormatString__pureZstrutils_2228(formatstr);
|
|
}
|
|
LA33_: ;
|
|
nimln_(2731, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (idx < 0 || idx >= aLen_0){ raiseIndexError2(idx,aLen_0-1); }
|
|
unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[idx] ? a[idx]->Sup.len : 0) + 0));
|
|
appendString((*s), a[idx]);
|
|
}
|
|
break;
|
|
case 123:
|
|
{
|
|
NI j_2;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_17;
|
|
NI k;
|
|
NIM_BOOL negative_2;
|
|
NI isNumber;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_30;
|
|
nimln_(2733, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 2), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_17)) { raiseOverflow(); };
|
|
j_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_17);
|
|
nimln_(2734, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
k = ((NI) 0);
|
|
nimln_(2735, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (j_2 < 0 || j_2 >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(j_2,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
negative_2 = ((NU8)(formatstr->data[j_2]) == (NU8)(45));
|
|
nimln_(2736, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_18;
|
|
if (!negative_2) goto LA38_;
|
|
if (nimAddInt(j_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_18)) { raiseOverflow(); };
|
|
j_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_18);
|
|
}
|
|
LA38_: ;
|
|
nimln_(2737, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
isNumber = ((NI) 0);
|
|
{
|
|
nimln_(2738, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T42_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_22;
|
|
T42_ = (NIM_BOOL)0;
|
|
T42_ = (j_2 < (formatstr ? formatstr->Sup.len : 0));
|
|
if (!(T42_)) goto LA43_;
|
|
if (j_2 < 0 || j_2 >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(j_2,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
T42_ = !((((NU8)(formatstr->data[j_2])) == ((NU8)(0)) || ((NU8)(formatstr->data[j_2])) == ((NU8)(125))));
|
|
LA43_: ;
|
|
if (!T42_) goto LA41;
|
|
nimln_(2739, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_19;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_20;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_21;
|
|
if (j_2 < 0 || j_2 >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(j_2,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
if (!(((NU8)(formatstr->data[j_2])) >= ((NU8)(48)) && ((NU8)(formatstr->data[j_2])) <= ((NU8)(57)))) goto LA46_;
|
|
nimln_(2740, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimMulInt(k, ((NI) 10), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_19)) { raiseOverflow(); };
|
|
if (j_2 < 0 || j_2 >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(j_2,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
if (nimAddInt((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_19), ((NU8)(formatstr->data[j_2])), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_20)) { raiseOverflow(); };
|
|
if (nimSubInt((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_20), ((NI) 48), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_21)) { raiseOverflow(); };
|
|
k = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_21);
|
|
nimln_(2741, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(isNumber == ((NI) 0))) goto LA50_;
|
|
isNumber = ((NI) 1);
|
|
}
|
|
LA50_: ;
|
|
}
|
|
goto LA44_;
|
|
LA46_: ;
|
|
{
|
|
nimln_(2743, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
isNumber = ((NI) -1);
|
|
}
|
|
LA44_: ;
|
|
nimln_(2744, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_22)) { raiseOverflow(); };
|
|
j_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_22);
|
|
} LA41: ;
|
|
}
|
|
nimln_(2745, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI idx_2;
|
|
if (!(isNumber == ((NI) 1))) goto LA55_;
|
|
nimln_(2746, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_23;
|
|
if (!!(negative_2)) goto LA59_;
|
|
if (nimSubInt(k, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_23)) { raiseOverflow(); };
|
|
idx_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_23);
|
|
}
|
|
goto LA57_;
|
|
LA59_: ;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_24;
|
|
if (nimSubInt(aLen_0, k, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_24)) { raiseOverflow(); };
|
|
idx_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_24);
|
|
}
|
|
LA57_: ;
|
|
nimln_(2747, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T64_;
|
|
T64_ = (NIM_BOOL)0;
|
|
T64_ = (idx_2 < ((NI) 0));
|
|
if (T64_) goto LA65_;
|
|
T64_ = ((aLen_0-1) < idx_2);
|
|
LA65_: ;
|
|
if (!T64_) goto LA66_;
|
|
invalidFormatString__pureZstrutils_2228(formatstr);
|
|
}
|
|
LA66_: ;
|
|
nimln_(2748, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (idx_2 < 0 || idx_2 >= aLen_0){ raiseIndexError2(idx_2,aLen_0-1); }
|
|
unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[idx_2] ? a[idx_2]->Sup.len : 0) + 0));
|
|
appendString((*s), a[idx_2]);
|
|
}
|
|
goto LA53_;
|
|
LA55_: ;
|
|
{
|
|
NI x;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_27;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_28;
|
|
NimStringDesc* T69_;
|
|
nimln_(2750, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 2), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_27)) { raiseOverflow(); };
|
|
if (nimSubInt(j_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_28)) { raiseOverflow(); };
|
|
T69_ = NIM_NIL;
|
|
T69_ = substr__system_8704(formatstr, (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_27), (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_28));
|
|
x = findNormalized__pureZstrutils_2216(T69_, a, aLen_0);
|
|
nimln_(2751, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T72_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_29;
|
|
T72_ = (NIM_BOOL)0;
|
|
T72_ = (((NI) 0) <= x);
|
|
if (!(T72_)) goto LA73_;
|
|
T72_ = (x < (aLen_0-1));
|
|
LA73_: ;
|
|
if (!T72_) goto LA74_;
|
|
if (nimAddInt(x, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_29)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_29) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_29) >= aLen_0){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_29),aLen_0-1); }
|
|
unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_29)] ? a[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_29)]->Sup.len : 0) + 0));
|
|
appendString((*s), a[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_29)]);
|
|
}
|
|
goto LA70_;
|
|
LA74_: ;
|
|
{
|
|
nimln_(2752, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
invalidFormatString__pureZstrutils_2228(formatstr);
|
|
}
|
|
LA70_: ;
|
|
}
|
|
LA53_: ;
|
|
nimln_(2753, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_30)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_30);
|
|
}
|
|
break;
|
|
case 97 ... 122:
|
|
case 65 ... 90:
|
|
case 128 ... 255:
|
|
case 95:
|
|
{
|
|
NI j_3;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_31;
|
|
NI x_2;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_33;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_34;
|
|
NimStringDesc* T82_;
|
|
nimln_(2755, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_31)) { raiseOverflow(); };
|
|
j_3 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_31);
|
|
{
|
|
nimln_(2756, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T80_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_32;
|
|
T80_ = (NIM_BOOL)0;
|
|
T80_ = (j_3 < (formatstr ? formatstr->Sup.len : 0));
|
|
if (!(T80_)) goto LA81_;
|
|
if (j_3 < 0 || j_3 >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(j_3,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
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)));
|
|
LA81_: ;
|
|
if (!T80_) goto LA79;
|
|
if (nimAddInt(j_3, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_32)) { raiseOverflow(); };
|
|
j_3 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_32);
|
|
} LA79: ;
|
|
}
|
|
nimln_(2757, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_33)) { raiseOverflow(); };
|
|
if (nimSubInt(j_3, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_34)) { raiseOverflow(); };
|
|
T82_ = NIM_NIL;
|
|
T82_ = substr__system_8704(formatstr, (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_33), (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_34));
|
|
x_2 = findNormalized__pureZstrutils_2216(T82_, a, aLen_0);
|
|
nimln_(2758, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T85_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_35;
|
|
T85_ = (NIM_BOOL)0;
|
|
T85_ = (((NI) 0) <= x_2);
|
|
if (!(T85_)) goto LA86_;
|
|
T85_ = (x_2 < (aLen_0-1));
|
|
LA86_: ;
|
|
if (!T85_) goto LA87_;
|
|
if (nimAddInt(x_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_35)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_35) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_35) >= aLen_0){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_35),aLen_0-1); }
|
|
unsureAsgnRef((void**) (&(*s)), resizeString((*s), (a[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_35)] ? a[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_35)]->Sup.len : 0) + 0));
|
|
appendString((*s), a[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_35)]);
|
|
}
|
|
goto LA83_;
|
|
LA87_: ;
|
|
{
|
|
nimln_(2759, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
invalidFormatString__pureZstrutils_2228(formatstr);
|
|
}
|
|
LA83_: ;
|
|
nimln_(2760, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = j_3;
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
nimln_(2762, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
invalidFormatString__pureZstrutils_2228(formatstr);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
goto LA3_;
|
|
LA7_: ;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_36;
|
|
nimln_(2764, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (formatstr ? formatstr->Sup.len : 0)){ raiseIndexError2(i,(formatstr ? formatstr->Sup.len : 0)-1); }
|
|
unsureAsgnRef((void**) (&(*s)), addChar((*s), formatstr->data[i]));
|
|
nimln_(2765, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_36)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_36);
|
|
}
|
|
LA3_: ;
|
|
} LA2: ;
|
|
}
|
|
popFrame();
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
|
|
NimStringDesc* result;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_2;
|
|
nimfr_("%", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(2812, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt((formatstr ? formatstr->Sup.len : 0), (NI)((NU64)(aLen_0) << (NU64)(((NI) 4))), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_2)) { raiseOverflow(); };
|
|
if (((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_2)) < ((NI) 0) || ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_2), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = rawNewString(((NI) ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_2))));
|
|
nimln_(2813, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nsuAddf((&result), formatstr, a, aLen_0);
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count) {
|
|
NimStringDesc* result;
|
|
nimfr_("repeat", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(1284, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = mnewString(count);
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_37;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(1285, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(((NI) (count)), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_37)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_37);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 0);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_38;
|
|
if (!(res <= colontmp_)) goto LA3;
|
|
nimln_(1285, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
if (i < 0 || i >= (result ? result->Sup.len : 0)){ raiseIndexError2(i,(result ? result->Sup.len : 0)-1); }
|
|
result->data[i] = c;
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_38)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_38);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s) {
|
|
NimStringDesc* result;
|
|
NI j;
|
|
nimfr_("normalize", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(323, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((s ? s->Sup.len : 0)) < ((NI) 0) || ((s ? s->Sup.len : 0)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((s ? s->Sup.len : 0), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = mnewString(((NI) ((s ? s->Sup.len : 0))));
|
|
nimln_(324, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
j = ((NI) 0);
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_39;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(325, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt((s ? s->Sup.len : 0), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_39)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_39);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 0);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_43;
|
|
if (!(res <= colontmp_)) goto LA3;
|
|
nimln_(325, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_40;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_41;
|
|
nimln_(326, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (!(((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)))) goto LA6_;
|
|
if (j < 0 || j >= (result ? result->Sup.len : 0)){ raiseIndexError2(j,(result ? result->Sup.len : 0)-1); }
|
|
nimln_(327, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (nimAddInt(((NU8)(s->data[i])), ((NI) 32), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_40)) { raiseOverflow(); };
|
|
if (((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_40)) < ((NI) 0) || ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_40)) > ((NI) 255)){ raiseRangeErrorI((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_40), ((NI) 0), ((NI) 255)); }
|
|
result->data[j] = ((NIM_CHAR) (((NI) ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_40)))));
|
|
nimln_(328, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_41)) { raiseOverflow(); };
|
|
j = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_41);
|
|
}
|
|
goto LA4_;
|
|
LA6_: ;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_42;
|
|
nimln_(329, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (!!(((NU8)(s->data[i]) == (NU8)(95)))) goto LA9_;
|
|
if (j < 0 || j >= (result ? result->Sup.len : 0)){ raiseIndexError2(j,(result ? result->Sup.len : 0)-1); }
|
|
nimln_(330, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
result->data[j] = s->data[i];
|
|
nimln_(331, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_42)) { raiseOverflow(); };
|
|
j = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_42);
|
|
}
|
|
goto LA4_;
|
|
LA9_: ;
|
|
LA4_: ;
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_43)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_43);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
nimln_(332, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!!((j == (s ? s->Sup.len : 0)))) goto LA13_;
|
|
if ((j) < ((NI) 0) || (j) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(j, ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = setLengthStr(result, ((NI) (j)));
|
|
}
|
|
LA13_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s) {
|
|
NCSTRING result;
|
|
result = (NCSTRING)0;
|
|
{
|
|
NIM_BOOL T3_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = (s == ((NimStringDesc*) NIM_NIL));
|
|
if (T3_) goto LA4_;
|
|
T3_ = ((*s).Sup.len == ((NI) 0));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
result = "";
|
|
}
|
|
goto LA1_;
|
|
LA5_: ;
|
|
{
|
|
result = ((NCSTRING) ((*s).data));
|
|
}
|
|
LA1_: ;
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last) {
|
|
NI result;
|
|
NI last_2;
|
|
NI length;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_44;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_45;
|
|
nimfr_("find", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(1904, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
nimln_(1905, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(last < ((NI) 0))) goto LA3_;
|
|
last_2 = ((s ? s->Sup.len : 0)-1);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
last_2 = last;
|
|
}
|
|
LA1_: ;
|
|
nimln_(1916, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(last_2, ((NI) (start)), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_44)) { raiseOverflow(); };
|
|
if (nimAddInt((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_44), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_45)) { raiseOverflow(); };
|
|
length = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_45);
|
|
nimln_(1917, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
void* found;
|
|
if (!(((NI) 0) < length)) goto LA8_;
|
|
nimln_(1918, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (start < 0 || start >= (s ? s->Sup.len : 0)){ raiseIndexError2(start,(s ? s->Sup.len : 0)-1); }
|
|
found = memchr(((void*) ((&s->data[start]))), sub, ((size_t) (length)));
|
|
nimln_(1919, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!!((found == 0))) goto LA12_;
|
|
nimln_(1920, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = minuspercent___system_716(((NI) (ptrdiff_t) (found)), ((NI) (nimToCStringConv(s))));
|
|
goto BeforeRet_;
|
|
}
|
|
LA12_: ;
|
|
}
|
|
LA8_: ;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c) {
|
|
NIM_CHAR result;
|
|
nimfr_("toLowerAscii", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (NIM_CHAR)0;
|
|
nimln_(217, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)))) goto LA3_;
|
|
nimln_(218, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NIM_CHAR) ((NU8)(((NU8) (((NU8)(c)))) ^ ((NU8) 32))));
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
nimln_(220, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = c;
|
|
}
|
|
LA1_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToLowerAsciiStr)(NimStringDesc* s) {
|
|
NimStringDesc* result;
|
|
nimfr_("toLowerAscii", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(223, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((s ? s->Sup.len : 0)) < ((NI) 0) || ((s ? s->Sup.len : 0)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((s ? s->Sup.len : 0), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = mnewString(((NI) ((s ? s->Sup.len : 0))));
|
|
{
|
|
NI iX60gensym7_;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_46;
|
|
NI res;
|
|
iX60gensym7_ = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(224, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt((s ? s->Sup.len : 0), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_46)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_46);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 0);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_47;
|
|
if (!(res <= colontmp_)) goto LA3;
|
|
nimln_(238, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
iX60gensym7_ = res;
|
|
if (iX60gensym7_ < 0 || iX60gensym7_ >= (result ? result->Sup.len : 0)){ raiseIndexError2(iX60gensym7_,(result ? result->Sup.len : 0)-1); }
|
|
if (iX60gensym7_ < 0 || iX60gensym7_ >= (s ? s->Sup.len : 0)){ raiseIndexError2(iX60gensym7_,(s ? s->Sup.len : 0)-1); }
|
|
result->data[iX60gensym7_] = nsuToLowerAsciiChar(s->data[iX60gensym7_]);
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_47)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_47);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
|
|
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
|
|
nimfr_("nimGCunrefNoCycle", "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
nimln_(276, "/home/yyoncho/Sources/nim/Nim/lib/system/gc.nim");
|
|
T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
|
|
T1_ = usrToCell__system_5841(p);
|
|
decRef__system_5886(T1_);
|
|
popFrame();
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitChar)(NimStringDesc* s, NIM_CHAR sep, NI maxsplit) {
|
|
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
|
|
nimfr_("split", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(414, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
{
|
|
NimStringDesc* xX60gensym66_;
|
|
NI lastX60gensym33_;
|
|
NI splitsX60gensym33_;
|
|
xX60gensym66_ = NIM_NIL;
|
|
nimln_(386, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
lastX60gensym33_ = ((NI) 0);
|
|
nimln_(387, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
splitsX60gensym33_ = maxsplit;
|
|
{
|
|
nimln_(447, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI firstX60gensym33_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_49;
|
|
NI T12_;
|
|
NimStringDesc* T13_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_50;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_51;
|
|
nimln_(389, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (!(lastX60gensym33_ <= (s ? s->Sup.len : 0))) goto LA3;
|
|
nimln_(390, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
firstX60gensym33_ = lastX60gensym33_;
|
|
{
|
|
nimln_(391, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T6_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_48;
|
|
T6_ = (NIM_BOOL)0;
|
|
T6_ = (lastX60gensym33_ < (s ? s->Sup.len : 0));
|
|
if (!(T6_)) goto LA7_;
|
|
if (lastX60gensym33_ < 0 || lastX60gensym33_ >= (s ? s->Sup.len : 0)){ raiseIndexError2(lastX60gensym33_,(s ? s->Sup.len : 0)-1); }
|
|
T6_ = !(((NU8)(s->data[lastX60gensym33_]) == (NU8)(sep)));
|
|
LA7_: ;
|
|
if (!T6_) goto LA5;
|
|
nimln_(392, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(lastX60gensym33_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_48)) { raiseOverflow(); };
|
|
lastX60gensym33_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_48);
|
|
} LA5: ;
|
|
}
|
|
nimln_(393, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(splitsX60gensym33_ == ((NI) 0))) goto LA10_;
|
|
lastX60gensym33_ = (s ? s->Sup.len : 0);
|
|
}
|
|
LA10_: ;
|
|
nimln_(724, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(394, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(lastX60gensym33_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_49)) { raiseOverflow(); };
|
|
nimln_(724, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
xX60gensym66_ = substr__system_8704(s, firstX60gensym33_, (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_49));
|
|
result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
|
|
T12_ = result->Sup.len++;
|
|
T13_ = NIM_NIL;
|
|
T13_ = result->data[T12_]; result->data[T12_] = copyStringRC1(xX60gensym66_);
|
|
if (T13_) nimGCunrefNoCycle(T13_);
|
|
nimln_(395, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(splitsX60gensym33_ == ((NI) 0))) goto LA16_;
|
|
goto LA2;
|
|
}
|
|
LA16_: ;
|
|
nimln_(396, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(splitsX60gensym33_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_50)) { raiseOverflow(); };
|
|
splitsX60gensym33_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_50);
|
|
nimln_(397, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(lastX60gensym33_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_51)) { raiseOverflow(); };
|
|
lastX60gensym33_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_51);
|
|
} LA3: ;
|
|
} LA2: ;
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuParseInt)(NimStringDesc* s) {
|
|
NI result;
|
|
NI L;
|
|
nimfr_("parseInt", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (NI)0;
|
|
nimln_(1090, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) 0);
|
|
nimln_(1091, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
L = npuParseInt(s, (&result), ((NI) 0));
|
|
nimln_(1092, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T3_;
|
|
tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T7_;
|
|
NimStringDesc* T8_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = !((L == (s ? s->Sup.len : 0)));
|
|
if (T3_) goto LA4_;
|
|
T3_ = (L == ((NI) 0));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
T7_ = NIM_NIL;
|
|
T7_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
|
|
(*T7_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
|
|
(*T7_).Sup.Sup.name = "ValueError";
|
|
nimln_(1093, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T8_ = NIM_NIL;
|
|
T8_ = rawNewString((s ? s->Sup.len : 0) + 17);
|
|
appendString(T8_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_52));
|
|
appendString(T8_, s);
|
|
asgnRef((void**) (&(*T7_).Sup.Sup.message), T8_);
|
|
asgnRef((void**) (&(*T7_).Sup.Sup.parent), ((Exception*) NIM_NIL));
|
|
raiseExceptionEx((Exception*)T7_, "ValueError", "parseInt", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim", 1093);
|
|
}
|
|
LA5_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen_0, NimStringDesc* sep) {
|
|
NimStringDesc* result;
|
|
nimfr_("join", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(1800, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI L;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_53;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_54;
|
|
if (!(((NI) 0) < aLen_0)) goto LA3_;
|
|
nimln_(1801, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(aLen_0, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_53)) { raiseOverflow(); };
|
|
if (nimMulInt((sep ? sep->Sup.len : 0), (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_53), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_54)) { raiseOverflow(); };
|
|
L = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_54);
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(1802, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
colontmp_ = (aLen_0-1);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 0);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_55;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_56;
|
|
if (!(res <= colontmp_)) goto LA7;
|
|
nimln_(1802, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
if (i < 0 || i >= aLen_0){ raiseIndexError2(i,aLen_0-1); }
|
|
if (nimAddInt(L, (a[i] ? a[i]->Sup.len : 0), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_55)) { raiseOverflow(); };
|
|
L = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_55);
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_56)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_56);
|
|
} LA7: ;
|
|
}
|
|
}
|
|
nimln_(1803, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if ((L) < ((NI) 0) || (L) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(L, ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = rawNewString(((NI) (L)));
|
|
nimln_(1804, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((NI) 0) < 0 || ((NI) 0) >= aLen_0){ raiseIndexError2(((NI) 0),aLen_0-1); }
|
|
result = resizeString(result, (a[((NI) 0)] ? a[((NI) 0)]->Sup.len : 0) + 0);
|
|
appendString(result, a[((NI) 0)]);
|
|
{
|
|
NI i_2;
|
|
NI colontmp__2;
|
|
NI res_2;
|
|
i_2 = (NI)0;
|
|
colontmp__2 = (NI)0;
|
|
nimln_(1805, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
colontmp__2 = (aLen_0-1);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res_2 = ((NI) 1);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_57;
|
|
if (!(res_2 <= colontmp__2)) goto LA10;
|
|
nimln_(1805, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i_2 = res_2;
|
|
result = resizeString(result, (sep ? sep->Sup.len : 0) + 0);
|
|
appendString(result, sep);
|
|
if (i_2 < 0 || i_2 >= aLen_0){ raiseIndexError2(i_2,aLen_0-1); }
|
|
result = resizeString(result, (a[i_2] ? a[i_2]->Sup.len : 0) + 0);
|
|
appendString(result, a[i_2]);
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_57)) { raiseOverflow(); };
|
|
res_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_57);
|
|
} LA10: ;
|
|
}
|
|
}
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
nimln_(1809, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NimStringDesc*) NIM_NIL);
|
|
}
|
|
LA1_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
|
|
void* T1_;
|
|
T1_ = (void*)0;
|
|
T1_ = memset(a, v, ((size_t) (size)));
|
|
}
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
|
|
nimSetMem__systemZmemory_7(p, ((int) 0), size);
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a) {
|
|
NimStringDesc* result;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_58;
|
|
tyArray__nHXaesL0DJZHyVS07ARPRA T1_;
|
|
nimfr_("%", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(2819, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt((formatstr ? formatstr->Sup.len : 0), (a ? a->Sup.len : 0), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_58)) { raiseOverflow(); };
|
|
if (((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_58)) < ((NI) 0) || ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_58)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_58), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = rawNewString(((NI) ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_58))));
|
|
nimln_(2820, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimZeroMem((void*)T1_, sizeof(tyArray__nHXaesL0DJZHyVS07ARPRA));
|
|
T1_[0] = copyString(a);
|
|
nsuAddf((&result), formatstr, T1_, 1);
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) {
|
|
int result;
|
|
result = (int)0;
|
|
result = memcmp(a, b, ((size_t) (size)));
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, equalMem__system_1735)(void* a, void* b, NI size) {
|
|
NIM_BOOL result;
|
|
int T1_;
|
|
result = (NIM_BOOL)0;
|
|
T1_ = (int)0;
|
|
T1_ = nimCmpMem(a, b, size);
|
|
result = (T1_ == ((NI32) 0));
|
|
return result;
|
|
}
|
|
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
|
|
NIM_BOOL result;
|
|
NI alen;
|
|
NI blen;
|
|
nimfr_("eqStrings", "/home/yyoncho/Sources/nim/Nim/lib/system/strmantle.nim");
|
|
{ result = (NIM_BOOL)0;
|
|
nimln_(27, "/home/yyoncho/Sources/nim/Nim/lib/system/strmantle.nim");
|
|
alen = (a ? a->Sup.len : 0);
|
|
nimln_(28, "/home/yyoncho/Sources/nim/Nim/lib/system/strmantle.nim");
|
|
blen = (b ? b->Sup.len : 0);
|
|
nimln_(29, "/home/yyoncho/Sources/nim/Nim/lib/system/strmantle.nim");
|
|
{
|
|
if (!(alen == blen)) goto LA3_;
|
|
nimln_(30, "/home/yyoncho/Sources/nim/Nim/lib/system/strmantle.nim");
|
|
{
|
|
if (!(alen == ((NI) 0))) goto LA7_;
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
nimln_(31, "/home/yyoncho/Sources/nim/Nim/lib/system/strmantle.nim");
|
|
result = equalMem__system_1735(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen)));
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, parseBool__pureZstrutils_1020)(NimStringDesc* s) {
|
|
NIM_BOOL result;
|
|
NimStringDesc* T1_;
|
|
nimfr_("parseBool", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (NIM_BOOL)0;
|
|
nimln_(1234, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T1_ = NIM_NIL;
|
|
T1_ = nsuNormalize(s);
|
|
switch (hashString(T1_) & 15) {
|
|
case 0:
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_60))) goto LA2_;
|
|
break;
|
|
case 1:
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_64))) goto LA3_;
|
|
break;
|
|
case 5:
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_61))) goto LA2_;
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_65))) goto LA3_;
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_68))) goto LA3_;
|
|
break;
|
|
case 8:
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_59))) goto LA2_;
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_63))) goto LA2_;
|
|
break;
|
|
case 9:
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_62))) goto LA2_;
|
|
break;
|
|
case 10:
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_66))) goto LA3_;
|
|
break;
|
|
case 11:
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_67))) goto LA3_;
|
|
break;
|
|
}
|
|
goto LA4_;
|
|
LA2_: ;
|
|
{
|
|
nimln_(1235, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_TRUE;
|
|
}
|
|
goto LA5_;
|
|
LA3_: ;
|
|
{
|
|
nimln_(1236, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_FALSE;
|
|
}
|
|
goto LA5_;
|
|
LA4_: ;
|
|
{
|
|
tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T9_;
|
|
NimStringDesc* T10_;
|
|
T9_ = NIM_NIL;
|
|
T9_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
|
|
(*T9_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
|
|
(*T9_).Sup.Sup.name = "ValueError";
|
|
nimln_(1237, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T10_ = NIM_NIL;
|
|
T10_ = rawNewString((s ? s->Sup.len : 0) + 28);
|
|
appendString(T10_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_69));
|
|
appendString(T10_, s);
|
|
asgnRef((void**) (&(*T9_).Sup.Sup.message), T10_);
|
|
asgnRef((void**) (&(*T9_).Sup.Sup.parent), ((Exception*) NIM_NIL));
|
|
raiseExceptionEx((Exception*)T9_, "ValueError", "parseBool", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim", 1237);
|
|
}
|
|
LA5_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b) {
|
|
NI result;
|
|
NI aLenX60gensym20_;
|
|
NI bLenX60gensym20_;
|
|
NI iX60gensym20_;
|
|
NI mX60gensym20_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_72;
|
|
nimfr_("cmpIgnoreCase", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(42, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
aLenX60gensym20_ = (a ? a->Sup.len : 0);
|
|
nimln_(43, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
bLenX60gensym20_ = (b ? b->Sup.len : 0);
|
|
nimln_(44, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
iX60gensym20_ = ((NI) 0);
|
|
nimln_(48, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
mX60gensym20_ = ((aLenX60gensym20_ <= bLenX60gensym20_) ? aLenX60gensym20_ : bLenX60gensym20_);
|
|
{
|
|
nimln_(49, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
while (1) {
|
|
NIM_CHAR T3_;
|
|
NIM_CHAR T4_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_70;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_71;
|
|
if (!(iX60gensym20_ < mX60gensym20_)) goto LA2;
|
|
nimln_(50, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (iX60gensym20_ < 0 || iX60gensym20_ >= (a ? a->Sup.len : 0)){ raiseIndexError2(iX60gensym20_,(a ? a->Sup.len : 0)-1); }
|
|
T3_ = (NIM_CHAR)0;
|
|
T3_ = toLowerAscii__stdZprivateZstrimpl_1(a->data[iX60gensym20_]);
|
|
if (iX60gensym20_ < 0 || iX60gensym20_ >= (b ? b->Sup.len : 0)){ raiseIndexError2(iX60gensym20_,(b ? b->Sup.len : 0)-1); }
|
|
T4_ = (NIM_CHAR)0;
|
|
T4_ = toLowerAscii__stdZprivateZstrimpl_1(b->data[iX60gensym20_]);
|
|
if (nimSubInt(((NU8)(T3_)), ((NU8)(T4_)), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_70)) { raiseOverflow(); };
|
|
result = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_70);
|
|
nimln_(51, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
{
|
|
if (!!((result == ((NI) 0)))) goto LA7_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
nimln_(52, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (nimAddInt(iX60gensym20_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_71)) { raiseOverflow(); };
|
|
iX60gensym20_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_71);
|
|
} LA2: ;
|
|
}
|
|
nimln_(53, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (nimSubInt(aLenX60gensym20_, bLenX60gensym20_, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_72)) { raiseOverflow(); };
|
|
result = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_72);
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStrA)(tyArray__9cc9aPiDa8VaWjVcFLabEDZQ a, NimStringDesc* s, NimStringDesc* sub, NI start, NI last) {
|
|
NI result;
|
|
NI last_2;
|
|
NI subLast;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_74;
|
|
NI skip;
|
|
nimfr_("find", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(1861, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(last < ((NI) 0))) goto LA3_;
|
|
last_2 = ((s ? s->Sup.len : 0)-1);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
last_2 = last;
|
|
}
|
|
LA1_: ;
|
|
nimln_(1862, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt((sub ? sub->Sup.len : 0), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_74)) { raiseOverflow(); };
|
|
subLast = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_74);
|
|
nimln_(1864, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(subLast == ((NI) -1))) goto LA8_;
|
|
nimln_(1867, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) (start));
|
|
goto BeforeRet_;
|
|
}
|
|
LA8_: ;
|
|
nimln_(1871, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
nimln_(1872, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
skip = start;
|
|
{
|
|
nimln_(1874, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_75;
|
|
NI i;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_78;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_79;
|
|
if (nimSubInt(last_2, ((NI) (skip)), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_75)) { raiseOverflow(); };
|
|
if (!(subLast <= (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_75))) goto LA11;
|
|
nimln_(1875, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = subLast;
|
|
{
|
|
nimln_(1876, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_76;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_77;
|
|
if (nimAddInt(((NI) (skip)), i, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_76)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_76) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_76) >= (s ? s->Sup.len : 0)){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_76),(s ? s->Sup.len : 0)-1); }
|
|
if (i < 0 || i >= (sub ? sub->Sup.len : 0)){ raiseIndexError2(i,(sub ? sub->Sup.len : 0)-1); }
|
|
if (!((NU8)(s->data[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_76)]) == (NU8)(sub->data[i]))) goto LA13;
|
|
nimln_(1877, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(i == ((NI) 0))) goto LA16_;
|
|
nimln_(1878, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) (skip));
|
|
goto BeforeRet_;
|
|
}
|
|
LA16_: ;
|
|
nimln_(1879, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_77)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_77);
|
|
} LA13: ;
|
|
}
|
|
nimln_(1880, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(((NI) (skip)), subLast, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_78)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_78) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_78) >= (s ? s->Sup.len : 0)){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_78),(s ? s->Sup.len : 0)-1); }
|
|
if (nimAddInt(skip, a[(((NU8)(s->data[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_78)])))- 0], &TM__JGc9b9bh2D3nTdUR7TGyq8aA_79)) { raiseOverflow(); };
|
|
if (TM__JGc9b9bh2D3nTdUR7TGyq8aA_79 < 0 || TM__JGc9b9bh2D3nTdUR7TGyq8aA_79 > IL64(9223372036854775807)){ raiseOverflow(); }
|
|
skip = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_79);
|
|
} LA11: ;
|
|
}
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, nsuInitSkipTable)(NI* a, NimStringDesc* sub) {
|
|
NI m;
|
|
nimfr_("initSkipTable", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(1834, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
m = (sub ? sub->Sup.len : 0);
|
|
nimln_(1835, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
fill__pureZstrutils_1487(a, 256, m);
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_80;
|
|
NI i_2;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(1837, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(m, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_80)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_80);
|
|
nimln_(119, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
i_2 = ((NI) 0);
|
|
{
|
|
nimln_(120, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_81;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_82;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_83;
|
|
if (!(i_2 < colontmp_)) goto LA3;
|
|
nimln_(1837, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = i_2;
|
|
if (i < 0 || i >= (sub ? sub->Sup.len : 0)){ raiseIndexError2(i,(sub ? sub->Sup.len : 0)-1); }
|
|
nimln_(1838, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(m, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_81)) { raiseOverflow(); };
|
|
if (nimSubInt((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_81), i, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_82)) { raiseOverflow(); };
|
|
a[(((NU8)(sub->data[i])))- 0] = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_82);
|
|
nimln_(122, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(i_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_83)) { raiseOverflow(); };
|
|
i_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_83);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(void, nsuInitNewSkipTable)(NimStringDesc* sub, tyArray__9cc9aPiDa8VaWjVcFLabEDZQ Result) {
|
|
nimfr_("initSkipTable", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(1847, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nsuInitSkipTable(Result, sub);
|
|
popFrame();
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last) {
|
|
NI result;
|
|
nimfr_("find", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(1954, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_73;
|
|
if (nimSubInt((s ? s->Sup.len : 0), ((NI) (start)), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_73)) { raiseOverflow(); };
|
|
if (!((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_73) < (sub ? sub->Sup.len : 0))) goto LA3_;
|
|
result = ((NI) -1);
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
nimln_(1955, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!((sub ? sub->Sup.len : 0) == ((NI) 1))) goto LA7_;
|
|
if (((NI) 0) < 0 || ((NI) 0) >= (sub ? sub->Sup.len : 0)){ raiseIndexError2(((NI) 0),(sub ? sub->Sup.len : 0)-1); }
|
|
result = nsuFindChar(s, sub->data[((NI) 0)], start, last);
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
nimln_(1964, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T11_;
|
|
NCSTRING found;
|
|
T11_ = (NIM_BOOL)0;
|
|
T11_ = (last < ((NI) 0));
|
|
if (!(T11_)) goto LA12_;
|
|
T11_ = (((NI) (start)) < (s ? s->Sup.len : 0));
|
|
LA12_: ;
|
|
if (!T11_) goto LA13_;
|
|
nimln_(1965, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (start < 0 || start >= (s ? s->Sup.len : 0)){ raiseIndexError2(start,(s ? s->Sup.len : 0)-1); }
|
|
found = strstr(((NCSTRING) ((&s->data[start]))), nimToCStringConv(sub));
|
|
nimln_(1966, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!!((found == 0))) goto LA17_;
|
|
nimln_(1967, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = minuspercent___system_716(((NI) (found)), ((NI) (nimToCStringConv(s))));
|
|
}
|
|
goto LA15_;
|
|
LA17_: ;
|
|
{
|
|
result = ((NI) -1);
|
|
}
|
|
LA15_: ;
|
|
}
|
|
goto LA9_;
|
|
LA13_: ;
|
|
{
|
|
tyArray__9cc9aPiDa8VaWjVcFLabEDZQ T21_;
|
|
nimln_(1958, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimZeroMem((void*)T21_, sizeof(tyArray__9cc9aPiDa8VaWjVcFLabEDZQ));
|
|
nsuInitNewSkipTable(sub, T21_);
|
|
result = nsuFindStrA(T21_, s, sub, start, last);
|
|
}
|
|
LA9_: ;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains__pureZstrutils_1717)(NimStringDesc* s, NimStringDesc* sub) {
|
|
NIM_BOOL result;
|
|
NI T1_;
|
|
nimfr_("contains", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NIM_BOOL)0;
|
|
nimln_(2110, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T1_ = (NI)0;
|
|
T1_ = nsuFindStr(s, sub, ((NI) 0), ((NI) -1));
|
|
result = (((NI) 0) <= T1_);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindCharSet)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars, NI start, NI last) {
|
|
NI result;
|
|
NI last_2;
|
|
nimfr_("find", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(1936, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
nimln_(1937, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(last < ((NI) 0))) goto LA3_;
|
|
last_2 = ((s ? s->Sup.len : 0)-1);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
last_2 = last;
|
|
}
|
|
LA1_: ;
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(1938, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
colontmp_ = ((NI) (start));
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = colontmp_;
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_84;
|
|
if (!(res <= last_2)) goto LA8;
|
|
nimln_(1938, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
{
|
|
nimln_(1939, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (!((chars[(NU)(((NU8)(s->data[i])))>>3] &(1U<<((NU)(((NU8)(s->data[i])))&7U)))!=0)) goto LA11_;
|
|
nimln_(1940, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = i;
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_84)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_84);
|
|
} LA8: ;
|
|
}
|
|
}
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains__pureZstrutils_1721)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars) {
|
|
NIM_BOOL result;
|
|
NI T1_;
|
|
nimfr_("contains", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NIM_BOOL)0;
|
|
nimln_(2117, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T1_ = (NI)0;
|
|
T1_ = nsuFindCharSet(s, chars, ((NI) 0), ((NI) -1));
|
|
result = (((NI) 0) <= T1_);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI64, nsuParseBiggestInt)(NimStringDesc* s) {
|
|
NI64 result;
|
|
NI L;
|
|
nimfr_("parseBiggestInt", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (NI64)0;
|
|
nimln_(1100, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = IL64(0);
|
|
nimln_(1101, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
L = npuParseBiggestInt(s, (&result), ((NI) 0));
|
|
nimln_(1102, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T3_;
|
|
tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T7_;
|
|
NimStringDesc* T8_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = !((L == (s ? s->Sup.len : 0)));
|
|
if (T3_) goto LA4_;
|
|
T3_ = (L == ((NI) 0));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
T7_ = NIM_NIL;
|
|
T7_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
|
|
(*T7_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
|
|
(*T7_).Sup.Sup.name = "ValueError";
|
|
nimln_(1103, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T8_ = NIM_NIL;
|
|
T8_ = rawNewString((s ? s->Sup.len : 0) + 17);
|
|
appendString(T8_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_52));
|
|
appendString(T8_, s);
|
|
asgnRef((void**) (&(*T7_).Sup.Sup.message), T8_);
|
|
asgnRef((void**) (&(*T7_).Sup.Sup.parent), ((Exception*) NIM_NIL));
|
|
raiseExceptionEx((Exception*)T7_, "ValueError", "parseBiggestInt", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim", 1103);
|
|
}
|
|
LA5_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NF, nsuParseFloat)(NimStringDesc* s) {
|
|
NF result;
|
|
NI L;
|
|
nimfr_("parseFloat", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (NF)0;
|
|
nimln_(1132, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = 0.0;
|
|
nimln_(1133, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
L = npuParseFloat(s, (&result), ((NI) 0));
|
|
nimln_(1134, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T3_;
|
|
tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T7_;
|
|
NimStringDesc* T8_;
|
|
T3_ = (NIM_BOOL)0;
|
|
T3_ = !((L == (s ? s->Sup.len : 0)));
|
|
if (T3_) goto LA4_;
|
|
T3_ = (L == ((NI) 0));
|
|
LA4_: ;
|
|
if (!T3_) goto LA5_;
|
|
T7_ = NIM_NIL;
|
|
T7_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
|
|
(*T7_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
|
|
(*T7_).Sup.Sup.name = "ValueError";
|
|
nimln_(1135, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T8_ = NIM_NIL;
|
|
T8_ = rawNewString((s ? s->Sup.len : 0) + 15);
|
|
appendString(T8_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_85));
|
|
appendString(T8_, s);
|
|
asgnRef((void**) (&(*T7_).Sup.Sup.message), T8_);
|
|
asgnRef((void**) (&(*T7_).Sup.Sup.parent), ((Exception*) NIM_NIL));
|
|
raiseExceptionEx((Exception*)T7_, "ValueError", "parseFloat", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim", 1135);
|
|
}
|
|
LA5_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuStartsWith)(NimStringDesc* s, NimStringDesc* prefix) {
|
|
NIM_BOOL result;
|
|
NI prefixLenX60gensym147_;
|
|
NI sLenX60gensym147_;
|
|
NI iX60gensym147_;
|
|
nimfr_("startsWith", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NIM_BOOL)0;
|
|
nimln_(56, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
prefixLenX60gensym147_ = (prefix ? prefix->Sup.len : 0);
|
|
nimln_(57, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
sLenX60gensym147_ = (s ? s->Sup.len : 0);
|
|
nimln_(58, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
iX60gensym147_ = ((NI) 0);
|
|
{
|
|
nimln_(1580, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_86;
|
|
nimln_(60, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
{
|
|
if (!(prefixLenX60gensym147_ <= iX60gensym147_)) goto LA5_;
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA5_: ;
|
|
nimln_(61, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
{
|
|
NIM_BOOL T9_;
|
|
T9_ = (NIM_BOOL)0;
|
|
T9_ = (sLenX60gensym147_ <= iX60gensym147_);
|
|
if (T9_) goto LA10_;
|
|
if (iX60gensym147_ < 0 || iX60gensym147_ >= (s ? s->Sup.len : 0)){ raiseIndexError2(iX60gensym147_,(s ? s->Sup.len : 0)-1); }
|
|
if (iX60gensym147_ < 0 || iX60gensym147_ >= (prefix ? prefix->Sup.len : 0)){ raiseIndexError2(iX60gensym147_,(prefix ? prefix->Sup.len : 0)-1); }
|
|
T9_ = !(((NU8)(s->data[iX60gensym147_]) == (NU8)(prefix->data[iX60gensym147_])));
|
|
LA10_: ;
|
|
if (!T9_) goto LA11_;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
nimln_(62, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (nimAddInt(iX60gensym147_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_86)) { raiseOverflow(); };
|
|
iX60gensym147_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_86);
|
|
}
|
|
}
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c) {
|
|
NIM_CHAR result;
|
|
nimfr_("toUpperAscii", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (NIM_CHAR)0;
|
|
nimln_(254, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)))) goto LA3_;
|
|
nimln_(255, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NIM_CHAR) ((NU8)(((NU8) (((NU8)(c)))) ^ ((NU8) 32))));
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
nimln_(257, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = c;
|
|
}
|
|
LA1_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuStrip)(NimStringDesc* s, NIM_BOOL leading, NIM_BOOL trailing, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars) {
|
|
NimStringDesc* result;
|
|
NI first;
|
|
NI last;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_87;
|
|
nimfr_("strip", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(2862, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
first = ((NI) 0);
|
|
nimln_(2863, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt((s ? s->Sup.len : 0), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_87)) { raiseOverflow(); };
|
|
last = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_87);
|
|
nimln_(2864, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!leading) goto LA3_;
|
|
{
|
|
nimln_(2865, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T7_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_88;
|
|
T7_ = (NIM_BOOL)0;
|
|
T7_ = (first <= last);
|
|
if (!(T7_)) goto LA8_;
|
|
if (first < 0 || first >= (s ? s->Sup.len : 0)){ raiseIndexError2(first,(s ? s->Sup.len : 0)-1); }
|
|
T7_ = ((chars[(NU)(((NU8)(s->data[first])))>>3] &(1U<<((NU)(((NU8)(s->data[first])))&7U)))!=0);
|
|
LA8_: ;
|
|
if (!T7_) goto LA6;
|
|
if (nimAddInt(first, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_88)) { raiseOverflow(); };
|
|
first = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_88);
|
|
} LA6: ;
|
|
}
|
|
}
|
|
LA3_: ;
|
|
nimln_(2866, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!trailing) goto LA11_;
|
|
{
|
|
nimln_(2867, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T15_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_89;
|
|
T15_ = (NIM_BOOL)0;
|
|
T15_ = (first <= last);
|
|
if (!(T15_)) goto LA16_;
|
|
if (last < 0 || last >= (s ? s->Sup.len : 0)){ raiseIndexError2(last,(s ? s->Sup.len : 0)-1); }
|
|
T15_ = ((chars[(NU)(((NU8)(s->data[last])))>>3] &(1U<<((NU)(((NU8)(s->data[last])))&7U)))!=0);
|
|
LA16_: ;
|
|
if (!T15_) goto LA14;
|
|
if (nimSubInt(last, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_89)) { raiseOverflow(); };
|
|
last = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_89);
|
|
} LA14: ;
|
|
}
|
|
}
|
|
LA11_: ;
|
|
nimln_(2868, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = substr__system_8704(s, first, last);
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuEndsWith)(NimStringDesc* s, NimStringDesc* suffix) {
|
|
NIM_BOOL result;
|
|
NI suffixLenX60gensym154_;
|
|
NI sLenX60gensym154_;
|
|
NI iX60gensym154_;
|
|
NI jX60gensym154_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_90;
|
|
nimfr_("endsWith", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NIM_BOOL)0;
|
|
nimln_(65, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
suffixLenX60gensym154_ = (suffix ? suffix->Sup.len : 0);
|
|
nimln_(66, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
sLenX60gensym154_ = (s ? s->Sup.len : 0);
|
|
nimln_(67, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
iX60gensym154_ = ((NI) 0);
|
|
nimln_(68, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (nimSubInt(sLenX60gensym154_, suffixLenX60gensym154_, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_90)) { raiseOverflow(); };
|
|
jX60gensym154_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_90);
|
|
{
|
|
nimln_(69, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
while (1) {
|
|
NIM_BOOL T3_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_91;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_92;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_94;
|
|
T3_ = (NIM_BOOL)0;
|
|
if (nimAddInt(iX60gensym154_, jX60gensym154_, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_91)) { raiseOverflow(); };
|
|
T3_ = (((NI) 0) <= (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_91));
|
|
if (!(T3_)) goto LA4_;
|
|
if (nimAddInt(iX60gensym154_, jX60gensym154_, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_92)) { raiseOverflow(); };
|
|
T3_ = ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_92) < sLenX60gensym154_);
|
|
LA4_: ;
|
|
if (!T3_) goto LA2;
|
|
nimln_(70, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_93;
|
|
if (nimAddInt(iX60gensym154_, jX60gensym154_, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_93)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_93) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_93) >= (s ? s->Sup.len : 0)){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_93),(s ? s->Sup.len : 0)-1); }
|
|
if (iX60gensym154_ < 0 || iX60gensym154_ >= (suffix ? suffix->Sup.len : 0)){ raiseIndexError2(iX60gensym154_,(suffix ? suffix->Sup.len : 0)-1); }
|
|
if (!!(((NU8)(s->data[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_93)]) == (NU8)(suffix->data[iX60gensym154_])))) goto LA7_;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
nimln_(71, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (nimAddInt(iX60gensym154_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_94)) { raiseOverflow(); };
|
|
iX60gensym154_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_94);
|
|
} LA2: ;
|
|
}
|
|
nimln_(1608, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
nimln_(72, "/home/yyoncho/Sources/nim/Nim/lib/std/private/strimpl.nim");
|
|
if (!(suffixLenX60gensym154_ <= iX60gensym154_)) goto LA11_;
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, allCharsInSet__pureZstrutils_1423)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw theSet) {
|
|
NIM_BOOL result;
|
|
nimfr_("allCharsInSet", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NIM_BOOL)0;
|
|
{
|
|
NIM_CHAR c;
|
|
NI i;
|
|
NI L;
|
|
c = (NIM_CHAR)0;
|
|
nimln_(256, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
i = ((NI) 0);
|
|
nimln_(257, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
L = (s ? s->Sup.len : 0);
|
|
{
|
|
nimln_(258, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_95;
|
|
if (!(i < L)) goto LA3;
|
|
nimln_(1768, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
c = s->data[i];
|
|
{
|
|
nimln_(1769, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (!!(((theSet[(NU)(((NU8)(c)))>>3] &(1U<<((NU)(((NU8)(c)))&7U)))!=0))) goto LA6_;
|
|
result = NIM_FALSE;
|
|
goto BeforeRet_;
|
|
}
|
|
LA6_: ;
|
|
nimln_(260, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_95)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_95);
|
|
nimln_(261, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
{
|
|
if (!!(((s ? s->Sup.len : 0) == L))) goto LA10_;
|
|
failedAssertImpl__stdZassertions_56(((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_96));
|
|
}
|
|
LA10_: ;
|
|
} LA3: ;
|
|
}
|
|
}
|
|
nimln_(1770, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_TRUE;
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nimIdentNormalize__pureZstrutils_121)(NimStringDesc* s) {
|
|
NimStringDesc* result;
|
|
NI j;
|
|
nimfr_("nimIdentNormalize", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = NIM_NIL;
|
|
nimln_(298, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((s ? s->Sup.len : 0)) < ((NI) 0) || ((s ? s->Sup.len : 0)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((s ? s->Sup.len : 0), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = mnewString(((NI) ((s ? s->Sup.len : 0))));
|
|
nimln_(299, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
|
|
nimln_(300, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
if (((NI) 0) < 0 || ((NI) 0) >= (result ? result->Sup.len : 0)){ raiseIndexError2(((NI) 0),(result ? result->Sup.len : 0)-1); }
|
|
nimln_(301, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((NI) 0) < 0 || ((NI) 0) >= (s ? s->Sup.len : 0)){ raiseIndexError2(((NI) 0),(s ? s->Sup.len : 0)-1); }
|
|
result->data[((NI) 0)] = s->data[((NI) 0)];
|
|
nimln_(302, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
j = ((NI) 1);
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_97;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(303, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt((s ? s->Sup.len : 0), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_97)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_97);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 1);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_101;
|
|
if (!(res <= colontmp_)) goto LA7;
|
|
nimln_(303, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_98;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_99;
|
|
nimln_(304, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (!(((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)))) goto LA10_;
|
|
if (j < 0 || j >= (result ? result->Sup.len : 0)){ raiseIndexError2(j,(result ? result->Sup.len : 0)-1); }
|
|
nimln_(305, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (nimAddInt(((NU8)(s->data[i])), ((NI) 32), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_98)) { raiseOverflow(); };
|
|
if (((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_98)) < ((NI) 0) || ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_98)) > ((NI) 255)){ raiseRangeErrorI((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_98), ((NI) 0), ((NI) 255)); }
|
|
result->data[j] = ((NIM_CHAR) (((NI) ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_98)))));
|
|
nimln_(306, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_99)) { raiseOverflow(); };
|
|
j = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_99);
|
|
}
|
|
goto LA8_;
|
|
LA10_: ;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_100;
|
|
nimln_(307, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (!!(((NU8)(s->data[i]) == (NU8)(95)))) goto LA13_;
|
|
if (j < 0 || j >= (result ? result->Sup.len : 0)){ raiseIndexError2(j,(result ? result->Sup.len : 0)-1); }
|
|
nimln_(308, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
result->data[j] = s->data[i];
|
|
nimln_(309, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_100)) { raiseOverflow(); };
|
|
j = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_100);
|
|
}
|
|
goto LA8_;
|
|
LA13_: ;
|
|
LA8_: ;
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_101)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_101);
|
|
} LA7: ;
|
|
}
|
|
}
|
|
nimln_(310, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!!((j == (s ? s->Sup.len : 0)))) goto LA17_;
|
|
if ((j) < ((NI) 0) || (j) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(j, ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = setLengthStr(result, ((NI) (j)));
|
|
}
|
|
LA17_: ;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tyEnum_DownloadMethod__IqkMKe5PGkzDG0ayIWPJ6w, parseEnum__nimblepkgZlockfile_2133)(NimStringDesc* s) {
|
|
tyEnum_DownloadMethod__IqkMKe5PGkzDG0ayIWPJ6w result;
|
|
NimStringDesc* T1_;
|
|
nimfr_("parseEnum", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (tyEnum_DownloadMethod__IqkMKe5PGkzDG0ayIWPJ6w)0;
|
|
nimln_(1240, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(1257, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(32, "/home/yyoncho/Sources/nim/Nim/lib/std/enumutils.nim");
|
|
T1_ = NIM_NIL;
|
|
T1_ = nimIdentNormalize__pureZstrutils_121(s);
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_102))) goto LA2_;
|
|
if (eqStrings(T1_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_103))) goto LA3_;
|
|
goto LA4_;
|
|
LA2_: ;
|
|
{
|
|
result = ((tyEnum_DownloadMethod__IqkMKe5PGkzDG0ayIWPJ6w) 0);
|
|
}
|
|
goto LA5_;
|
|
LA3_: ;
|
|
{
|
|
result = ((tyEnum_DownloadMethod__IqkMKe5PGkzDG0ayIWPJ6w) 1);
|
|
}
|
|
goto LA5_;
|
|
LA4_: ;
|
|
{
|
|
tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T9_;
|
|
NimStringDesc* T10_;
|
|
T9_ = NIM_NIL;
|
|
T9_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
|
|
(*T9_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
|
|
(*T9_).Sup.Sup.name = "ValueError";
|
|
nimln_(76, "/home/yyoncho/Sources/nim/Nim/lib/std/enumutils.nim");
|
|
T10_ = NIM_NIL;
|
|
T10_ = rawNewString((s ? s->Sup.len : 0) + 20);
|
|
appendString(T10_, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_104));
|
|
appendString(T10_, s);
|
|
asgnRef((void**) (&(*T9_).Sup.Sup.message), T10_);
|
|
asgnRef((void**) (&(*T9_).Sup.Sup.parent), ((Exception*) NIM_NIL));
|
|
nimln_(75, "/home/yyoncho/Sources/nim/Nim/lib/std/enumutils.nim");
|
|
raiseExceptionEx((Exception*)T9_, "ValueError", "parseEnum", "/home/yyoncho/Sources/nim/Nim/lib/std/enumutils.nim", 75);
|
|
}
|
|
LA5_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToUpperAsciiStr)(NimStringDesc* s) {
|
|
NimStringDesc* result;
|
|
nimfr_("toUpperAscii", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(223, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((s ? s->Sup.len : 0)) < ((NI) 0) || ((s ? s->Sup.len : 0)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((s ? s->Sup.len : 0), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = mnewString(((NI) ((s ? s->Sup.len : 0))));
|
|
{
|
|
NI iX60gensym11_;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_105;
|
|
NI res;
|
|
iX60gensym11_ = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(224, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt((s ? s->Sup.len : 0), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_105)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_105);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 0);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_106;
|
|
if (!(res <= colontmp_)) goto LA3;
|
|
nimln_(270, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
iX60gensym11_ = res;
|
|
if (iX60gensym11_ < 0 || iX60gensym11_ >= (result ? result->Sup.len : 0)){ raiseIndexError2(iX60gensym11_,(result ? result->Sup.len : 0)-1); }
|
|
if (iX60gensym11_ < 0 || iX60gensym11_ >= (s ? s->Sup.len : 0)){ raiseIndexError2(iX60gensym11_,(s ? s->Sup.len : 0)-1); }
|
|
result->data[iX60gensym11_] = nsuToUpperAsciiChar(s->data[iX60gensym11_]);
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_106)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_106);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitCharSet)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw seps, NI maxsplit) {
|
|
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
|
|
nimfr_("split", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(414, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
{
|
|
NimStringDesc* xX60gensym67_;
|
|
NI lastX60gensym36_;
|
|
NI splitsX60gensym36_;
|
|
xX60gensym67_ = NIM_NIL;
|
|
nimln_(386, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
lastX60gensym36_ = ((NI) 0);
|
|
nimln_(387, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
splitsX60gensym36_ = maxsplit;
|
|
{
|
|
nimln_(496, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI firstX60gensym36_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_108;
|
|
NI T12_;
|
|
NimStringDesc* T13_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_109;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_110;
|
|
nimln_(389, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (!(lastX60gensym36_ <= (s ? s->Sup.len : 0))) goto LA3;
|
|
nimln_(390, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
firstX60gensym36_ = lastX60gensym36_;
|
|
{
|
|
nimln_(391, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T6_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_107;
|
|
T6_ = (NIM_BOOL)0;
|
|
T6_ = (lastX60gensym36_ < (s ? s->Sup.len : 0));
|
|
if (!(T6_)) goto LA7_;
|
|
if (lastX60gensym36_ < 0 || lastX60gensym36_ >= (s ? s->Sup.len : 0)){ raiseIndexError2(lastX60gensym36_,(s ? s->Sup.len : 0)-1); }
|
|
T6_ = !(((seps[(NU)(((NU8)(s->data[lastX60gensym36_])))>>3] &(1U<<((NU)(((NU8)(s->data[lastX60gensym36_])))&7U)))!=0));
|
|
LA7_: ;
|
|
if (!T6_) goto LA5;
|
|
nimln_(392, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(lastX60gensym36_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_107)) { raiseOverflow(); };
|
|
lastX60gensym36_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_107);
|
|
} LA5: ;
|
|
}
|
|
nimln_(393, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(splitsX60gensym36_ == ((NI) 0))) goto LA10_;
|
|
lastX60gensym36_ = (s ? s->Sup.len : 0);
|
|
}
|
|
LA10_: ;
|
|
nimln_(739, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(394, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(lastX60gensym36_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_108)) { raiseOverflow(); };
|
|
nimln_(739, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
xX60gensym67_ = substr__system_8704(s, firstX60gensym36_, (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_108));
|
|
result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
|
|
T12_ = result->Sup.len++;
|
|
T13_ = NIM_NIL;
|
|
T13_ = result->data[T12_]; result->data[T12_] = copyStringRC1(xX60gensym67_);
|
|
if (T13_) nimGCunrefNoCycle(T13_);
|
|
nimln_(395, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(splitsX60gensym36_ == ((NI) 0))) goto LA16_;
|
|
goto LA2;
|
|
}
|
|
LA16_: ;
|
|
nimln_(396, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(splitsX60gensym36_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_109)) { raiseOverflow(); };
|
|
splitsX60gensym36_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_109);
|
|
nimln_(397, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(lastX60gensym36_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_110)) { raiseOverflow(); };
|
|
lastX60gensym36_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_110);
|
|
} LA3: ;
|
|
} LA2: ;
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
|
|
(*dest).data[(*dest).Sup.len] = c;
|
|
(*dest).data[(NI)((*dest).Sup.len + ((NI) 1))] = 0;
|
|
(*dest).Sup.len += ((NI) 1);
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuIntToStr)(NI x, NI minchars) {
|
|
NimStringDesc* result;
|
|
nimfr_("intToStr", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(1078, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (x == (IL64(-9223372036854775807) - IL64(1))){ raiseOverflow(); }
|
|
result = dollar___systemZdollars_8((x > 0? (x) : -(x)));
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_111;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(1079, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(((NI) (minchars)), (result ? result->Sup.len : 0), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_111)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_111);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 1);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NimStringDesc* T4_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_112;
|
|
if (!(res <= colontmp_)) goto LA3;
|
|
nimln_(1079, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
T4_ = NIM_NIL;
|
|
T4_ = rawNewString((result ? result->Sup.len : 0) + 1);
|
|
appendChar(T4_, 48);
|
|
appendString(T4_, result);
|
|
result = T4_;
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_112)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_112);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
nimln_(1081, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NimStringDesc* T9_;
|
|
if (!(x < ((NI) 0))) goto LA7_;
|
|
nimln_(1082, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T9_ = NIM_NIL;
|
|
T9_ = rawNewString((result ? result->Sup.len : 0) + 1);
|
|
appendChar(T9_, 45);
|
|
appendString(T9_, result);
|
|
result = T9_;
|
|
}
|
|
LA7_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by) {
|
|
NimStringDesc* result;
|
|
NI subLen;
|
|
nimfr_("replace", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(2129, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NimStringDesc*) NIM_NIL);
|
|
nimln_(2130, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
subLen = (sub ? sub->Sup.len : 0);
|
|
nimln_(2131, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(subLen == ((NI) 0))) goto LA3_;
|
|
nimln_(2132, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = copyString(s);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
NIM_CHAR c;
|
|
NI last;
|
|
NI i;
|
|
NimStringDesc* T15_;
|
|
nimln_(2133, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (!(subLen == ((NI) 1))) goto LA6_;
|
|
nimln_(2136, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((NI) 0) < 0 || ((NI) 0) >= (sub ? sub->Sup.len : 0)){ raiseIndexError2(((NI) 0),(sub ? sub->Sup.len : 0)-1); }
|
|
c = sub->data[((NI) 0)];
|
|
nimln_(2137, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
last = ((s ? s->Sup.len : 0)-1);
|
|
nimln_(2138, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = ((NI) 0);
|
|
{
|
|
nimln_(2139, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI j;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_113;
|
|
NimStringDesc* T14_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_114;
|
|
nimln_(2140, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if ((i) < ((NI) 0) || (i) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(i, ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
j = nsuFindChar(s, c, ((NI) (i)), last);
|
|
nimln_(2141, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(j < ((NI) 0))) goto LA12_;
|
|
goto LA8;
|
|
}
|
|
LA12_: ;
|
|
nimln_(2142, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(j, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_113)) { raiseOverflow(); };
|
|
T14_ = NIM_NIL;
|
|
T14_ = substr__system_8704(s, i, (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_113));
|
|
result = resizeString(result, (T14_ ? T14_->Sup.len : 0) + 0);
|
|
appendString(result, T14_);
|
|
nimln_(2143, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, (by ? by->Sup.len : 0) + 0);
|
|
appendString(result, by);
|
|
nimln_(2144, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j, subLen, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_114)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_114);
|
|
}
|
|
} LA8: ;
|
|
nimln_(2146, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T15_ = NIM_NIL;
|
|
T15_ = substr__system_8716(s, i);
|
|
result = resizeString(result, (T15_ ? T15_->Sup.len : 0) + 0);
|
|
appendString(result, T15_);
|
|
}
|
|
goto LA1_;
|
|
LA6_: ;
|
|
{
|
|
tyArray__9cc9aPiDa8VaWjVcFLabEDZQ a;
|
|
NI last_2;
|
|
NI i_2;
|
|
NimStringDesc* T24_;
|
|
nimZeroMem((void*)a, sizeof(tyArray__9cc9aPiDa8VaWjVcFLabEDZQ));
|
|
nimln_(2148, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nsuInitNewSkipTable(sub, a);
|
|
nimln_(2149, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
last_2 = ((s ? s->Sup.len : 0)-1);
|
|
nimln_(2150, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i_2 = ((NI) 0);
|
|
{
|
|
nimln_(2151, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI j_2;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_115;
|
|
NimStringDesc* T23_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_116;
|
|
nimln_(2152, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if ((i_2) < ((NI) 0) || (i_2) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(i_2, ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
j_2 = nsuFindStrA(a, s, sub, ((NI) (i_2)), last_2);
|
|
nimln_(2153, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(j_2 < ((NI) 0))) goto LA21_;
|
|
goto LA17;
|
|
}
|
|
LA21_: ;
|
|
nimln_(2154, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(j_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_115)) { raiseOverflow(); };
|
|
T23_ = NIM_NIL;
|
|
T23_ = substr__system_8704(s, i_2, (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_115));
|
|
result = resizeString(result, (T23_ ? T23_->Sup.len : 0) + 0);
|
|
appendString(result, T23_);
|
|
nimln_(2155, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, (by ? by->Sup.len : 0) + 0);
|
|
appendString(result, by);
|
|
nimln_(2156, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(j_2, subLen, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_116)) { raiseOverflow(); };
|
|
i_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_116);
|
|
}
|
|
} LA17: ;
|
|
nimln_(2158, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T24_ = NIM_NIL;
|
|
T24_ = substr__system_8716(s, i_2);
|
|
result = resizeString(result, (T24_ ? T24_->Sup.len : 0) + 0);
|
|
appendString(result, T24_);
|
|
}
|
|
LA1_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitLines)(NimStringDesc* s, NIM_BOOL keepEol) {
|
|
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
|
|
nimfr_("splitLines", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(414, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
{
|
|
NimStringDesc* xX60gensym75_;
|
|
NI first;
|
|
NI last;
|
|
NI eolpos;
|
|
xX60gensym75_ = NIM_NIL;
|
|
nimln_(650, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
first = ((NI) 0);
|
|
nimln_(651, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
last = ((NI) 0);
|
|
nimln_(652, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
eolpos = ((NI) 0);
|
|
{
|
|
nimln_(653, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI T25_;
|
|
NI T31_;
|
|
NimStringDesc* T32_;
|
|
{
|
|
nimln_(654, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T6_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_117;
|
|
T6_ = (NIM_BOOL)0;
|
|
T6_ = (last < (s ? s->Sup.len : 0));
|
|
if (!(T6_)) goto LA7_;
|
|
if (last < 0 || last >= (s ? s->Sup.len : 0)){ raiseIndexError2(last,(s ? s->Sup.len : 0)-1); }
|
|
T6_ = !((((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10))));
|
|
LA7_: ;
|
|
if (!T6_) goto LA5;
|
|
if (nimAddInt(last, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_117)) { raiseOverflow(); };
|
|
last = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_117);
|
|
} LA5: ;
|
|
}
|
|
nimln_(656, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
eolpos = last;
|
|
nimln_(657, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(last < (s ? s->Sup.len : 0))) goto LA10_;
|
|
nimln_(658, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_118;
|
|
if (last < 0 || last >= (s ? s->Sup.len : 0)){ raiseIndexError2(last,(s ? s->Sup.len : 0)-1); }
|
|
if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA14_;
|
|
if (nimAddInt(last, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_118)) { raiseOverflow(); };
|
|
last = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_118);
|
|
}
|
|
goto LA12_;
|
|
LA14_: ;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_119;
|
|
nimln_(659, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (last < 0 || last >= (s ? s->Sup.len : 0)){ raiseIndexError2(last,(s ? s->Sup.len : 0)-1); }
|
|
if (!((NU8)(s->data[last]) == (NU8)(13))) goto LA17_;
|
|
nimln_(660, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(last, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_119)) { raiseOverflow(); };
|
|
last = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_119);
|
|
nimln_(661, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T21_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_120;
|
|
T21_ = (NIM_BOOL)0;
|
|
T21_ = (last < (s ? s->Sup.len : 0));
|
|
if (!(T21_)) goto LA22_;
|
|
if (last < 0 || last >= (s ? s->Sup.len : 0)){ raiseIndexError2(last,(s ? s->Sup.len : 0)-1); }
|
|
T21_ = ((NU8)(s->data[last]) == (NU8)(10));
|
|
LA22_: ;
|
|
if (!T21_) goto LA23_;
|
|
if (nimAddInt(last, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_120)) { raiseOverflow(); };
|
|
last = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_120);
|
|
}
|
|
LA23_: ;
|
|
}
|
|
goto LA12_;
|
|
LA17_: ;
|
|
LA12_: ;
|
|
}
|
|
LA10_: ;
|
|
nimln_(864, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T25_ = (NI)0;
|
|
nimln_(663, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_121;
|
|
if (!keepEol) goto LA28_;
|
|
if (nimSubInt(last, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_121)) { raiseOverflow(); };
|
|
T25_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_121);
|
|
}
|
|
goto LA26_;
|
|
LA28_: ;
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_122;
|
|
if (nimSubInt(eolpos, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_122)) { raiseOverflow(); };
|
|
T25_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_122);
|
|
}
|
|
LA26_: ;
|
|
nimln_(864, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
xX60gensym75_ = substr__system_8704(s, first, T25_);
|
|
result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
|
|
T31_ = result->Sup.len++;
|
|
T32_ = NIM_NIL;
|
|
T32_ = result->data[T31_]; result->data[T31_] = copyStringRC1(xX60gensym75_);
|
|
if (T32_) nimGCunrefNoCycle(T32_);
|
|
nimln_(666, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(eolpos == last)) goto LA35_;
|
|
nimln_(667, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
goto LA2;
|
|
}
|
|
LA35_: ;
|
|
nimln_(669, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
first = last;
|
|
}
|
|
} LA2: ;
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuReplaceChar)(NimStringDesc* s, NIM_CHAR sub, NIM_CHAR by) {
|
|
NimStringDesc* result;
|
|
NI i;
|
|
nimfr_("replace", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(2172, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (((s ? s->Sup.len : 0)) < ((NI) 0) || ((s ? s->Sup.len : 0)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((s ? s->Sup.len : 0), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = mnewString(((NI) ((s ? s->Sup.len : 0))));
|
|
nimln_(2173, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = ((NI) 0);
|
|
{
|
|
nimln_(2174, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_123;
|
|
if (!(i < (s ? s->Sup.len : 0))) goto LA2;
|
|
nimln_(2175, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (!((NU8)(s->data[i]) == (NU8)(sub))) goto LA5_;
|
|
if (i < 0 || i >= (result ? result->Sup.len : 0)){ raiseIndexError2(i,(result ? result->Sup.len : 0)-1); }
|
|
result->data[i] = by;
|
|
}
|
|
goto LA3_;
|
|
LA5_: ;
|
|
{
|
|
if (i < 0 || i >= (result ? result->Sup.len : 0)){ raiseIndexError2(i,(result ? result->Sup.len : 0)-1); }
|
|
nimln_(2176, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
result->data[i] = s->data[i];
|
|
}
|
|
LA3_: ;
|
|
nimln_(2177, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_123)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_123);
|
|
} LA2: ;
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHexImpl__pureZstrutils_733)(NU64 x, NI len, NIM_BOOL handleNegative) {
|
|
NimStringDesc* result;
|
|
NU64 n;
|
|
nimfr_("toHexImpl", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(925, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
n = x;
|
|
nimln_(926, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = mnewString(((NI) (len)));
|
|
{
|
|
NI j;
|
|
NI colontmp_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_124;
|
|
NI res;
|
|
j = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(927, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(((NI) (len)), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_124)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_124);
|
|
nimln_(33, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = colontmp_;
|
|
{
|
|
nimln_(34, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_126;
|
|
if (!(((NI) 0) <= res)) goto LA3;
|
|
nimln_(927, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
j = res;
|
|
if (j < 0 || j >= (result ? result->Sup.len : 0)){ raiseIndexError2(j,(result ? result->Sup.len : 0)-1); }
|
|
nimln_(928, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if ((NU64)(n & 15ULL) < 0 || (NU64)(n & 15ULL) >= (((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_125) ? ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_125)->Sup.len : 0)){ raiseIndexError2((NU64)(n & 15ULL),(((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_125) ? ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_125)->Sup.len : 0)-1); }
|
|
result->data[j] = ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_125)->data[(NU64)(n & 15ULL)];
|
|
nimln_(929, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
n = (NU64)((NU64)(n) >> (NU64)(((NI) 4)));
|
|
nimln_(927, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NIM_BOOL T6_;
|
|
nimln_(931, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T6_ = (NIM_BOOL)0;
|
|
T6_ = (n == 0ULL);
|
|
if (!(T6_)) goto LA7_;
|
|
T6_ = handleNegative;
|
|
LA7_: ;
|
|
if (!T6_) goto LA8_;
|
|
n = 18446744073709551615ULL;
|
|
}
|
|
LA8_: ;
|
|
nimln_(36, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimSubInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_126)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_126);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__pureZstrutils_1878)(NI x, NI len) {
|
|
NimStringDesc* result;
|
|
nimfr_("toHex", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(934, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(947, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = toHexImpl__pureZstrutils_733(((NU64) (x)), len, (x < ((NI) 0)));
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuRFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last) {
|
|
NI result;
|
|
NI last_2;
|
|
nimfr_("rfind", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(1988, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(last == ((NI) -1))) goto LA3_;
|
|
last_2 = ((s ? s->Sup.len : 0)-1);
|
|
}
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{
|
|
last_2 = last;
|
|
}
|
|
LA1_: ;
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(1989, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
colontmp_ = ((NI) (start));
|
|
nimln_(33, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = last_2;
|
|
{
|
|
nimln_(34, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_127;
|
|
if (!(colontmp_ <= res)) goto LA8;
|
|
nimln_(1989, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
{
|
|
nimln_(1990, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
if (!((NU8)(sub) == (NU8)(s->data[i]))) goto LA11_;
|
|
result = i;
|
|
goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
nimln_(36, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimSubInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_127)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_127);
|
|
} LA8: ;
|
|
}
|
|
}
|
|
nimln_(1991, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NI, nsuRFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last) {
|
|
NI result;
|
|
NI last_2;
|
|
nimfr_("rfind", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NI)0;
|
|
nimln_(2024, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!((sub ? sub->Sup.len : 0) == ((NI) 0))) goto LA3_;
|
|
nimln_(2025, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
nimln_(2026, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_128;
|
|
if (nimSubInt((s ? s->Sup.len : 0), ((NI) (start)), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_128)) { raiseOverflow(); };
|
|
if (!((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_128) < (sub ? sub->Sup.len : 0))) goto LA7_;
|
|
nimln_(2027, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
nimln_(2028, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(last == ((NI) -1))) goto LA11_;
|
|
last_2 = ((s ? s->Sup.len : 0)-1);
|
|
}
|
|
goto LA9_;
|
|
LA11_: ;
|
|
{
|
|
last_2 = last;
|
|
}
|
|
LA9_: ;
|
|
nimln_(2029, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) 0);
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI colontmp__2;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_129;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_130;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
colontmp__2 = (NI)0;
|
|
nimln_(2030, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(last_2, (sub ? sub->Sup.len : 0), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_129)) { raiseOverflow(); };
|
|
if (nimAddInt((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_129), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_130)) { raiseOverflow(); };
|
|
colontmp_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_130);
|
|
colontmp__2 = ((NI) (start));
|
|
nimln_(33, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = colontmp_;
|
|
{
|
|
nimln_(34, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_134;
|
|
if (!(colontmp__2 <= res)) goto LA16;
|
|
nimln_(2030, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
{
|
|
NI j;
|
|
NI colontmp__3;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_131;
|
|
NI res_2;
|
|
j = (NI)0;
|
|
colontmp__3 = (NI)0;
|
|
nimln_(2031, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt((sub ? sub->Sup.len : 0), ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_131)) { raiseOverflow(); };
|
|
colontmp__3 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_131);
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res_2 = ((NI) 0);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_133;
|
|
if (!(res_2 <= colontmp__3)) goto LA19;
|
|
nimln_(2031, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
j = res_2;
|
|
nimln_(2032, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = i;
|
|
nimln_(2031, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_132;
|
|
nimln_(2033, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (j < 0 || j >= (sub ? sub->Sup.len : 0)){ raiseIndexError2(j,(sub ? sub->Sup.len : 0)-1); }
|
|
if (nimAddInt(i, j, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_132)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_132) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_132) >= (s ? s->Sup.len : 0)){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_132),(s ? s->Sup.len : 0)-1); }
|
|
if (!!(((NU8)(sub->data[j]) == (NU8)(s->data[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_132)])))) goto LA22_;
|
|
nimln_(2034, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
nimln_(2035, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
goto LA17;
|
|
}
|
|
LA22_: ;
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_133)) { raiseOverflow(); };
|
|
res_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_133);
|
|
} LA19: ;
|
|
}
|
|
} LA17: ;
|
|
nimln_(2030, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
nimln_(2036, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (!!((result == ((NI) -1)))) goto LA26_;
|
|
goto BeforeRet_;
|
|
}
|
|
LA26_: ;
|
|
nimln_(36, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimSubInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_134)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_134);
|
|
} LA16: ;
|
|
}
|
|
}
|
|
nimln_(2037, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NI) -1);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, substrEq__pureZstrutils_245)(NimStringDesc* s, NI pos, NimStringDesc* substr) {
|
|
NIM_BOOL result;
|
|
NI i;
|
|
NI length;
|
|
nimfr_("substrEq", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{ result = (NIM_BOOL)0;
|
|
nimln_(369, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = ((NI) 0);
|
|
nimln_(370, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
length = (substr ? substr->Sup.len : 0);
|
|
{
|
|
nimln_(371, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T3_;
|
|
NIM_BOOL T4_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_136;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_137;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_138;
|
|
T3_ = (NIM_BOOL)0;
|
|
T4_ = (NIM_BOOL)0;
|
|
T4_ = (i < length);
|
|
if (!(T4_)) goto LA5_;
|
|
if (nimAddInt(pos, i, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_136)) { raiseOverflow(); };
|
|
T4_ = ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_136) < (s ? s->Sup.len : 0));
|
|
LA5_: ;
|
|
T3_ = T4_;
|
|
if (!(T3_)) goto LA6_;
|
|
if (nimAddInt(pos, i, &TM__JGc9b9bh2D3nTdUR7TGyq8aA_137)) { raiseOverflow(); };
|
|
if ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_137) < 0 || (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_137) >= (s ? s->Sup.len : 0)){ raiseIndexError2((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_137),(s ? s->Sup.len : 0)-1); }
|
|
if (i < 0 || i >= (substr ? substr->Sup.len : 0)){ raiseIndexError2(i,(substr ? substr->Sup.len : 0)-1); }
|
|
T3_ = ((NU8)(s->data[(NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_137)]) == (NU8)(substr->data[i]));
|
|
LA6_: ;
|
|
if (!T3_) goto LA2;
|
|
nimln_(372, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_138)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_138);
|
|
} LA2: ;
|
|
}
|
|
nimln_(373, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = (i == length);
|
|
goto BeforeRet_;
|
|
}BeforeRet_: ;
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitString)(NimStringDesc* s, NimStringDesc* sep, NI maxsplit) {
|
|
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
|
|
nimfr_("split", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(760, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!!((((NI) 0) < (sep ? sep->Sup.len : 0)))) goto LA3_;
|
|
failedAssertImpl__stdZassertions_56(((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_135));
|
|
}
|
|
LA3_: ;
|
|
nimln_(414, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
{
|
|
NimStringDesc* xX60gensym71_;
|
|
NI lastX60gensym40_;
|
|
NI splitsX60gensym40_;
|
|
xX60gensym71_ = NIM_NIL;
|
|
nimln_(386, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
lastX60gensym40_ = ((NI) 0);
|
|
nimln_(387, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
splitsX60gensym40_ = maxsplit;
|
|
{
|
|
nimln_(520, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NI firstX60gensym40_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_140;
|
|
NI T17_;
|
|
NimStringDesc* T18_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_141;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_142;
|
|
nimln_(389, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (!(lastX60gensym40_ <= (s ? s->Sup.len : 0))) goto LA7;
|
|
nimln_(390, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
firstX60gensym40_ = lastX60gensym40_;
|
|
{
|
|
nimln_(391, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
while (1) {
|
|
NIM_BOOL T10_;
|
|
NIM_BOOL T12_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_139;
|
|
T10_ = (NIM_BOOL)0;
|
|
T10_ = (lastX60gensym40_ < (s ? s->Sup.len : 0));
|
|
if (!(T10_)) goto LA11_;
|
|
T12_ = (NIM_BOOL)0;
|
|
T12_ = substrEq__pureZstrutils_245(s, lastX60gensym40_, sep);
|
|
T10_ = !(T12_);
|
|
LA11_: ;
|
|
if (!T10_) goto LA9;
|
|
nimln_(392, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(lastX60gensym40_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_139)) { raiseOverflow(); };
|
|
lastX60gensym40_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_139);
|
|
} LA9: ;
|
|
}
|
|
nimln_(393, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(splitsX60gensym40_ == ((NI) 0))) goto LA15_;
|
|
lastX60gensym40_ = (s ? s->Sup.len : 0);
|
|
}
|
|
LA15_: ;
|
|
nimln_(762, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(394, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(lastX60gensym40_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_140)) { raiseOverflow(); };
|
|
nimln_(762, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
xX60gensym71_ = substr__system_8704(s, firstX60gensym40_, (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_140));
|
|
result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
|
|
T17_ = result->Sup.len++;
|
|
T18_ = NIM_NIL;
|
|
T18_ = result->data[T17_]; result->data[T17_] = copyStringRC1(xX60gensym71_);
|
|
if (T18_) nimGCunrefNoCycle(T18_);
|
|
nimln_(395, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
{
|
|
if (!(splitsX60gensym40_ == ((NI) 0))) goto LA21_;
|
|
goto LA6;
|
|
}
|
|
LA21_: ;
|
|
nimln_(396, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimSubInt(splitsX60gensym40_, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_141)) { raiseOverflow(); };
|
|
splitsX60gensym40_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_141);
|
|
nimln_(397, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(520, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt(lastX60gensym40_, (sep ? sep->Sup.len : 0), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_142)) { raiseOverflow(); };
|
|
lastX60gensym40_ = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_142);
|
|
} LA7: ;
|
|
} LA6: ;
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHex__nimblepkgZdevelopfile_12880)(NI x) {
|
|
NimStringDesc* result;
|
|
nimfr_("toHex", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(950, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(954, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = toHexImpl__pureZstrutils_733(((NU64) (x)), ((NI) 16), (x < ((NI) 0)));
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, join__nimble_15267)(tyTuple__gn6QUEIsAwPk7TaTcZe9bEw* a, NI aLen_0, NimStringDesc* sep) {
|
|
NimStringDesc* result;
|
|
nimfr_("join", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(1817, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = ((NimStringDesc*) NIM_NIL);
|
|
{
|
|
NI i;
|
|
tyTuple__gn6QUEIsAwPk7TaTcZe9bEw x;
|
|
NI i_2;
|
|
i = (NI)0;
|
|
nimZeroMem((void*)(&x), sizeof(tyTuple__gn6QUEIsAwPk7TaTcZe9bEw));
|
|
nimln_(137, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
i_2 = ((NI) 0);
|
|
{
|
|
nimln_(138, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
while (1) {
|
|
NimStringDesc* T8_;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_143;
|
|
if (!(i_2 < aLen_0)) goto LA3;
|
|
nimln_(1818, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = i_2;
|
|
if (i_2 < 0 || i_2 >= aLen_0){ raiseIndexError2(i_2,aLen_0-1); }
|
|
x.Field0.version = a[i_2].Field0.version;
|
|
x.Field1.hashValue = a[i_2].Field1.hashValue;
|
|
{
|
|
nimln_(1819, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (!(((NI) 0) < i)) goto LA6_;
|
|
nimln_(1820, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, (sep ? sep->Sup.len : 0) + 0);
|
|
appendString(result, sep);
|
|
}
|
|
LA6_: ;
|
|
nimln_(1818, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
nimln_(1821, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T8_ = NIM_NIL;
|
|
T8_ = dollar___nimble_15297(x);
|
|
result = resizeString(result, (T8_ ? T8_->Sup.len : 0) + 0);
|
|
appendString(result, T8_);
|
|
nimln_(140, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
if (nimAddInt(i_2, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_143)) { raiseOverflow(); };
|
|
i_2 = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_143);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuEscape)(NimStringDesc* s, NimStringDesc* prefix, NimStringDesc* suffix) {
|
|
NimStringDesc* result;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_144;
|
|
nimfr_("escape", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(2297, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimAddInt((s ? s->Sup.len : 0), (NI)((NI64)((s ? s->Sup.len : 0)) >> (NU64)(((NI) 2))), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_144)) { raiseOverflow(); };
|
|
if (((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_144)) < ((NI) 0) || ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_144)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_144), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = rawNewString(((NI) ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_144))));
|
|
nimln_(2298, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, (prefix ? prefix->Sup.len : 0) + 0);
|
|
appendString(result, prefix);
|
|
{
|
|
NIM_CHAR c;
|
|
NI i;
|
|
NI L;
|
|
c = (NIM_CHAR)0;
|
|
nimln_(256, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
i = ((NI) 0);
|
|
nimln_(257, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
L = (s ? s->Sup.len : 0);
|
|
{
|
|
nimln_(258, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_149;
|
|
if (!(i < L)) goto LA3;
|
|
nimln_(2299, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (i < 0 || i >= (s ? s->Sup.len : 0)){ raiseIndexError2(i,(s ? s->Sup.len : 0)-1); }
|
|
c = s->data[i];
|
|
switch (((NU8)(c))) {
|
|
case 0 ... 31:
|
|
case 127 ... 255:
|
|
{
|
|
NimStringDesc* T5_;
|
|
nimln_(2302, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, 2);
|
|
appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_145));
|
|
nimln_(2303, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
T5_ = NIM_NIL;
|
|
T5_ = toHex__pureZstrutils_1878(((NU8)(c)), ((NI) 2));
|
|
result = resizeString(result, (T5_ ? T5_->Sup.len : 0) + 0);
|
|
appendString(result, T5_);
|
|
}
|
|
break;
|
|
case 92:
|
|
{
|
|
nimln_(2304, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, 2);
|
|
appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_146));
|
|
}
|
|
break;
|
|
case 39:
|
|
{
|
|
nimln_(2305, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, 2);
|
|
appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_147));
|
|
}
|
|
break;
|
|
case 34:
|
|
{
|
|
nimln_(2306, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, 2);
|
|
appendString(result, ((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_148));
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
nimln_(2307, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = addChar(result, c);
|
|
}
|
|
break;
|
|
}
|
|
nimln_(260, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
if (nimAddInt(i, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_149)) { raiseOverflow(); };
|
|
i = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_149);
|
|
nimln_(261, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators.nim");
|
|
{
|
|
if (!!(((s ? s->Sup.len : 0) == L))) goto LA12_;
|
|
failedAssertImpl__stdZassertions_56(((NimStringDesc*) &TM__JGc9b9bh2D3nTdUR7TGyq8aA_96));
|
|
}
|
|
LA12_: ;
|
|
} LA3: ;
|
|
}
|
|
}
|
|
nimln_(2308, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = resizeString(result, (suffix ? suffix->Sup.len : 0) + 0);
|
|
appendString(result, suffix);
|
|
popFrame();
|
|
return result;
|
|
}
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuRepeatStr)(NimStringDesc* s, NI n) {
|
|
NimStringDesc* result;
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_150;
|
|
nimfr_("repeat", "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
result = NIM_NIL;
|
|
nimln_(1292, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
if (nimMulInt(((NI) (n)), (s ? s->Sup.len : 0), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_150)) { raiseOverflow(); };
|
|
if (((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_150)) < ((NI) 0) || ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_150)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_150), ((NI) 0), ((NI) IL64(9223372036854775807))); }
|
|
result = rawNewString(((NI) ((NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_150))));
|
|
{
|
|
NI i;
|
|
NI colontmp_;
|
|
NI res;
|
|
i = (NI)0;
|
|
colontmp_ = (NI)0;
|
|
nimln_(1293, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
colontmp_ = ((NI) (n));
|
|
nimln_(90, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
res = ((NI) 1);
|
|
{
|
|
nimln_(91, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
while (1) {
|
|
NI TM__JGc9b9bh2D3nTdUR7TGyq8aA_151;
|
|
if (!(res <= colontmp_)) goto LA3;
|
|
nimln_(1293, "/home/yyoncho/Sources/nim/Nim/lib/pure/strutils.nim");
|
|
i = res;
|
|
result = resizeString(result, (s ? s->Sup.len : 0) + 0);
|
|
appendString(result, s);
|
|
nimln_(93, "/home/yyoncho/Sources/nim/Nim/lib/system/iterators_1.nim");
|
|
if (nimAddInt(res, ((NI) 1), &TM__JGc9b9bh2D3nTdUR7TGyq8aA_151)) { raiseOverflow(); };
|
|
res = (NI)(TM__JGc9b9bh2D3nTdUR7TGyq8aA_151);
|
|
} LA3: ;
|
|
}
|
|
}
|
|
popFrame();
|
|
return result;
|
|
}
|