Commit Graph

18790 Commits

Author SHA1 Message Date
Juan Carlos
26a6ceb34e Fix Typos (#17194) 2021-02-27 09:51:54 +08:00
flywind
60ec3e2417 add warnings to std/sysrand (#17191)
* remove unnecessary when statement

* remove outdated codes

* add warnings to std/sysrand

* Update lib/std/sysrand.nim

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>
2021-02-26 20:06:20 +01:00
Timothee Cour
e9f12dd89e document ; vs , for generic params (#17192) 2021-02-26 16:14:25 +01:00
Timothee Cour
ff3ace2232 fix code-block test bugs: fix #17183, fix https://github.com/timotheecour/Nim/issues/620 (#17184)
* fix code-block test bugs: fix #17183, fix https://github.com/timotheecour/Nim/issues/620

* cleanup
2021-02-26 16:05:20 +01:00
zetashift
c7d6e4c6a6 Fix unicode.split with seperators examples (#17176)
* Fix unicode.split with seperators examples

https://nim-lang.org/docs/unicode.html#split.i%2Cstring%2CRune%2Cint didn't work with the set constructor `{}` so replaced it with a string that's converted to an openArray compatible type containing `Rune`s.

* Add runnableExamples to unicode.split

* Add runnableExamples to split with single separator too

* Simplify runnableExamples unicode.split

* Improve the rest of the runnableExamples with the simplified code

* Simplify runnableExamples of unicode.split even more

* Formatted unicode.split example

* Update lib/pure/unicode.nim

Co-authored-by: zetashift <rishi2@laptop.localdomain>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-02-26 15:08:48 +01:00
Timothee Cour
63f1c38f4e hashes: support object default hash (#17175) 2021-02-26 08:45:37 +01:00
Timothee Cour
4a31088ac2 improve docs for sugar.collect (#17188) 2021-02-26 08:43:32 +01:00
Timothee Cour
b725e0ed4d make jsconsole.assertion errors less confusing in logs (#17179)
* make jsconsole.assertion errors less confusing in logs

* address comments

* fixup
2021-02-25 14:02:00 +01:00
flywind
f07bdbe945 clarify the docs of existsOrCreateDir a bit (#17182)
* remove unnecessary when statement

* remove outdated codes

* clarify the docs a bit
2021-02-25 13:58:31 +01:00
flywind
dcd3f26876 clean up wrapnils 2021-02-25 17:52:58 +08:00
Timothee Cour
bea037f856 refs #17114: workaround for arm64 which should segfault but does not (#17178)
* refs #17114: workaround for arm64 which should segfault but does not
* fixup
* Update lib/std/wrapnils.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-25 08:40:43 +01:00
flywind
60929953cb mark inline (#17180) 2021-02-24 21:52:23 -08:00
flywind
fcb5cf643c use single backtick (#17181) 2021-02-24 21:47:27 -08:00
Timothee Cour
578d1ee751 std/options: $some(3) is now "some(3)", etc. (#17147)
* std/options: $some(3) is now "some(3)", not "Some(3)", `$none(int)` is now `"none(int)"` instead of `"None[int]"`

* fix tests

* disable optionsutils
2021-02-24 22:17:16 +00:00
Timothee Cour
a4e6b242d5 asyncjs: add then, catch for promise pipelining (#16871)
* asyncjs: add then
* improve tests, changelog, API
* fix cryptic windows error: The parameter is incorrect
* address comments
2021-02-24 21:03:21 +01:00
flywind
99633d7682 remove deprecated stuff in unittest module (#17156)
* remove unnecessary when statement

* remove outdated codes

* remove deprecated stuff in testament

* fix
2021-02-24 21:02:33 +01:00
alaviss
d35f366d6f compiler/installer.ini: package cacert.pem on Windows [backport:1.2] (#17172)
Follow up of 5dc544e1f5

After updating windeps.zip, it appears that Windows' build was
unchanged. As it turns out, cacert.pem is not set for packaging by the
compiler package manifest.

This commit add cacert.pem to the Windows package.
2021-02-24 17:57:19 +01:00
Andreas Rumpf
e9a287fe12 fixes #17170 (#17171) 2021-02-24 17:43:13 +01:00
Timothee Cour
8942586fa6 wrapnils: add ??. which returns an Option (#16931)
* wrapnils: add option-like API with ??., isSome, get
* fix test after rebase
* cleanups
* fix changelog
* address comments regarding get vs unsafeGet
2021-02-24 14:02:32 +01:00
Timothee Cour
11a7fa68f6 fix #17159 items(cstring) works in VM (#17160)
* fix #17159 items(cstring) works in VM

* improve test coverage tests/stdlib/tcstring.nim; add helpers: whenRuntimeJs, whenVMorJs

* document items(cstring)

* address comments
2021-02-24 14:01:06 +01:00
flywind
3021252ad4 close #14581 add testcase (#17169)
* remove unnecessary when statement

* remove outdated codes

* close #14581
2021-02-24 13:49:47 +01:00
Timothee Cour
0bb7e8dcb4 cleanup tests/stdlib/tstring.nim (#17158)
* cleanup tests/stdlib/tstring.nim

* cleanup tests/stdlib/tstring.nim

* cleanup rest of test
2021-02-24 13:47:36 +01:00
flywind
cbe3c993b6 close #15563 add testcase (#17168)
* remove unnecessary when statement

* remove outdated codes

* close #15563

* Update tests/typerel/t15563.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* address comments

* tiny

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-02-24 13:44:10 +01:00
Andreas Rumpf
6278b5d89a new-style concepts implementation, WIP (#15251)
* fixes #15210 [backport:1.2]

* make tests green
* make ordinal work
* makes Swapable test compile
* make Indexable example work
* concepts: 'self' is now 'Self'
* concepts: make Dictionary example compile
* document the new concept implementation
* concepts: make typeDesc work properly
* concepts: allow documentation comments (d'oh)
2021-02-24 13:17:33 +01:00
flywind
3f38f8fbb7 add strbasics.strip (#16280) 2021-02-24 10:22:47 +01:00
flywind
46bd222c89 [stdlib] make cookies module modern (#17116)
* update cookies module
* introduce sameSite.Default

Co-authored-by: hlaaftana <10591326+hlaaftana@users.noreply.github.com>
2021-02-24 10:14:19 +01:00
Andreas Rumpf
b48a32053f fixes yet another SSL problem on Windows [backport:1.2] (#17167) 2021-02-24 10:12:47 +01:00
flywind
47c078e29c use single backtick (#17166) 2021-02-23 21:05:39 -08:00
Timothee Cour
c274e67198 add enumutils.items for sparse enums, typetraits.SomeSparseEnum (#17080)
* add enumutils.items for enum with holes
* changelog
* ref in lib.rst
* use `type SomeSparseEnum* = (not Ordinal) and enum` instead of concept
* address comment: rename back to enum with holes
2021-02-23 20:25:35 +01:00
Timothee Cour
74a8f23801 document type bound operators (#17063)
* document type bound rountines
* address comments
* Update doc/manual.rst

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-23 13:52:20 +01:00
Timothee Cour
5d95137ce0 remove tests/deps/ (#17132)
* remove tests/deps/

* fix tests

* fix tests/manyloc/keineschweine/lib/zlib_helpers.nim

* fixup
2021-02-23 13:31:53 +01:00
Timothee Cour
b1a3651ae4 fix UnusedImport for nim c compiler/nim (#17152) 2021-02-23 10:40:40 +01:00
Saem Ghani
7c2ac98880 Fixes #17039 - ldObj checks node/nodeAddr access (#17123)
Checked field expressions, such as an object variant field access results in
occasionally broken address analysis crashing the VM. This guard added here
mimics guarded access in ldObjAddr as well. This is to prevent a crash, while a
fix is devised.
2021-02-23 09:02:06 +01:00
Danil Yarantsev
4e619a6bea A few rst doc fixes (#17151)
* Fix a couple of rst formatting issues

* no need for the extra space
2021-02-23 08:59:13 +01:00
Timothee Cour
ce7caec4b3 add io.readChars overload (simpler, less error prone) (#16044)
* add simpler to use readChars overload

* use new readChars overload

* Update lib/wrappers/openssl.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-02-22 20:13:08 +01:00
konsumlamm
a1f4113705 Improve the ropes module (#17145)
* Improve ropes module

Improve wording
Update runnableExamples
Add index bound check for `[]`
Minor format changes

* Update tests/stdlib/tropes.nim

Run on C & JS target
Test in VM
Add tests for `[]`
2021-02-22 19:58:37 +01:00
rockcavera
d76d79336f fix #15215 (#17142)
* fix 15215

* fix test

* end line

* Update tests/stdlib/tnetconnect.nim

Co-authored-by: flywind <xzsflywind@gmail.com>

* Update lib/pure/net.nim

Co-authored-by: flywind <xzsflywind@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-22 17:40:57 +01:00
Saem Ghani
2aba116bbc when statements branches exit early (#17143)
When statement branches exit early outside of nimvm. In nimvm it seems that all
sides of the branches must be evaluated as the code gen happens at a later
stage, this remains intact.
2021-02-22 12:27:23 +01:00
konsumlamm
05711d95e0 Add example for pattern matching on options (#17120)
* Add example for pattern matching on options

* Use code-block

* Apply suggestions

* Use block comments

* Fix example
2021-02-22 11:16:15 +01:00
Timothee Cour
ef5303114c fix prelude regression refs #16238: include prelude doesn't interfere with nim doc (#17111)
* fix bug1 from #16238 nim doc now works with include prelude

* fix for windows

* fixup
2021-02-22 11:10:34 +01:00
flywind
f07a072691 [JS + docs] improve std/monotimes module (#17103) 2021-02-22 11:09:25 +01:00
Timothee Cour
55a33e1664 testament: support disabled:osx as alias to disabled:macosx (#17124) 2021-02-22 11:01:15 +01:00
Andrey Makarov
fab1618eb4 make rst.nim use object variant (#17138)
* make rst.nim use object variant

* add workaround

* fix mistake
2021-02-22 11:00:31 +01:00
flywind
f26c25737c remove outdated codes (#17140)
* remove unnecessary when statement

* remove outdated codes
2021-02-22 09:40:11 +01:00
flywind
32bf10126c fix #17118 (#17119) [backport:1.2]
* fix js unsigned integer
* Use `std` prefix for standard library modules
* fix #17118
2021-02-22 09:14:18 +01:00
Timothee Cour
cde950e1bc make copySign for js consistent with other backends (#16609)
* make copySign work more robustly in js
* improve tests
* improve tests/vm/tcastint.nim
2021-02-22 08:47:00 +01:00
Timothee Cour
04b1120334 important_packages: document that packages tested should ideally have recent release tags (#17134) 2021-02-22 11:55:20 +08:00
flywind
4556901572 use single backtick (#17141) 2021-02-21 19:53:28 -08:00
Timothee Cour
4f10dde64a followup #17077: also use assert instead of doAssert for code-block rst blocks intended to be used as runnableExamples (#17122) 2021-02-21 23:44:32 +08:00
Clyybber
6b7a6f8c54 Split last read and first write analysis (#17137)
* Split last read and first write analysis

This improves performance by 10% for some
cases.

* Remove outdated comments
2021-02-21 16:20:05 +01:00