summary refs log tree commit diff stats
path: root/lib/pure
Commit message (Collapse)AuthorAgeFilesLines
* move io out of system (#19442)flywind2022-02-0212-9/+42
| | | | | | | | | | | | | | | | | | | | | | | | | * move io out of system * fix tests * fix tests * next step * rename to syncio * rename * fix nimscript * comma * fix * fix parts of errors * good for now * fix test
* os: faster getFileSize (#19438)ehmry2022-01-241-5/+4
| | | | Use "stat" rather than "open", "seek", and "close" system calls. The Windows implementation remains the same.
* Resolve cross file resolution errors in atomics (#19422) [backport:1.6]James2022-01-201-10/+7
| | | | | * Resolve call undeclared routine testAndSet * Fix undeclared field atomicType
* Use openarray of bytes in md5 (#19307)hlaaftana2022-01-151-34/+97
| | | | | | | | | | * Use openarray of bytes in md5 * fix CI * cleanup * use noSideEffect for bootstrapping * fix CI again * actually fix CI by checking if it works * this is getting ridiculous * put old md5 version in compiler, remove vmop
* docs: Fix broken cross references to `rfind` in strutils (#19382) [backport]Leon2022-01-131-3/+3
| | | | | | Fixes three broken cross references to `rfind` in strutils. Breakage due to signature changes of the `rfind` methods. Co-authored-by: adigitoleo <adigitoleo@dissimulo.com>
* Fix `remove` on last node of singly-linked list [backport:1.6] (#19353)gecko2022-01-101-0/+2
|
* stylecheck usages part two: stdlib cleanup (#19338)flywind2022-01-081-1/+1
| | | | | | | | | | | | | * stylecheck usages part two: stdlib cleanup typeinfo.nim: importCompilerProc => importcompilerproc nre.nim: newLineFlags => newlineFlags system.nim: JSRoot => JsRoot ref #19319 * prefer importCompilerProc
* fix nim-lang#19343 (#19344) [backport]Zachary Marquez2022-01-081-1/+1
| | | | Ensure HttpClient onProgress is called once per second Ensure that reported speed is accurate
* Fix #19038 - making the Nim compiler work again on Windows XP (#19331)rockcavera2022-01-071-2/+3
| | | | | | | | | | | | | * Update osenv.nim * Update win_setenv.nim * Update lib/pure/includes/osenv.nim * Update lib/pure/includes/osenv.nim * fixing cstring Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Update net.nim (#19327) [backport]rockcavera2022-01-061-1/+1
|
* add std/private/win_getsysteminfo; refactor the usage of `GetSystemInfo` ↵flywind2022-01-042-35/+8
| | | | | | | | | | | (#19310) * add std/private/win_getsysteminfo * import at the top level * wrappers follow nep1 too * follow review comment
* devel: style fix (#19318)Ștefan Talpalaru2022-01-042-2/+2
| | | this allows "--styleCheck:usages --styleCheck:error"
* Fix #19314 - fixing broken `DoublyLinkedList` after adding empty ↵rockcavera2022-01-031-6/+6
| | | | | | | `DoublyLinkedList` (#19315) [backport] * Update lists.nim * Update tlists.nim
* Add Week-Of-Year Implementation to Times Module (#17223)Carlo Capocasa2022-01-031-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial * more tests * Apply suggestions from code review idiomatize Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * test iron age dates * add examples * fix typo * consistent param mention * add since pragrams * add changelog * Update lib/pure/times.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * fix examples * fix negative years * add getWeeksInYear tests * add back fix dropped by rebase * week-year tuple api * add changelog * fix doc tags * add docstrings * fix typos Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* [docs] clarify the raised exception (#19308)flywind2022-01-031-4/+4
| | | | | | | | | | | * [docs] clarify the raised exception Lest developers wanna know what the exception is. * Apply suggestions from @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Fix #19297 - fixing broken list after adding empty list (#19299)rockcavera2021-12-301-5/+6
| | | | | | | | | * Update lists.nim * Update tlists.nim * removed check `if b.tail != nil` The tail of the list being null it is still possible to retrieve its end by going through all nodes from the head. So checking for null from `b.tail` is unnecessary. However, setting `a.tail = b.tail` only if `a.head != nil`, so you don't break a good list with an already broken one.
* enable `maxDescriptors` on Illumos/Solaris (#19295)BarrOff2021-12-302-4/+4
|
* Fix #19107 (#19286) [backport]Tomohiro2021-12-251-2/+10
|
* Revert "Update uri.nim (#19148) [backport:1.0]" (#19280)Andreas Rumpf2021-12-231-2/+0
| | | This reverts commit a3ef5df680e55d9bf68027fcb0ec6358b4279d09.
* Update colors.nim (#19274)MichalMarsalek2021-12-201-145/+162
| | | | | | | | | | | * Update colors.nim Added `lightgray` alias to `lightgrey` and `...grey`aliases for the rest of the gray colors. Added color `rebeccapurple`. Fixed the incorrect values for the `PaleVioletRed` and `MediumPurple` colors. This module should now be matching the CSS colors. I used the seq[tuple] syntax for defining the names. * Document colors changes.
* use uppercase "type" for Proxy-Authorization header (#19273)xioren2021-12-191-1/+1
| | | | | Some servers will reject authorization requests with a lowercase "basic" type. Changing to "Basic" seems to solve these issues. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization
* [formatter] async.nim uses two spaces (#19264)flywind2021-12-171-4/+4
| | | according to https://nim-lang.org/docs/nep1.html#introduction-spacing-and-whitespace-conventions, two spaces should be preferred in stdlib.
* [backport:1.0] json: limit recursion depth (#19252)Miran2021-12-141-3/+9
| | | | | * json: limit recursion depth * do not run this check for JS backend
* Fix #19253 (#19254)PMunch2021-12-141-0/+3
| | | | This fixes 19253 by marking the bodyStream as completed when no content was sent.
* fix: fixes bug in CVerifyPeerUseEnvVars (#19247)Nick Wilburn2021-12-141-1/+2
| | | | | | Previously CVerifyPeerUseEnvVars was not being passed into scanSslCertificates, which meant that we weren't scanning additional certificate locations given via the SSL_CERT_FILE and SSL_CERT_DIR environment variables
* Various std net improvements (#19132)Jaremy Creechley2021-12-121-11/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Variant of that works with raw IpAddresses. - Add doc tests for new net proc's. - Aadd recvFrom impl - Add recvFrom impl -- tweak handling data var - Update lib/pure/net.nim Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> - cleaning up sendTo args - remove extra connect test - cleaning up sendTo args - fix inet_ntop test - fix test failing - byte len * fix test failing - byte len * debugging odd windows build failure * debugging odd windows build failure * more experiments to figure out the windows failure * try manual assigment on InAddr Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Update uri.nim (#19148) [backport:1.0]Dominik Picheta2021-12-111-0/+2
|
* move toDeque to after addLast (#19233) [backport:1.0]MichalMarsalek2021-12-101-14/+14
| | | Changes the order of procs definitions in order to avoid calling an undefined proc.
* Revert "swap port to correct port order (#19177)" (#19234)Jaremy Creechley2021-12-101-2/+2
| | | This reverts commit 0d0c249074d6a1041de16108dc247396efef5513.
* add comments to spawn and pinnedSpawn (#19230)flywind2021-12-091-2/+4
| | | `spawn` uses `nimSpawn3` internally and `pinnedSpawn` uses `nimSpawn4` internally. I comment it in order to help contributors get the gist of its functionality.
* swap port to correct port order (#19177)Jaremy Creechley2021-11-241-2/+2
| | | Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Fix punycode.decode function (#19136)Christoph Krybus2021-11-121-15/+16
| | | | | | | | | | | | | | * Refactor: rename proc to func * Fix punycode.decode function This function could only properly decode punycodes containing a single encoded unicode character. As soon as there was more than one punycode character group to decode it produced invalid output - the number of characters was correct, but their position was not. * Update tpunycode.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Merge file size fields correctly on Windows (#19141)Clay Sweetser2021-11-121-1/+5
| | | | | | | | | | * Merge file size fields correctly on Windows Merge file size fields correctly on Windows - Merge the two 32-bit file size fields from `BY_HANDLE_FILE_INFORMATION` correctly in `rawToFormalFileInfo`. - Fixes #19135 * Update os.nim
* Fix type mismatch with future logging (#19131)Jake Leahy2021-11-121-1/+1
|
* fixed colorNames sorting mistake (#19125) [backport]orthoplex2021-11-111-1/+1
|
* correct cookie docs (#19122)flywind2021-11-111-2/+1
|
* Add security tip for setCookie (#19117)Federico Ceratto2021-11-111-0/+3
| | | | | | | | | | | | | | | * Add security tip for setCookie * Update lib/pure/cookies.nim Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> * Update lib/pure/cookies.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Deprecate `std/sharedlist` and `std/sharedtables` (#19112)konsumlamm2021-11-094-2/+4
|
* change os.nim doc links to new style (#19102)Andrey Makarov2021-11-084-317/+310
|
* Remove invalid statements about try in async docs. (#19108)Dominik Picheta2021-11-081-13/+13
|
* fixes another effect inference bug [backport:1.6] (#19100)Andreas Rumpf2021-11-072-5/+9
| | | | * fixes another effect inference bug [backport:1.6]
* Added support for sending "ehlo" and receiving multiline "ehlo" response. ↵David Krause2021-11-031-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#19077) * Added support for sending "ehlo" and receiving multiline "ehlo" response. Signed-off-by: David Krause <enthus1ast@users.noreply.github.com> * fix typo Signed-off-by: David Krause <enthus1ast@users.noreply.github.com> * send "EHLO" first, if not supported, send "HELO" to smtp server. Signed-off-by: David Krause <enthus1ast@users.noreply.github.com> * fix english Signed-off-by: David Krause <enthus1ast@users.noreply.github.com> * add changelog entry for smtp `ehlo` Signed-off-by: David Krause <enthus1ast@users.noreply.github.com> * recvEhlo must not be exported Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
* Fix nimIdentNormalize, fixes #19067 (#19068)Tomasz Kramkowski2021-10-291-2/+3
| | | | | | | * Make nimIdentNormalize return "" when passed ""; fixes #19067 Fixes #19067 * Add tests for nimIdentNormalize
* docgen: implement doc link resolution in current module (#18642)Andrey Makarov2021-10-281-0/+5
|
* Minor update to terminal docs (#19056)Netsu2021-10-261-0/+14
| | | | | | | | | | | | | | | | | | | | | * Update terminal.nim - Added some extra docs to cursorUp/Down/Forward/Backward - I was able to use hideCursor and showCursor without adding stdout, removed the parameter - Added docs to terminalHeight()* and terminalWidth()* * Update lib/pure/terminal.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update lib/pure/terminal.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Added back f: file to cursor movement * Removed unnecessary comments Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Add Zephyr Support (#19003)Jaremy Creechley2021-10-248-286/+388
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Remerge * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * fix maxDescriptors on zephyr/freertos * move maxDescriptors to selector.nim -- fixes compile issue * change realloc impl on zephyr to match ansi c behavior * change realloc impl on zephyr to match ansi c behavior * force compileOnly mode for tlwip Co-authored-by: Jaremy J. Creechley <jaremy.creechley@wavebaselabs.com> Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Fix isInvalidFilename & always operate on the full passed in string (#19004)John Novak2021-10-201-45/+46
| | | | | | | | | | | | | * Fix isInvalidFilename segfault & deprecate the method * Update lib/pure/os.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update lib/pure/os.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fix parsesql.treeRepr when nil is in input (#18974)Andrey Makarov2021-10-171-3/+3
| | | | | * fix parsesql.treeRepr when nil is in input * return newNode(nkNone) as default value, not nil
* sequtils: fix errors from `strictFuncs` use (#18998)ee72021-10-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nim 1.4.x compiled the below code without error when using `--experimental:strictFuncs` import std/sequtils type Foo = ref object let foo1 = Foo() let foo2 = Foo() let foos = @[foo1, foo2] let fooTuples = @[(foo1, 1), (foo2, 2)] discard repeat(foo1, 3) discard zip(foos, foos) discard unzip(fooTuples) However, since 2020-12-09, devel Nim produced errors like /tmp/bar.nim(11, 15) template/generic instantiation of `repeat` from here /foo/nim/pure/collections/sequtils.nim(172, 6) Error: 'repeat' can have side effects an object reachable from 'x' is potentially mutated /foo/nim/pure/collections/sequtils.nim(183, 15) the mutation is here /foo/nim/pure/collections/sequtils.nim(183, 15) is the statement that connected the mutation to the parameter This commit reverts some `proc` to `func` changes so that code that: - calls `repeat`, `zip`, or `unzip` - and instantiates them with types containing `ref` can once again be compiled with `strictFuncs`. Otherwise, a user might be forced to drop or alter their `strictFuncs` use when upgrading from Nim 1.4.x, or when writing new code that uses these procedures (at least for now, with the current `strictFuncs` implementation). This commit also adds tests to assert that the remaining funcs in this module can be compiled with `strictFuncs` when used with types containing `ref`. The original batch of `proc` to `func` changes in `sequtils.nim` was in commit 6f57ebae349f, which was partially reverted in 38eb021f8158. See also: https://github.com/nim-lang/Nim/issues/16305
* remove deprecated stuffs from std/times (#18937)flywind2021-10-131-25/+25
|