Commit Graph

176 Commits

Author SHA1 Message Date
Timothee Cour
82996aee3f misc fixes: remove forceConst (obsolete by static), add more runnableExamples to system (#17896)
* misc fixes

* add runnableExamples for compileOption

* add runnableExamples for runnableExamples

* move tconsteval => tconst

* cleanup
2021-05-01 07:26:52 +02:00
Timothee Cour
20248a68fd gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten (#17892)
* gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten
* refactor with createTempDir
* cleanup
* refacotr
* PRTEMP fake test spec changes to show effect of diffStrings
* add runnableExamples for experimental/diff + cross-reference with gitutils
* Revert "PRTEMP fake test spec changes to show effect of diffStrings"

This reverts commit 57dc8d642d.
2021-04-30 11:00:33 +02:00
Timothee Cour
e4db733d80 fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile (#17889)
* fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile

* fix for tests/async/tasyncfile.nim

* hide mode for now

* add notice regarding stability
2021-04-29 13:42:56 +02:00
Timothee Cour
dce0b3b002 refactor all code that builds csources (#17815)
* refactor all code that builds csources
* fixup
* nim_csourcesDir_v0 + nim_csourcesDir
* remove deprecated, unused scripts from ci/
* reuse nimCsourcesHash in ci
* simplify CI pipelines by reusing nimBuildCsourcesIfNeeded
* simplify ci_docs.yml by reusing nimBuildCsourcesIfNeeded
* cleanup
* use csources_v1 as destination dir
* fixup
* remove pushCsources
* address comment: remove build.sh support for now
* fixup
2021-04-23 11:28:42 +02:00
flywind
c631648cb3 close #9372 add std/tempfiles (#17361)
* close #9372 add std/tempfile
2021-04-21 15:07:36 +02:00
Andreas Rumpf
a9b62de895 CIs: attempt to use csources_v1 (#16282)
* CIs: attempt to use csources_v1
* also updated the BSDs
* also updated azure pipelines
* std modules should not itself use the 'std/' import dir...
* compiler has to be careful with std/ for v1 booting
2021-04-21 07:41:33 +02:00
flywind
603af22b7c [std/tasks]add gcsafe pragmas (#17799)
* [std/tasks]add gcsafe pragmas

* Update tasks.nim
2021-04-21 11:05:16 +08:00
Clyybber
24abe10aa8 Small privateAccess improvement (#17786) 2021-04-19 17:51:00 +02:00
Clyybber
6de5aa1971 Rename = to =copy in stdlib (#17781) 2021-04-19 13:16:10 +02:00
Timothee Cour
0a10af5a2c privateAccess now works with ref | ptr (#17760) 2021-04-19 00:15:58 +02:00
Timothee Cour
8161b02897 import foo {.all.} reboot (#17706) 2021-04-16 09:16:39 +02:00
flywind
44657b78c4 callback cannot be nil (#17718)
`Task.callback` cannot be nil, we need to raise it at debug and release mode

Situations:
- if users create a Task object without using `toTask` and invoke the Task
- if users already move the Task and invoke the Task
2021-04-14 19:14:14 +02:00
flywind
58f44c8b4e Update channels.nim (#17717) 2021-04-14 16:45:22 +02:00
Timothee Cour
e92c78a9ac add number literal jsbigints.big (#17707) 2021-04-13 09:33:28 +02:00
flywind
f25243140b add std/tasks (#17447) 2021-04-09 11:51:51 +02:00
konsumlamm
9f0f477552 Update sysrand documentation (#17676)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-04-08 12:41:43 -05:00
flywind
a807233aeb fix #17615(runnableExamples silently ignored if placed after some code) (#17619)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-02 18:26:30 -07:00
Timothee Cour
9abd383a2a new genAst as replacement for quote do (#17426)
* new `macros.genAst`: fixes all issues with `quote do`
* add changelog entry
* add workaround for https://github.com/nim-lang/Nim/issues/2465#issuecomment-511076669
* add test for #9607
* add kNoExposeLocalInjects option
* add test case for nested application of genAst
* genAst: automatically call newLit when needed
* allow skipping `{}`: genAst: foo
* add test that shows this fixes #11986
* add examples showing mixin; add examples showing passing types, macros, templates
* move to std/genasts
* improve docs
2021-04-02 13:11:03 +02:00
Timothee Cour
9b67e5c61b jsonutils: support cstring (including as Table key); improve docs (#16062)
* jsonutils: support cstring (including as Table key); improve docs
* changelog
* un-disable a test now that #16061 was fixed
2021-03-31 18:24:39 +02:00
Timothee Cour
04520c0ce4 remove std/ prefix from doc/lib.rst now that canonical import is shown in module docs (#17543)
* remove std/ prefix from doc/lib.rst now that canonical import is shown in module docs

* cleanup top docs for std/sha1
2021-03-29 13:07:14 +02:00
konsumlamm
9e3960e83d Small doc improvements for std/with (#17556) 2021-03-29 12:44:31 +02:00
Timothee Cour
a65189a739 nnkArglist => nnkArgList + special case stylecheck:error (#17529)
* nnkArglist => nnkArgList

* special case stylecheck:error
2021-03-27 10:28:11 +01:00
flywind
c8dda867f2 close #11330 sets uses optimized countSetBits (#17334)
* Update lib/pure/bitops.nim
* Update lib/system/sets.nim
* Apply suggestions from code review

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-03-22 00:36:48 +01:00
Timothee Cour
05743bc9f7 improve jsutils docs (#17421)
* improve jsutils docs

* address comments
2021-03-21 10:35:00 +01:00
konsumlamm
9997b42c35 Use importjs (#17422) 2021-03-19 14:22:48 -07:00
flywind
e332c20ba7 follow up #17276 (#17355)
* improve test coverage for isolation

* a bit better

* rename channels to channels_builtin

* follow up #17276

* fix

* Update lib/std/private/jsutils.nim
2021-03-19 16:54:10 +01:00
flywind
60fc7e986b fix a typo (#17417)
* Revert "make system random work in VM"

* fix #17380

* attempt to fix bug

* fix

* better

* fix

* a bit

* fix the leaks

* revert

* fix

* better

* follow up #17391

* fix

* Update tchannels.nim

* Update tests/stdlib/tchannels.nim

* Update tchannels.nim

* fix a typo
2021-03-19 21:44:13 +08:00
flywind
e9b5543bd5 [std/channels]fix recv leaks(Part One) (#17394) 2021-03-17 10:08:54 +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
flywind
d5eb658034 fix #17380 (#17391) 2021-03-16 07:14:56 +01:00
flywind
51a04a3674 make std/sysrand better (#17360) 2021-03-15 14:07:27 +01:00
flywind
686bf3bfc6 clarify the behavior of newChan
follow up the advice of `timothee`
2021-03-12 22:18:10 +08:00
flywind
a0b8a3d920 New channels implementation for ORC (#17305)
* Update lib/std/channels.nim
* Rename tchannel_pthread.nim to tchannels_pthread.nim
* Rename tchannel_simple.nim to tchannels_simple.nim

Co-authored-by: Mamy Ratsimbazafy <mamy_github@numforge.co>
2021-03-12 13:33:47 +01:00
flywind
5dff66b35a fix wrong examples (#17350)
* fix wrong examples

* Update lib/std/compilesettings.nim

* Update lib/std/compilesettings.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-12 07:33:13 +01:00
flywind
d8b5879c7d clarify the docs of isolation (#17335)
* improve test coverage for isolation

* a bit better

* clarify the docs of isolation
2021-03-11 14:04:08 +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
flywind
cc37fee0ab fix #17275 (#17276) 2021-03-09 12:22:26 +01:00
Timothee Cour
93cb5d6896 add setutils.[]= (#17272)
* add setutils.[]=
* address comments
* proc => func (for other symbols too)
2021-03-08 10:39:39 +01:00
Juan Carlos
b8c04bdb92 Add module jsfetch (#12531)
* Add module jsfetch for fetch support for JavaScript target https://developer.mozilla.org/docs/Web/API/Fetch_API

* Update lib/std/jsheaders.nim

* Update lib/std/jsformdata.nim

* Update lib/std/jsfetch.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-03-06 20:57:16 -08:00
flywind
e045c28da5 add warnings to std/isolation (#17270)
* remove unnecessary when statement

* remove outdated codes

* reuse jsffi

* move js json coverage

* add warnings to std/isolation
2021-03-05 17:14:26 +01:00
flywind
19be5eb1eb Add unsafeIsolate and extract to std/isolation [backport:1.4] (#17263) 2021-03-05 16:21:33 +01:00
flywind
171b03c386 fix #17264 [backport:1.4] (#17266)
* fix #17264
* fix vm
* fix js and add tests
2021-03-05 14:39:46 +01:00
flywind
cda443ee68 follow up #17165 (#17262) 2021-03-04 22:41:20 -08:00
Juan Carlos
2e3d324cc6 Improve Bigint (#17252)
* https://github.com/timotheecour/Nim/issues/566#issue-799927295

* Update lib/std/jsbigints.nim

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

* Update lib/std/jsbigints.nim

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

Co-authored-by: flywind <xzsflywind@gmail.com>
2021-03-04 14:02:36 +01:00
flywind
a04c9d1f62 rename prepareStrMutation to prepareMutation (#17235)
* remove unnecessary when statement

* remove outdated codes

* rename prepareStrMutation to prepareMutation
2021-03-03 08:08:52 +08:00
Andreas Rumpf
bb0c19f42c fixes #17173 (#17213)
* fixes #17173

* add testcase (#17214)

* Apply suggestions from code review

* fix for newruntime

* Apply suggestions from code review

* Update lib/system.nim

* Update lib/system.nim

* Update lib/system.nim

Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com>

Co-authored-by: flywind <xzsflywind@gmail.com>
Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com>
2021-03-01 20:58:12 +01:00
Timothee Cour
0cb02fbbee add overload add(a: var string, b: openArray[char]) (#15951)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-03-01 07:51:12 -08:00
Danil Yarantsev
56461c280f Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -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