Commit Graph

18363 Commits

Author SHA1 Message Date
flywind
d00a412129 docs minor for math (#16407) 2020-12-20 19:53:27 -08:00
flywind
d435bfcb3b disable ggplot and plotly (#16418) 2020-12-20 18:59:32 -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
0b7847ba3c active windows tests and use doAssert (#16395) 2020-12-18 16:45:51 +01:00
flywind
78acf1becb fix cmpIgnoreStyle bug (#16392) 2020-12-18 16:29:36 +01:00
Code Hz
90dbb6f3fb removing out T from docs since it no longer working (#16378) [backport]
* remove `out T` from docs

see https://github.com/nim-lang/Nim/issues/16131

* remove `out T` in title
* remove entire paragraph
2020-12-18 10:40:43 +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
5d8f862bc6 fix #16364 (#16379) [backport]
* fix #16364

* add comments

* Update tools/dochack/dochack.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-17 21:14:16 +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
Maurizio Tomasi
3b963a8150 Add note about minimum Node.js version (#16370)
Fix the error message
2020-12-16 16:05:59 +00:00
Saem Ghani
9ef7c01820 Syntax (RST) fix Internals of the Compiler (#16341)
'Rebuilding the Compiler' and a few other sections required syntax fixes:
* new lines before and after lists to fix rendering
* use internal reference instead of Markdown style link
2020-12-15 14:57:11 +01:00
Timothee Cour
9ede956662 improve tstrutils: test c, cpp, js, vm; cleanups (#16357)
* renamed:    tests/stdlib/tstrutil.nim -> tests/stdlib/tstrutils.nim

* improve test

* enable tstrutils for js, vm
2020-12-15 14:55:41 +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
Timothee Cour
2728711dd3 fix #16248 forward --lib to runnableExamples (#16350) 2020-12-14 17:49:39 +01:00
flywind
8f6e07a9a2 clean the docs of sequtils (#16332) 2020-12-14 16:38:02 +01:00
RSDuck
b6443c96a0 fix #16334 (#16335)
* fix #16334

* rename isstdout -> isStdout

* separate lastMsgWasDot for stdout and stderr

* simplify logic
2020-12-14 13:28:03 +01:00
Juan Carlos
5e8e948ffc Clean out dead code (#16345) 2020-12-14 11:50:45 +01:00
Timothee Cour
555cfd1d59 fix #16330 tshould_not_work (#16342) 2020-12-14 11:37:27 +01:00
Timothee Cour
4850f9b596 fix #16265; fix #13999 (HCR on OSX); cgen now does not line wrap string litterals (#16329)
* fix #16265: cgen now does not line wrap string litterals which, in combination with other hacks, caused a really obscure looking bug

* fix #13999; nimhcr_integration.nim now works for osx

* try to make appveyor CI disappear

* disable openbsd + add diagnostic for openbsd

* enable for openbsd

* PTEMP

* re-disable openbsd
2020-12-14 11:17:24 +01:00
rockcavera
9ac2ee7b8d Fix #11506 (#16348)
fixes the problem of compiling vccexe.exe when it is in use.
2020-12-14 11:07:55 +01:00
Timothee Cour
7e1ae35195 testament: error instead of silently ignore invalid targets; remove pointless alias target vs targets; document matrix; DRY (#16343)
* testament: error instead of silently ignore invalid targets
* s/target/targets/
* fix test; refs #16344
* address comments
* Update testament/specs.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-14 10:58:29 +01:00
Bung
5514b299eb add testcase for #15937 (#15933)
* test for issue #15624 and PR #15915 for patch #13823

* Update thashes.nim

no need mention PR #15915, fixed in https://github.com/nim-lang/Nim/pull/15937

* rebase to devel(issue maybe fixed), ignore ouputs

* Apply suggestions from code review

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2020-12-13 11:52:38 +08: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
flywind
bc84bd5d66 bring back fidget (#16319) 2020-12-11 13:02:43 +08:00
Timothee Cour
1a07f572f4 unbreak CI, disable fidget, refs #16315 (#16316) 2020-12-11 00:24:44 +01:00
flywind
73299b048f enable tests for random (#16297) 2020-12-10 07:58:42 +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
Timothee Cour
f344a70412 fix #16150 improve type mismatch errors (#16152)
* fix #16150 improve type mismatch errors

* allow -d:nimLegacyTypeMismatch

* address comment
2020-12-09 16:19:39 +01:00
ee7
87e634aab3 rationals.nim: Use func everywhere (#16302) 2020-12-09 16:17:50 +01:00
Federico Ceratto
17a835a7b2 Zsh completion (#16261)
* Add --cpu to zsh completion
* Add --gc to zsh completion
* Add --os to zsh completion
* Add --panics to zsh completion
* Add --verbosity to zsh completion
* Add --hints to zsh completion

* Update tools/nim.zsh-completion

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

* Update tools/nim.zsh-completion

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-09 16:11:51 +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
flywind
c43dca2901 disbale deprecated CI in fork repo (#16299) 2020-12-09 11:19:02 +01:00
ee7
140ebe6019 complex.nim: Use func everywhere (#16294) 2020-12-09 10:57:12 +01:00
Miran
40255f6721 put both funcs and procs under the same section in the documentation (#16301)
* both funcs and procs are under the same section in the documentation

* update the test
2020-12-09 10:56:28 +01:00