Commit Graph

5052 Commits

Author SHA1 Message Date
ee7
b70e33f5bb strutils: improve doc comments for replace funcs (#17427)
This commit fixes mispellings of "occurrence" introduced by:
- 76a3b350ce (#17337)
- 8e8bea9044 (#17339)
and adds the same "every occurrence of" in the `replaceWord` func.

Other changes:
- Prefer "replace with" to "replace by".
- Be more consistent with "the" - prefer "of the character" given that
  we wrote "by the character".
- Try to be more consistent with writing the types - add
  "the string `sub`" given that we wrote "the character `sub`".
2021-03-20 13:22:50 +01:00
haxscramper
430c30299f [FIX] use mixin for strscans.scanp (#17371) 2021-03-19 20:16:52 +01:00
Héctor M. Monacci
8e8bea9044 Clarify behaviour of char replace (#17339)
Clarify behaviour of char replace by adding ```every ocurrence of character```
2021-03-19 11:19:41 -07:00
Andreas Rumpf
6c1c8f51b3 IC: green tests (#17311)
* IC: renamed to_packed_ast module to ic module

* IC: don't store the --forceBuild flag, makes it easier to test

* IC: enable hello world test

* Codegen: refactorings for IC; changed the name mangling algorithm

* fixed the HCR regressions

* life is too short for HCR

* tconvexhull is now allowed to use deepCopy

* IC exposed a stdlib bug, required a refactoring

* codegen: code cleanups

* IC: even if a module is outdated, its dependencies might come from disk

* IC: progress

* IC: better name mangling, module IDs are not stable

* IC: another refactoring helping with --ic:on --gc:arc

* disable arraymancer on Windows for the time being

* disable arraymancer altogether

* IC: make basic test work with 'nim cpp'

* IC: progress on --ic:on --gc:arc

* wip; name mangling for type info
2021-03-19 16:53:38 +01:00
Timothee Cour
4dd34feb08 doc times: do not use now (and also epochTime) for benchmarking (#17405)
* doc times: do not use now for benchmarking

* Update lib/pure/times.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Update lib/pure/times.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-03-18 15:17:20 +01:00
Timothee Cour
2356d0603f followup #17398: getTempDir, getConfigDir now do not have trailing DirSep (#17402)
* followup #17398: `getTempDir`, `getConfigDir` now do not have trailing DirSep

* fix test
2021-03-18 13:25:56 +01:00
Timothee Cour
bebf2ce24a fix #17393 getHomeDir and expandTilde should not include trailing / (#17398)
* fix #17393 getHomeDir and expandTilde should not include trailing `/`

* changelog
2021-03-17 08:25:28 +01:00
Timothee Cour
5fe5f47033 followup #17389; add see also in std/json (#17400)
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-03-16 19:21:32 -07:00
Igor Ribeiro de Assis
9bb0e55749 Fix FutureStream memory usage (#17395) [backport:1.2] 2021-03-16 21:46:22 +01:00
Timothee Cour
895a40d1ac fix #17383: json.%,to and jsonutils.formJson,toJson now works with uint|uint64 (#17389) [backport:1.2]
* fix #17383: json.%,to and jsonutils.formJson,toJson now works with uint|uint64
* fixup
* fix for js
2021-03-16 21:44:54 +01:00
Miran
40a5d6537a fix #17385, len must be declared before items (#17386) 2021-03-15 10:45:10 -07:00
xioren
7937abab44 Clean up imports in httpclient.nim (#17367)
* Clean up imports

Fix duplicate 'streams' import.

* Update lib/pure/httpclient.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-03-14 11:14:44 +08:00
flywind
2e730f1452 rename channels to channels_builtin (#17330)
* improve test coverage for isolation

* a bit better

* rename channels to channels_builtin
2021-03-12 13:04:32 +01:00
xioren
3d198fdcc2 Relocate 4xx/5xx exception in downloadFile (#17332) [backport:1.2]
Move 4xx/5xx exception to before disk i/o. As it stands an empty file is created on http error 4xx/5xx.
2021-03-12 08:09:39 +01:00
Miran
e922d73dd6 refs #4347, add ZZZ and ZZZZ patterns for timezone offsets without colons (#17318) 2021-03-11 16:32:50 +01:00
Héctor M. Monacci
76a3b350ce Clarify behaviour of ``replace`` (#17337)
* Clarify behaviour of ```replace```

Clarify behaviour of ```replace``` by adding the word ```every```

* Update lib/pure/strutils.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-03-11 14:05:57 +01:00
konsumlamm
9819fb21d8 Use .. warning:: (#17320) 2021-03-10 10:39:23 -08:00
Timothee Cour
eb07a5a75b add typetraits.OrdinalEnum, enumutils.symbolName (#17281) 2021-03-10 08:08:24 -08:00
konsumlamm
3dc1bd0d09 Change parameter names in lists module from L (#17321) 2021-03-10 17:07:31 +01:00
konsumlamm
b52febf77e Improve the lists module (#17312) 2021-03-10 08:25:50 +01:00
konsumlamm
083eeda085 Small improvements for the distros module (#17309) 2021-03-09 18:41:07 +01:00
Juan Carlos
4d0b87a5cd Add Portals (#17306)
* Add Portals

* Add Portals
2021-03-09 12:22:54 +01:00
flywind
cc37fee0ab fix #17275 (#17276) 2021-03-09 12:22:26 +01:00
flywind
9c5223a5f5 remove unnecessary deps (#17307)
* improve test coverage for isolation

* a bit better

* remove unnecessary deps
2021-03-09 10:35:10 +01:00
Timothee Cour
d161d27cdd fix #13491 #17279 runnableExamples now don't get lost in translation (#17282)
* fix #13491 runnableExamples rendering
* fix a runnableExamples thanks to this bugfix
2021-03-09 07:09:24 +01:00
Roman Inflianskas
31424b3808 stdlib/os: add isAdmin (#17012)
* stdlib/os: add isAdmin

* uint8 -> cuchar, assert isAdmin on Azure

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

* Update lib/pure/os.nim docs

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

* Address comments on #17012

* Raise on errors in #17012

* Check the result of FreeSid in #17012

* Change case in #17012

* Fix memory leak in #17012

* Address comments in #17012

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

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-07 22:40:16 +01:00
flywind
0e3ea16554 use lowercase --define switches (#17283) 2021-03-07 12:08:41 +01:00
Timothee Cour
07df4fe560 runnableExamples for walkFiles + friends (#17271)
* runnableExamples for walkFiles + friends

* address comments
2021-03-06 23:48:55 +01:00
konsumlamm
2e8325a19c Remove support for named procs with sugar.=> (#17220)
* Add docs & tests for named procs with sugar.=>
* Remove support for named procs in sugar.=>
* Resolve conflict
* Fix test
2021-03-05 12:08:03 +01:00
flywind
cda443ee68 follow up #17165 (#17262) 2021-03-04 22:41:20 -08:00
Jason Beetham
f28dc2c61e Added assertion to clamp (#17248)
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-03-04 17:27:02 -08:00
flywind
81889fb84c reuse jsffi in json module (#17165)
* remove unnecessary when statement

* remove outdated codes

* reuse jsffi

* move js json coverage
2021-03-04 19:37:12 +01:00
flywind
5670b848cb use .. warning:: (#17226)
* remove unnecessary when statement

* remove outdated codes

* use warnings
2021-03-04 11:34:55 +01:00
Jason Beetham
c180de60a8 Added math.clamp for slice clamping (#17246)
* Added math.clamp for slice clamping

* Added inline to math.clamp

* Cleaned up math.clamp + test
2021-03-03 23:54:23 +00:00
Juan Carlos
4982d1c662 https://github.com/nim-lang/Nim/pull/15826/files#r585368355 (#17233) 2021-03-03 11:58:05 +01:00
Clyybber
507873be25 Use readable escape sequences (#17241) 2021-03-03 07:15:07 +01:00
Danil Yarantsev
f5a63ade7a Replace double backticks with single backticks - Part 5 out of ~8 (#17217)
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-03-01 18:11:25 -08:00
Danil Yarantsev
285539c87a Replace double backticks with single backticks - Part 4 out of ~7 (#17216) 2021-03-01 18:00:58 -08:00
Timothee Cour
dd6b0f81ef use -r:off for runnableExamples that should compile but not run (#17203)
* use -r:off for runnableExamples that should compile but not run

* use -r:off in other RT disabled tests
2021-03-01 14:26:39 +01:00
Danil Yarantsev
aef55a7a88 Replace double backticks with single backticks - Part 3 out of ~7 (#17207) 2021-02-28 23:22:05 -08:00
Danil Yarantsev
56461c280f Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -08: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
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
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
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