Commit Graph

8321 Commits

Author SHA1 Message Date
flywind
b42e7c0ef9 make the docs of arithmetics better (#16510)
* fix

* Update lib/system/arithmetics.nim

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

* Apply suggestions from code review

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

* Apply suggestions from code review

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

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2020-12-30 17:30:43 +01:00
flywind
805917768d use runnableExamples in options (#16503) 2020-12-30 16:26:49 +01:00
Juan Carlos
b8658a3e24 Add assertions for jsconsole (#16460) 2020-12-30 15:10:50 +01:00
flywind
515cd45420 Add math.copySign (#16406)
* add math.copySign
* fix + tests
2020-12-30 15:09:30 +01:00
flywind
2f4d00fb98 fix #16502 (#16512) 2020-12-30 14:51:17 +01:00
flywind
95f599ca2d move asciitables to std/private/ (#16498)
* move asciitables

* minor
2020-12-29 16:20:47 +01:00
flywind
89a2390f8b fix printing negative zero in JS backend (#16505) 2020-12-29 15:50:22 +01:00
Antonis Geralis
d5a3c2c2da Added cmpMem export (#16484)
* added cmpMem export

* updates

* fix test

* Tiny changelog change

* Add a dot.

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-29 13:27:08 +01:00
Andrey Makarov
e70ac0f34c RST: fix directive with fields (#16490) (#16493)
* RST: fix directive with fields (#16490)

* Update tests/stdlib/trstgen.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-29 03:32:11 +01:00
flywind
e718a4a058 follow #15860 clean cgi module (#16487)
* follow #15860  clean cgi module

* follow #15860  clean cgi module
2020-12-27 19:46:21 +01:00
Juan Carlos
0c8ce2dccf Save some alloc on base64 using encodeSize (#16465) 2020-12-27 12:02:10 +01:00
flywind
689504081f follow #15357 and move decodeQuery (#15860)
* follow #15357 and move decodeQuery
* solve problem one
* minor
* deprecate decodeData
* add changelog and since
* add testcase for decodeQuery
2020-12-27 11:59:32 +01:00
Andrey Makarov
2bdc479622 RST: implement admonitions (#16438) 2020-12-27 11:16:12 +01:00
flywind
3f9a2ebea5 fix nim js cmp fails at CT (#16473) 2020-12-27 10:13:57 +01:00
Jonah Snider
fa1a04188f Avoid creating a holey array in makeNimstrLit for JS target (#16461)
* Avoid creating a holey array in makeNimstrLit
* Use array index instead of push
2020-12-27 09:33:51 +01:00
flywind
1d615dfda7 fix #16474 unittest.check type1 is type2 gives CT error (#16476)
* fix #16474
* more tests
2020-12-27 09:16:53 +01:00
Juan Carlos
a29bbeee41 Add missing HTTP codes (#16454) 2020-12-23 12:26:37 -08:00
flywind
b1c3dab208 add euclDiv and euclMod to math (#16414)
* add `euclDiv` and `euclMod` to `math`
* use abs
* Update lib/pure/math.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-23 12:04:38 +01:00
flywind
417c2509c4 strip minor improvement (#16444)
* strip minor improvement
* add more tests
* Update tests/stdlib/tstrutils.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2020-12-23 11:57:48 +01:00
shadowninja55
6e2c2d11db add sequtils to prelude (#16431)
* add sequtils to prelude

i would argue that sequtils is used just as often as the other imports in prelude, and it'd be nice for it to be included.

* updated doc comment to add sequtils

* added sequtils import to changelog
2020-12-23 10:23:45 +08:00
flywind
7256afb00d mark abs as inline (#16432) 2020-12-22 11:18:13 +01:00
Timothee Cour
bc84d9c8cb [backport => 1.0] fix #16428 vmops now works for generic procs (#16429)
* fix #16428 vmops now works for generic procs

* remove duplication
2020-12-22 02:05:21 +01:00
ee7
297c8e403d styleCheck: Fix some inconsistent identifiers (#16177) 2020-12-21 09:41:56 -08:00
flywind
d00a412129 docs minor for math (#16407) 2020-12-20 19:53:27 -08:00
Peter Salvi
051477b314 O(1) concatenation of singly- and doubly linked lists. (#16362)
* O(1) concatenation of singly- and doubly linked lists.

There is also new `toSinglyLinkedList` and `toDoublyLinkedList`
functions for conversion from `openArray`s, similarly
to `toHashSet` or `toTable`.

* Add `sequtils` import to runnable examples with `toSeq`.

* Added missing call to runnable examples.

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* Improved tests for lists.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* More compact tests for lists with templates.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Added extended example to `lists.copy`.

* Corrected .since annotations to 1.6

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Since declarations changed to (1,5,1).

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Changelog update.

* Fix rebasing errors.

* Self-adding with `lists.addMove` results in a cycle now.
Added some extra tests.
2020-12-20 13:09:35 +01:00
Andrey Makarov
9674eb3ca6 RST enumlist followup (#16382)
* fix matching of enumerator #)

* RST: markdown list with auto-enumerator `1`
2020-12-19 10:33:10 +01:00
flywind
78acf1becb fix cmpIgnoreStyle bug (#16392) 2020-12-18 16:29:36 +01:00
Tomohiro
dcdbae798c Fix osproc so that it doesn't close pipe/process/thread handles twice (#16385) [backport]
* Add error check to closeHandle and fix closing handle twice in osproc

* Fix compile error on Linux
2020-12-18 10:17:19 +01:00
Matt Haggard
23d23ecb08 Make 'echo' raise IOErrors when appropriate (#16367)
* Make 'echo' raise IOError when fwrite/fflush fail

* Fix fwrite return value comparison

* Add test for echo raising error and don't fail to release locks in echo

* Fix exitcode expectation

* Make 'echo' raise IOError on Windows if it fails

* Add nimLegacyEchoNoRaise for prior no-IOError echo behavior

* Use checkErrMaybe template
2020-12-18 10:06:13 +01:00
Timothee Cour
df17cf5e9e misc cleanups (#16383) 2020-12-18 08:53:43 +01:00
Andreas Rumpf
868c31e88a fixes #16365 [backport] (#16381) 2020-12-17 23:21:55 +01:00
flywind
e1e069dd6c use hexchar in stdlib (#16290) 2020-12-17 13:41:05 +01:00
flywind
8cd3655dee make the docs of strutils a bit better (#16368) 2020-12-17 13:37:32 +01:00
Andreas Rumpf
b87bcb6d92 fixes #16359 [backport] (#16377) 2020-12-17 13:35:02 +01:00
Andreas Rumpf
979148e863 refactorings to prepare the compiler for IC (#15935)
* added ic specific Nim code; WIP
* make the symbol import mechanism lazy; WIP
* ensure that modules can be imported multiple times
* ambiguity checking
* handle converters and TR macros properly
* make 'enum' test category green again
* special logic for semi-pure enums
* makes nimsuggest tests green again
* fixes nimdata
* makes nimpy green again
* makes more important packages work
2020-12-17 08:01:36 +01:00
Jason Beetham
1082d62b08 Adds toSet to create sets from iterables (#16276) 2020-12-14 15:20:21 -08:00
ee7
38eb021f81 sequtils.nim: Change some func back to proc (#16309)
This commit changes the funcs that take a `proc` parameter back to
procs.

This reverts some of commit 6f57ebae34:
  sequtils.nim: Use `func` (#16293)

See also:
- https://github.com/nim-lang/Nim/issues/16303
- https://github.com/nim-lang/Nim/pull/16304
2020-12-14 20:14:49 +01:00
lqdev
233c6a2fba disabled sink openArray[T] for adding to seqs (#16352) [backport:1.4] 2020-12-14 20:13:43 +01:00
Elliot Waite
f3d57761ab Fix broken links in docs (#16336)
* Fix broken links in docs

* Fix rand HSlice links
2020-12-14 20:13:12 +01:00
Andrey Makarov
e843492b13 doc/rst2html: some few fixes for enumerated and bullet lists (#16295)
* fix bullet/enumarated lists with many blank lines
* fix enumerated list parsing
* fix parse failure when next line after list empty
* implement arbitrary start of enumerator
* check that enumerators are in order
* remove redundant start=x if x=1 or a
* add some doc on implemented features
* update start in rst_examples.rst
* allow upper-case letters + more docs
2020-12-14 18:10:39 +01:00
flywind
8f6e07a9a2 clean the docs of sequtils (#16332) 2020-12-14 16:38:02 +01:00
Jason Beetham
5a58440ebe Added strscans.scanTuple (#16300)
* Added since and changelog
2020-12-12 23:29:20 +01:00
rockcavera
d15f63a0f2 Fix #14259 #15621 (#16322) [backport:1.4]
* IPv6 text representation according to RFC 5952

* Revert IPv6 text representation according to RFC 5952

* fix #14259 #15621

fix #14259 #15621

* Update lib/system/io.nim

* reverted IoHandle removal

* adaptation of types for WinAPI

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-12 09:35:18 +01:00
Timothee Cour
b1c232aca1 improve tests for collections (#16328)
* improve tests for collections

* remove remaining code blocks in deques.nim

* improve runnableExamples
2020-12-12 09:33:29 +01:00
Timothee Cour
0b73106ccf add math.isNaN (#16179)
* add math.isNaN
* isNaN now works with --passc:-ffast-math; tests
* Update lib/pure/math.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-11 11:01:43 +01:00
Timothee Cour
bb1c962286 fix partially #13115 (now works for cpp; but still fails for js on openbsd) (#16167)
* fix partially #13115 properly (works for c,js,cpp,vm; still fails for js on openbsd)
* address comment: also test with -d:danger, -d:debug
2020-12-11 10:35:05 +01:00
Timothee Cour
82bb4db4b7 unittest: use defines instead of env vars (#16165)
* unittest: use defines instead of env vars

* use defines in testament

* fixup

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-10 00:57:52 +01:00
ee7
87e634aab3 rationals.nim: Use func everywhere (#16302) 2020-12-09 16:17:50 +01:00
flywind
9ce2f87a0a clean up old codes (#16284)
* clean up old codes

* fix docs and links

* clean
2020-12-09 12:18:32 +01:00
ee7
6f57ebae34 sequtils.nim: Use func (#16293)
* sequtils.nim: proc -> func

* sequtils.nim: proc -> func in links

* sequtils.nim: proc -> func in non-link doc comments

* test: add `sequtils` to strictFuncs test
2020-12-09 12:11:16 +01:00