summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add client.close() in httpclient examples. (#20118)gecko2022-08-041-9/+25
| | | | | Without this, the httpclient examples are essentially setting you up for failure. I was bitten by this when my app became unable to open any more sockets. I'm not entirely sure how long this will relevant, as I hope destructors will be added to an upcoming version of the stdlib. But figured it was worth submitting anyways!
* prevent cache thrashing (#20129)ringabout2022-08-021-1/+3
| | | | | | | | | | | | * prevent cache thrash Co-authored-by: Charles Blake <cb@cblake.net> * Update lib/pure/random.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Charles Blake <cb@cblake.net> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Fix "Add Wider Ascii Chars sets and func for string formatting" (#20120)Clay Sweetser2022-07-311-3/+3
|
* Add Wider Ascii Chars sets and func for string formatting (#19994)Sultan Al Isaiee2022-07-311-12/+25
| | | | | | | | | | | | | | | | | | | | | * Add more Ascii Chars sets - add UpperCaseLetters set - add LowerCaseLetters set - add Punctuations set - add PrintablesNoWhiteSpace set - add Printables set - add isPunctuationAscii func - add isPrintableAscii func * Omit isPunctuationAscii and isPrintableAscii procs * Apply suggestions for adding Wider Ascii Chars sets Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Update strutils.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* [ORC] replace threadpool with createThread in the runnableExamples (#20106)ringabout2022-07-311-9/+16
| | | replace threadpool with createThreads in the runnableExamples
* replace the broken link for ORC implementation with a working one (#20105)ringabout2022-07-311-1/+1
|
* Highlight Nim default in Markdown code in .nim (#20110)Andrey Makarov2022-07-312-11/+16
| | | Highlight Nim by default in Markdown code in .nim
* remove shallowCopy for ARC/ORC (#20070)ringabout2022-07-263-20/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | * remove shallowCopy for ARC/ORC * use move * fix * more fixes * typo * Update lib/system.nim * follow * add nodestroy * move * copy string * add a changelog entry Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #20089; remove setPointer since strings/seqs are not pointers with ORC ↵ringabout2022-07-261-2/+8
| | | | | (#20090) fixes #20089; remove setPointer since strings/seqs are not pointers anymore
* .forbids pragma: defining forbidden tags (#20050)Lancer112112022-07-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .forbids pragma: defining illegal effects for proc types This patch intends to define the opposite of the .tags pragma: a way to define effects which are not allowed in a proc. * updated documentation and changelogs for the forbids pragma * renamed notTagEffects to forbiddenEffects * corrected issues of forbids pragma the forbids pragma didn't handle simple restrictions properly and it also had issues with subtyping * removed incorrect character from changelog * added test to cover the interaction of methods and the forbids pragma * covering the interaction of the tags and forbids pragmas * updated manual about the forbids pragma * removed useless statement * corrected the subtyping of proc types using the forbids pragma * updated manual for the forbids pragma * updated documentations for forbids pragma * updated nim docs * updated docs with rsttester.nim * regenerated documentation * updated rst docs * Update changelog.md Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * updated changelog * corrected typo Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Markdown code blocks part 2; migrate Nim Manual (#20080)Andrey Makarov2022-07-251-24/+30
| | | | | * Change headings underscored by `~~~` to `###` * Markdown code blocks part 2; migrate Nim Manual
* fix #20067, fix #18976 [backport] (#20069)metagn2022-07-221-1/+3
|
* replace shallowcopy with move in ARC/ORC (#20061)flywind2022-07-181-6/+6
|
* Improve rand(bool) (#20045)Antonis Geralis2022-07-181-2/+4
| | | | | | | | | | | | | | | | | | | * Improve rand(bool) * Use sign test instead of mod 2 * Use mod 2 again, as it works for js * Use right shift as suggested by the authors of xoroshiro * Update random.nim * General case doesn't need any right shift it was correct to begin with * Update random.nim * add comment Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
* epoll: correct mapping [backport] (#20058)Jacek Sieka2022-07-181-5/+14
| | | | | | | * epoll: correct mapping `epoll_data` is a union and `epoll_event` is packed on `amd64` * names
* Fixed typo in std/os doc (#20054)LetThereBeLemons2022-07-181-1/+1
| | | Fixed typo
* fix `pthread_mutex_t` size (#20055)Jacek Sieka2022-07-181-1/+1
|
* Display protocol name in exceptions raised by getProtoByName() (#19808)kraptor2022-07-161-1/+1
|
* Make `random.rand` work with `Ordinal` (#20043)Amjad Ben Hedhili2022-07-161-6/+9
| | | | | | | * Make `random.rand` work with `Ordinal` * Add changelog entry * It's fine to cast to char
* make AsyncSocket.getPeerAddr work ; fix #15022 (#20038)David Krause2022-07-161-0/+2
| | | Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
* Improve Markdown code blocks & start moving docs to Markdown style (#19954)Andrey Makarov2022-07-152-36/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add additional parameters parsing (other implementations will just ignore them). E.g. if in RST we have: .. code:: nim :test: "nim c $1" ... then in Markdown that will be: ```nim test="nim c $1" ... ``` - implement Markdown interpretation of additional indentation which is less than 4 spaces (>=4 spaces is a code block but it's not implemented yet). RST interpretes it as quoted block, for Markdown it's just normal paragraphs. - add separate `md2html` and `md2tex` commands. This is to separate Markdown behavior in cases when it diverges w.r.t. RST significantly — most conspicously like in the case of additional indentation above, and also currently the contradicting inline rule of Markdown is also turned on only in `md2html` and `md2tex`. **Rationale:** mixing Markdown and RST arbitrarily is a way to nowhere, we need to provide a way to fix the particular behavior. Note that still all commands have **both** Markdown and RST features **enabled**. In this PR `*.nim` files can be processed only in Markdown mode, while `md2html` is for `*.md` files and `rst2html` for `*.rst` files. - rename `*.rst` files to `.*md` as our current default behavior is already Markdown-ish - convert code blocks in `docgen.rst` to Markdown style as an example. Other code blocks will be converted in the follow-up PRs - fix indentation inside Markdown code blocks — additional indentation is preserved there - allow more than 3 backticks open/close blocks (tildas \~ are still not allowed to avoid conflict with RST adornment headings) see also https://github.com/nim-lang/RFCs/issues/355 - better error messages - (other) fix a bug that admonitions cannot be used in sandbox mode; fix annoying warning on line 2711
* [Orc] fixes "streams.readDataStr segafaults" when accepting a string ↵flywind2022-07-151-0/+5
| | | | | literal (#20019) [backport] fixes streams.readDataStr accept a string literal
* fixes #20015; document `shallowCopy` does a deep copy with ARC/ORC (#20025)flywind2022-07-141-0/+2
|
* Add sink and lent annotations to the critbits module (#20021)silent-observer2022-07-141-8/+8
| | | | | | | | | * Add sink and lent to critbits * Remove lent for pairs I guess lent doesn't work well inside tuples * Remove lent from template in critbits Apparently this also doesn't work, because some checks failed
* Fixes Compilation error with --app:lib (#19965)Juan M Gómez2022-07-101-1/+1
| | | | Fixes Compilation error with --app:lib when a module tries to pull os.paramStr on posix by throwing a runtime exception instead. More details here: #19964
* sysrand: fix syscall signature [backport] (#19982)Jacek Sieka2022-07-071-4/+3
| | | | | sysrand: fix syscall signature `syscall` is a `C` varags function
* Fixes return values of execCmd on macos (#19963)Daniel Clarke2022-07-051-1/+1
| | | | | | | * Fixes return values of execCmd on macos * update tests to use existing structure Co-authored-by: daniel <danielclarke@wearepopgun.com>
* Fixing `nimRawSetJmp` for vcc and clangcl on Windows (#19959)rockcavera2022-07-041-17/+21
| | | | | | | | | | | | | * fix vcc rawsetjmp * changing `_longjmp()` to `longjmp()` and `_setjmp()` to `setjmp()` * fix * fix setjmp to clangcl on Windows * fix genTrySetjmp() to clangcl on Windows
* jsffi add missing braces (#19948)Juan Carlos2022-06-301-10/+10
| | | js codegen add missing whitespaces and braces
* Fix jsre (#19917)Juan Carlos2022-06-281-3/+5
| | | | | * Fixes for jsre to make it more safe at runtime on some edge cases * https://github.com/nim-lang/Nim/pull/19917#issuecomment-1162692893
* fix typo in nre.nim (#19915)flintforge2022-06-211-2/+1
| | | | | Update nre.nim typo in proc replace description
* Fix nimRawSetjmp for VCC [backport: 1.2] (#19899)Tanguy2022-06-201-1/+1
|
* Better range error messages (#19867)Tanguy2022-06-151-0/+3
| | | | | | | * Better range error messages * Revert to old behavior for arrays * Small corrections
* Windows: enable nimRawSetjmp by default [backport] (#19891)Tanguy2022-06-141-0/+7
| | | | | | | | | * Windows: enable nimRawSetjmp by default See #19197. The default setjmp can randomly segfault on windows * Attempt to disable the flag for bootstraping * Disable styleCheck for c_setjmp
* Correctly import libcrypto functions using dynlib (#19881)Ardek Romak2022-06-131-35/+37
|
* Pass headers and body correctly to FetchOptions (#19884) [backport]Jake Leahy2022-06-131-2/+3
| | | | | | | | | * Pass headers to FetchOptions Don't pass body if method is HttpGet or HttpHead * Syntax fixes * Restart CI
* Friendlier error message with solution (#19880)Carlo Capocasa2022-06-111-0/+5
| | | | | | | | | | | | | * Add helpful suggestion, should always apply * mention var param limitation in async docs * Update compiler/lambdalifting.nim whoops thanks Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
* [js] add testcase for array indexDefect and remove todo (#19838)flywind2022-06-101-4/+0
| | | | | | | | | * remove unused opcSubstr * [js] add testcase for array indexDefect * Revert "remove unused opcSubstr" This reverts commit cb461f2545234d62c1e0b83318f3e5495c97de52.
* remove noop option `gc:v2` (#19810)flywind2022-06-101-12/+2
| | | | | * remove noop option gc:v2 * changelog
* fix #19862; make widestrs consistent between refc and orc (#19874) [backport]flywind2022-06-091-0/+3
| | | fix #19862; make widestrs consistent in refc and orc
* Deprecate std/sums (#18439)Antonis Geralis2022-06-091-0/+2
| | | | | | | | | | | | | | | | | * Deprecate sums * Update changelog.md * Update lib/std/sums.nim * log * format * remove * Update changelog.md Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
* Add Microtasks docs (#19870)Juan Carlos2022-06-081-1/+1
| | | | | | | * Add Microtasks * Add Microtasks * Workaround to build js docs in older NodeJS versions
* Fix `find` routines' api to default to `last=-1` (#19761)Zoom2022-06-071-41/+50
| | | | | | | | | | | | This changes the default for the `last` parameter of various `find` routines from `0` to `-1`. Previous default prevents limiting the search to the first character. This is a logic error, as full text search was performed for 2 *valid* values of `last`: `0` and `last.high()`. Adds an overload for `initSkipTable` which returns a newly initialized table. This encapsulates every single usage of a `var`-acting original func in this module. Co-authored-by: flywind <xzsflywind@gmail.com>
* Add Microtasks (#19860)Juan Carlos2022-06-041-0/+5
| | | | | * Add Microtasks * Add Microtasks
* RST: improve simple tables (#19859)Andrey Makarov2022-06-046-91/+220
| | | | | | | * RST: improve simple tables * nim 1.0 gotchas * Still allow legacy boundaries like `----`
* change the type of mangleJsName; fixes CStringConv warnings (#19852)flywind2022-06-011-6/+6
| | | | | change the type of mangleJsName since mangleJsName is used in macros, there is no need to use cstring. Using cstring may increase conversions and cause warnings.
* [Minor] remove unused and unnecessary local variable (#19853)flywind2022-06-011-1/+0
|
* Zectbumo fixes 19824 (#19825)Alfred Morgan2022-05-301-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * borrowed `$` to make Time string friendly * added sep character parameter * Revert "added sep character parameter" This reverts commit 45f4b019a4883b6ba577ade1f94677266beb5960. * added sep character parameter * Revert "borrowed `$` to make Time string friendly" This reverts commit 10e2e44c9a04970f38cf66556635bdbb50b69136. * added uri tests and made changelong entry * Update lib/pure/uri.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update lib/pure/uri.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update tests/stdlib/turi.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update tests/stdlib/turi.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Add `document.hidden` and `document.visibilityState` properties (#19817)tandy10002022-05-241-0/+2
|
* Add Array.shift (#19811)Juan Carlos2022-05-241-0/+9
| | | | | * Add Array.shift for JavaScript targets * Add Array.shift for JavaScript targets