summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix typo in sequtils documentation (#19789)Anthony Dario2022-05-131-1/+1
| | | Found another small typo.
* string is missing formatting when calling fmt (#19780)Alfred Morgan2022-05-101-2/+2
| | | it appears the documentation intends to compare & with .fmt but there is no formatting in the string. even though the assert is true it doesn't quite prove that .fmt is an equivalent formatter.
* Remove deprecated posix proc (#19774)Juan Carlos2022-05-081-10/+0
| | | | | * Remove deprecated posix proc that takes wrong argument types * Remove deprecated posix proc that takes wrong argument types
* Update nimscript `withDir` doc example (#19776)huantian2022-05-081-4/+4
|
* Fix questionable suggestion in `strutils` docs (#19765)Zoom2022-05-061-9/+16
| | | | | | | | | | | * Fix questionable suggestion in `stutils` docs - Removes the recommendation to pass a string slice for getting a relative index for `find` and `rfind` functions, as this currently makes a string copy, while a simple subtraction is enough. - Docstring for `SkipTable` type. * Doc layout fixup
* Fix broken link in sets documentation. (#19769)Anthony Dario2022-05-061-1/+1
|
* Rework discarding futures documentation in asyncdispatch (#19738)huantian2022-05-021-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | * Rework discarding futures docs in asyncdispatch * Fix typos Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> * Use rst note:: Co-authored-by: flywind <xzsflywind@gmail.com> * Split discarding and handling futures. * Update lib/pure/asyncdispatch.nim * Update lib/pure/asyncdispatch.nim * Update lib/pure/asyncdispatch.nim * Update lib/pure/asyncdispatch.nim Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* fixes #18612; apply cache and memcmp for methods in arc/orc (#19749)flywind2022-04-261-2/+26
| | | | | | | | | | | | | | | | | * try using endsWith * use memcmp * add cache * cleanup * better * minor * fix * improve test coverage for methods with ARC
* macros: make hasCustomPragma more permissive (#19747)ehmry2022-04-251-3/+5
| | | | Make hasCustomPragma return false rather than fail for invalid parameters.
* Revert "fix db_sqlite.tryInsertID does raise exceptions in 1.6.0 #19743 ↵Andreas Rumpf2022-04-251-14/+11
| | | | | (#19744)" (#19745) This reverts commit b10f0e7bca43761316f6424786a771af33254e19.
* Really fix StringStream with ARC at compile-time, improve streams test (#19739)Danil Yarantsev2022-04-251-2/+8
| | | | | * Fix compile-time StringStream with ARC * make readDataStr work with ARC, improve test
* fix db_sqlite.tryInsertID does raise exceptions in 1.6.0 #19743 (#19744)flywind2022-04-241-11/+14
|
* Fix doc: list of async backends (#19741)huantian2022-04-241-3/+3
|