summary refs log tree commit diff stats
path: root/lib/pure
Commit message (Collapse)AuthorAgeFilesLines
* post expr blocks colon fix + correct grammar (#21983)metagn2023-06-061-2/+2
| | | | | | | | | | | | | | | * post expr blocks colon fix + correct grammar fixes #21982 * fix dochelpers * this is remarkably common * use head for unchained * fix atlas * final grammar fix
* handle out of range value for `COLUMNS` / `LINES` (#21968)Etan Kissling2023-05-311-2/+2
| | | | | | | | | * handle out of range value for `COLUMNS` / `LINES` Querying terminal size may fail with a `ValueError` if size is too big. Return highest possible value instead. Note that `ValueError` is also reported on underflow (negative size) but that is out of POSIX specs. * `parseSaturatedNatural`
* make `proc` not implicitly convert to `pointer` with a preview define (#21953)metagn2023-05-301-1/+1
| | | | | | | | | * test `proc` not converting to `pointer` * ignore define for now to test * remove cstring * fixes, changelog
* alternative to #21914; split, rsplit now forbid an empty separator (#21961)ringabout2023-05-301-4/+22
|
* fixes #21734; backport (#21957)Andreas Rumpf2023-05-292-3/+3
|
* Suggest files and paths modules (#21950)Federico Ceratto2023-05-291-0/+1
|
* Fix documentation typo in endians.nim (#21949)Simon Krauter2023-05-281-1/+1
|
* Fix const in async regression (#21898)Jake Leahy2023-05-251-7/+5
| | | | | | | | | * Add test case for a const being used inside an async proc * Use `typeof` to get the type of the block instead of overloaded templates This removes the problem with the symbol having different types I am unsure why I didn't use this in the first place. IIRC I had problems with `typeof` when I first tried to use it in the original implementation
* Improve times (#21901)Juan Carlos2023-05-241-12/+21
| | | | | * . * Improve times
* js -r defines nodejs & program result undeclared if unavailable (#21849)metagn2023-05-241-0/+6
| | | | | | | | | | | * js -r defines nodejs & program result undefined if unavailable fixes #16985, fixes #16074 * fix * add changelog too * minor word change
* fix #21251 Compiler SIGSEGV when using SharedTable (#21876)Bung2023-05-233-8/+7
| | | fix #21251
* Weekday parse/format (replacement) (#21857)Carlo Capocasa2023-05-211-30/+110
| | | | | * parsing capability for iso week year * remove outdated test
* Update threadpool.nim with correct link to typedthreads module (#21865)noah edward hall2023-05-191-1/+1
|
* Add `minmax` to comparisons (#21820)Matt Wilson2023-05-121-0/+9
| | | | | | | | | | | | | | * Add `minmax` to sequtils This adds a `minmax` proc to complement `min` and `max`; it computes both results in a single pass for efficiency. * Update lib/pure/collections/sequtils.nim * Add minmax note to changelog. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* clean up SOME pending/xxx/issue link comments (#21826)metagn2023-05-111-7/+5
| | | | | * clean up SOME pending/xxx/issue link comments * great
* fix #9423 followup #17594: distinct generics now work in VM (#21816)ringabout2023-05-101-7/+1
| | | | | | | | | * fix #9423 distinct generics now work in vm * fixes cpp tests --------- Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* fixes #21792; enable checks for sum, prod, cumsummed and cumsum (#21793)ringabout2023-05-051-60/+63
| | | | | | | * enable checks for sum, prod, cumsummed and cumsum * fixes #21792 * add test cases
* build documentation for `checksums/md5` and `checksums/sha1` (#21791)ringabout2023-05-042-2/+2
| | | | | * build documentation for md5 and sha1 * fixes documentation reference
* line info for strformat + fix issue with typed templates (#21761)metagn2023-05-021-8/+22
| | | | | * line info in strformat * also fix #20381
* fixes #19863; move sha1, md5 to nimble packages for 2.0 (#21702)ringabout2023-05-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move sha1, md5 to nimble packages * boot the compiler * fixes tests * build the documentation * fixes docs * lol, I forgot koch.nim * add `nimHasChecksums` define * clone checksums but maybe copying is better * bump nimble hash * use ChecksumsStableCommit * fixes tests * deprecate them * fixes paths * fixes koch
* fixes #20144; fixes asyncnet ssl on bsds (#21763)ringabout2023-05-011-2/+5
| | | fixes asyncnet on bsds
* fix build on haiku (#21752)Al Hoang2023-04-292-2/+2
| | | * missing maxDescriptors
* closes #21745 (#21746)ringabout2023-04-281-1/+0
|
* Fix json.to for float fields that are not present (#21695)Yardanico2023-04-211-1/+1
|
* warn on set types bigger than max size, default to 0..255 for int literals ↵metagn2023-04-171-5/+5
| | | | | | | | | | | | | | | | | | | (#21659) * test implicitly huge set types refs https://github.com/nim-lang/RFCs/issues/298 * oh my god * boot at least * don't error, fix remaining issues, no 2 len arrays * fix runnable example * test assuming 0..255 for int literal * test refactor, add changelog, test
* int64/uint64 as bigint in JS (#21613)metagn2023-04-114-15/+18
| | | | | | | | | | | * int64/uint64 as bigint in JS * fix CI * convert to compile option * fix lie * smaller diff, changelog entry
* `proc` typeclass accounts for `iterator`, call conventions + `nil` fix + ↵metagn2023-04-111-1/+1
| | | | | | | | | | | | | document typeclass AST (#21629) * test fix #16546 #16548 + another issue * please don't tell me other packages do this * fix CI + test typeclass callconv pragma * better logic in parser * docs and changelog
* terminal size env-vars have precendence in POSIX (#21643)Etan Kissling2023-04-111-10/+39
| | | | | | | In POSIX Base Definitions Section 8.1 Environment Variable Definition, it is explained that the `COLUMNS` and `LINES` environment variables, if present, take precedence over any other implementation-defined method to determine the terminal size. This is useful, for example, to capture output programmatically in simulations for various terminal sizes.
* fixes #21564; std/bitops: Add explicit type masking for the JS target (#21598)chmod2222023-04-031-3/+9
| | | | | | | | | | | | | | | | | | | * std/bitops: Add explicit type masking for the JS target Typecasts on the JavaScript backend do not function the same way as they do on C and C++ backends, so for bitwise operations we may need to mask them back down into their allowed range when they get shifted outside it. Since they do work as expected on the other backends, a default bitmask of all 1's is casted down into the target type as an easily optimizable "& 0xFF" operation for these backends. * Fixup: this should still be a func * Run test case on js target * Adapt testcase to contributor guide and best practices * Simplify constrain logic and turn into actual no-op for the C side
* Revert "Add `cursor` to lists iterator variables" (#21571)ringabout2023-03-281-3/+3
| | | | | Revert "Add `cursor` to lists iterator variables (#21527)" This reverts commit 3936071772d648f98c36e5aad16a341b86344e6c.
* Add `cursor` to lists iterator variables (#21527)Amjad Ben Hedhili2023-03-271-3/+3
| | | * followup #21507
* Add URI parsing warning (#21547)Federico Ceratto2023-03-202-0/+4
| | | | | Related to CVE-2021-41259 https://github.com/nim-lang/security/security/advisories/GHSA-3gg2-rw3q-qwgc https://github.com/nim-lang/Nim/pull/19128#issuecomment-1181944367
* fixes #21538; expand len template parameter once in newSeqWith (#21543)Eric N. Vander Weele2023-03-201-3/+3
| | | | | | | `len` could contain side effects and may result in different values when substituted twice in the template expansion. Instead, capture the result of substituting `len` once. closes: #21538
* Fix: #21541. Add support for xnVerbatimText (#21542)Mark Leyva2023-03-201-4/+4
| | | | to text and text= procs. Remove unnecessary LF for xnVerbatimText in $ proc.
* NuttX: use posix_spawn for osproc (#21539)Hiroki Noda2023-03-201-4/+6
| | | | | NuttX has standard posix_spawn interface, and can be used with it. * https://nuttx.apache.org/docs/12.0.0/reference/user/01_task_control.html#c.posix_spawn
* Add `cursor` annotations to lists iterator variables (#21507)Amjad Ben Hedhili2023-03-131-2/+2
| | | | | Add `cursor` annotations to iterator variables * See https://nim-lang.github.io/Nim/destructors.html#the-cursor-pragma
* Remove Defect from raises list in `std/times` (#21473)Jake Leahy2023-03-061-9/+15
| | | | | | | | | * Remove Defect from raises list Since defects aren't tracked anymore this causes a hint to pop up mentioning it * Still track Defect when getting ran with an older Nim version The raises followed a pattern so moving them into a pragma didn't seem to cause any extra problems
* Add warning to specify timeout value in milliseconds, Fix #21449 (#21471)Sultan Al Isaiee2023-03-041-0/+4
| | | a warning message been added to the documentation to remind users that the timeout parameter is expressed in milliseconds, not seconds. to help prevent confusion and unexpected behaviours.
* Allow `futureLogging` in release builds (#21448)Jake Leahy2023-03-021-1/+1
| | | | | | | * Add test case * Fixes 21447: Keeps stackTrace around when using futureLogging * Remove extra whitespace
* remove decades-deprecated Win32 API *A function support (#21315)tersec2023-03-025-101/+47
|
* asyncdispatch: for NuttX, add destructor to clear global dispatcher. (#21432)Century Systems2023-02-281-1/+12
| | | | | | | | | | | | | * asyncdispatch: for NuttX, add destructor to clear global dispatcher using atexit(). Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * std: exitprocs: remove "when defined(nuttx)" block. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> --------- Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* Use a cast to suppress KeyError raises (#21451)Antonis Geralis2023-02-281-4/+5
|
* Fix: nintendoswitch compilation (#21368)Dmitry Arkhipenko2023-02-251-1/+3
| | | | | * Fix: make nintendoswitch someGcc, remove symlink support for nintendoswitch, add getAppFilename for nintendoswitch * Fix: use getApplHeuristic on nintendoswitch
* fixes #21393 and misc style changes (#21419)Andreas Rumpf2023-02-243-18/+26
| | | | | | | | | * fixes #21393 and misc style changes * progress --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* ioselectors_epoll: for NuttX, limit initial numFD to configured value. (#21421)Century Systems2023-02-221-1/+6
| | | | | | | | | | | | | | | | | ioselectors: ioselectors_epoll: for NuttX, limit initial numFD to configured value. In the NuttX build config, there is a setting called "FS_NEPOLL_DESCRIPTORS". -------- config FS_NEPOLL_DESCRIPTORS int "Maximum number of default epoll descriptors for epoll_create1(2)" default 8 ---help--- The maximum number of default epoll descriptors for epoll_create1(2) -------- For NuttX, change the number of fd arrays allocated by newSelector() to that value. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* Make `Time` work with `std/strformat` (#21409)Jake Leahy2023-02-211-5/+1
| | | | | | | * Add test case * Remove formatValue template for `Time` It didn't handle empty specifier correctly which caused it to be blank with strformat
* NuttX added supports getrlimit(RLIMIT_NOFILE), so remove NuttX specific ↵Century Systems2023-02-212-6/+0
| | | | | | | codes. (#21385) async: NuttX added supports getrlimit(RLIMIT_NOFILE), so remove NuttX-specific codes. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* `std/xmltree` Add the type of the node when the assertion fails (#21383)Jake Leahy2023-02-171-22/+30
| | | | | Print the type of the node when the assertion fails This way the user actually knows what the type was instead of just knowing it failed
* Add support for NuttX RTOS. (#21372)Century Systems2023-02-167-11/+23
| | | | | | | | | | | | | | | | | | | | | | * Add support for NuttX RTOS. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * lib: pure: asyncdispatch: assign to result. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * lib: std: typedthreads: add support for parameters to adjust Thread Stack Size. Like FreeRTOS/Zephyr, add support for following configurations. -d:nimThreadStackSize=xxxxx -d:nimThreadStackGuard=yyyy Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> --------- Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* Fix `closeHandle` bug, add `setFileSize`, make `resize` work on Windows (#21375)c-blake2023-02-151-42/+81
| | | | | | | | | | | | | | * Add general purpose `setFileSize` (unexported for now). Use to simplify `memfiles.open` as well as make robust (via hard allocation, not merely `ftruncate` address space allocation) on systems with `posix_fallocate`. As part of this, fix a bad `closeHandle` return check bug on Windows and add `MemFile.resize` for Windows now that setFileSize makes that easier. * Adapt existing test to exercise newly portable `MemFile.resize`. * Since Apple has never provided `posix_fallocate`, provide a fallback. This is presently written in terms of `ftruncate`, but it can be improved to use `F_PREALLOCATE` instead, as mentioned in a comment.