summary refs log tree commit diff stats
path: root/lib/pure
Commit message (Collapse)AuthorAgeFilesLines
* improve fast returns of find and rfind (#18127)n5m2021-05-311-1/+3
|
* hashes for refs should be an opt-in feature (#18098)Miran2021-05-301-1/+1
|
* close #16569: deprecated `reversed(a, start, last)` overload, use ↵Timothee Cour2021-05-301-30/+11
| | | | | | | | | toOpenArray instead (#18047) * close #16569: deprecated reversed overload, use toOpenArray instead * [skip ci] change wording in changelog per review * fixup
* Move async example to asynchronous version of proc (#18078)xioren2021-05-241-7/+14
| | | | | | | | | | * improve runnableExamples in std/httpclient * Add synchronous example. * Update lib/pure/httpclient.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* close #18009 parseJson JInt vs JFloat; preserve -0.0 as JFloat to ↵Timothee Cour2021-05-231-1/+1
| | | | distinguish from 0.0 (#18067)
* asyncdispatch+stackTraceOverride: fix premature collection (#18039) ↵Ștefan Talpalaru2021-05-191-14/+32
| | | | | | | | | | | | | | | | | | | | | | [backport:1.2] Copying StackTraceEntry instances when nimStackTraceOverride is defined breaks the link between a cstring field that's supposed to point at another string field in the same object. Sometimes, the original object is garbage collected, that memory region reused for storing other strings, so when the StackTraceEntry copy tries to use its cstring pointer to construct a traceback message, it accesses unrelated strings. This only happens for async tracebacks and this patch prevents that by making sure we only use the string fields when nimStackTraceOverride is defined. Async tracebacks also beautified slightly by getting rid of an extra line that was supposed to be commented out, along with the corresponding debugging output. There's also a micro-optimisation to avoid concatenating two strings just to get their combined length.
* make strformat part of the prelude (#18046)Andreas Rumpf2021-05-191-1/+1
|
* add sink and lent annotations for xmltree and streams (#18037)Antonis Geralis2021-05-182-16/+16
|
* fix #18007: std/json now serializes nan,inf,-inf as strings instead of ↵Timothee Cour2021-05-161-50/+71
| | | | | | | | | | | | | | | | | invalid json (#18026) * fix #18007: std/json now serializes nan,inf,-inf as raw strings instead of invalid json * fix roundtrip * fix tests * fix changelog * simplify * add runnableExamples * fix typo [skip ci]
* fix #17467 1st call to rand is now non-skewed; allow seed == 0 (#17468)Timothee Cour2021-05-111-57/+36
| | | | | | | | | | | | | | | * fix #17467 1st call to rand is now non-skewed; allow passing 0 as seed * changelog + fallback * document behavior for seed == 0 * address comments * _ * fix tests, disable kdtree * re-enable kdtree with -d:nimLegacyRandomInitRand
* Revert "Fix parseUri to sanitize urls containing ASCII newline or tab ↵Andreas Rumpf2021-05-091-29/+3
| | | | | (#17967)" (#17984) This reverts commit f4dd95f3bee14b69caec63c3be984c4a75f43c8a.
* Fix parseUri to sanitize urls containing ASCII newline or tab (#17967)Beshr Kayali2021-05-091-3/+29
| | | | | | | | | | | | | | | | | | | * Fix parseUri to sanitize urls containing ASCII newline or tab * Fix ups based on review Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Additional fix ups based on review - Avoid unnecessary `removeUnsafeBytesFromUri` call if parseUri is strict - Move some parseUri tests to uri module test file Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> * Update changelog Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* merge `initUri()` overloads, improve uri examples (#17970)Timothee Cour2021-05-081-30/+11
| | | | | | | * deprecate `uri.initUri` and improve uri examples * remove `func initUri*()` and make isIpv6 optional * fixup
* ORC: cursor inference bugfix (#17973)Andreas Rumpf2021-05-081-2/+2
| | | | | * fixed a .cursor inference bug * added a test case
* fix #17941: UnusedImport works for var/let/const/type invoked inside a ↵Timothee Cour2021-05-082-2/+2
| | | | | | | generic (#17942) * fix #17941: UnusedImport works for var/let/const/type invoked inside a generic * fixup
* Export sslHandle in `net` and `asyncnet`. (#17573)Ardek Romak2021-05-062-0/+10
|
* parsecsv fix style (#17933)Juan Carlos2021-05-041-67/+64
| | | | | | | * ReSync with Devel * Fix style in parsecsv * Update lib/pure/parsecsv.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* typo: nonexistant => nonexistent (#17918)Timothee Cour2021-05-022-2/+2
| | | | | * typo: nonexistant => nonexistent * fix test (ordering differs because of https://github.com/nim-lang/Nim/issues/17910)
* fix #17911 rawProc for cpp (#17912)Timothee Cour2021-05-011-6/+12
|
* system.nim cleanup some exported constants which should never have be… ↵Andreas Rumpf2021-05-012-1/+3
| | | | | | (#17909) * system.nim cleanup some exported constants which should never have been exported
* [std/base64] uses runnableExamples (#17882)flywind2021-05-011-32/+30
| | | | | | * [std/base64] uses runnableExamples * Update lib/pure/base64.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fix #17905: hash(closure) was not being tested (#17906)Timothee Cour2021-04-301-12/+20
|
* fix #17888: remove undefined behavior for posix.open; fix ↵Timothee Cour2021-04-291-0/+1
| | | | | | | | | | | tempfiles.createTempFile (#17889) * fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile * fix for tests/async/tasyncfile.nim * hide mode for now * add notice regarding stability
* improve cache line size (#17885)flywind2021-04-291-6/+3
| | | | | | | | | | | | | * improve cache line size - 64bit system tend to use cache line of 64 bytes - add align https://trishagee.com/2011/07/22/dissecting_the_disruptor_why_its_so_fast_part_two__magic_cache_line_padding Though I'm not sure, what do you think? @timotheecour * Update lib/pure/concurrency/threadpool.nim
* [std/encodings]move to tests (#17866)flywind2021-04-291-72/+0
|
* Fix documentation of strutils.stripLineEnd (#17883)Michael Krieger2021-04-281-1/+1
| | | It does not return anything.
* [std/encodings] fix iconv headers on OpenBSD (#17872)flywind2021-04-271-1/+3
|
* [std/pegs] increase test coverage (#17871)flywind2021-04-271-144/+0
|
* [std/parsecfg]use runnableExamples (#17868)flywind2021-04-271-96/+95
| | | | | | | * [std/parsecfg]use runnableExamples * Apply suggestions from code review Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* add -d:nimLegacyNoHashRef for a transition period which avoids defining ↵Timothee Cour2021-04-271-17/+22
| | | | hash(ref) (#17858)
* fix gbk encodings on windows (#17843)flywind2021-04-261-0/+1
|
* Remove confusing <//> (#17830)flywind2021-04-264-22/+22
|
* add colon (#17834)flywind2021-04-242-2/+2
|
* Fix Httpclient headers from being modified accidentally (#17808)Joey2021-04-211-2/+5
|
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-2121-36/+35
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* [std/deques] move data instead of copy + destroy (#17800)flywind2021-04-201-4/+2
|
* Fix buffer-overrun bug in net (#17728) [backport:1.0]shirleyquirk2021-04-161-4/+3
|
* std/hashes: hash(ref|ptr|pointer) + other improvements (#17731)Timothee Cour2021-04-161-23/+49
|
* start using import {.all.} (#17736)Timothee Cour2021-04-161-22/+0
|
* simplify asyncfutures, asyncmacro (#17633)Timothee Cour2021-04-142-72/+31
|
* remove unnecessary assignment (#17702)flywind2021-04-121-1/+0
|
* followup strformat PR. backslash escapes, tests, docs (#17700)shirleyquirk2021-04-121-4/+29
| | | | | | | | | | | | | | | | | | | | | | * Allow use of colons inside fmt allowing colons inside fmt by replacing the format specifier delimiter lets arbitrary nim code be run within fmt expressions. Co-authored-by: flywind <xzsflywind@gmail.com> * formatting,documentation,backslash escapes Adding support for evaluating expressions by special-casing parentheses causes this regression: `&"""{ "(hello)" }"""` no longer parses. In addition, code such as &"""{(if open: '(' else: ')')}""" wouldn't work. To enable that, as well as the use of, e.g. Table constructors inside curlies, I've added backslash escapes. This also means that if/for/etc statements, unparenthesized, will work, if the colons are escaped, but i've left that under-documented. It's not exactly elegant having two types of escape, but I believe it's the least bad option. * changelog * added json strformat test * pulled my thumb out and wrote a parser Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: flywind <xzsflywind@gmail.com>
* [feature] add arbitrary code execution to strformat (#17694)shirleyquirk2021-04-111-9/+28
| | | | | | | | | * changed parser to ignore ':' within parens * Update strformat.nim * Update lib/pure/strformat.nim Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Genode platform fixes (#17521)Emery Hemingway2021-04-091-0/+26
| | | | | | | | | | | | | | | | | | | * Genode: move dyncall failures to runtime Do not use the "error" pragma to warn that dynamic library loading is not implemented, print a message at runtime and exit. * Genode: use stricter dataspace type in page allocator * Genode: remove compiler configuration from nim.cfg Self-hosting Nim is not supported on Genode and defining the cross-compilation environment can be done externally. * Genode: use new mutex API * Genode: call nim_component_construct as a C procedure * Genode: implement echo for NimStringV2
* hashes: Made the runnableExample easier to understand (#17689)Andreas Rumpf2021-04-091-1/+1
|
* further progress on rst roles & directives (fix #17646) (#17659)Andrey Makarov2021-04-086-11/+11
| | | | | | | * further progress on rst roles & dir-s (fix #17646) * fix documents according to the messages * fix bug 17 from #17340
* Improve endians module (#17674)konsumlamm2021-04-081-7/+42
| | | | Extend documentation Add runnableExamples
* use strstr for a faster find implementation (#17672)Andreas Rumpf2021-04-081-3/+26
| | | | | * use strstr for a faster find implementation * stress the -d:release and -d:danger switches
* use sink and lent in deques (#17661)flywind2021-04-071-10/+10
| | | | | | | | | * use sink and lent in deques * Update lib/pure/collections/deques.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* close #4451 (#17627)flywind2021-04-061-1/+2
|