Commit Graph

8987 Commits

Author SHA1 Message Date
Jonas Schubert Erlandsson
f35e9a5752 Adds source to single tags list (#18920) 2021-09-29 18:14:31 +02:00
Timothee Cour
f061971a9b envPairs works in vm, nims (#18615)
* envPairs works in vm, nims

* fixup
2021-09-29 09:32:39 +02:00
flywind
5eb357f5a2 change comment (#18913) 2021-09-28 06:45:25 +02:00
Aditya Siram
e3b19cbe52 fixes #18878 (#18883) 2021-09-25 14:17:41 +02:00
flywind
4adada0d80 fix a typo (rename temporal to temporary (#18892) [backport] 2021-09-24 16:34:12 +02:00
Andreas Rumpf
5d315ebcc2 ported Nim to proprietary CrossOS [backport] (#18889) 2021-09-24 13:24:41 +02:00
Andreas Rumpf
90a2b5afd8 correct effect tracking for .borrowed procs [backport] (#18882)
* correct effect tracking for .borrowed procs [backport]

* progress

* fix error message in a test

* correctly fix it

Co-authored-by: narimiran <narimiran@disroot.org>
2021-09-23 16:47:24 +02:00
flywind
ee9795f76f fix #18844 (#18851) 2021-09-20 09:50:20 +02:00
Andreas Rumpf
3241df2a13 fixes #18858 [backport] (#18868)
* fixes #18858 [backport]

* ensure async tests work with --experimental:strictEffects [backport]

* ensure async tests work with --experimental:strictEffects [backport]
2021-09-19 23:35:50 +02:00
flywind
1f68f71ec2 [minor] fix docs (#18834) 2021-09-11 11:33:52 +02:00
flywind
6c2f041368 fix code-block which causes missing docs 2021-09-11 09:25:48 +08:00
Juan Carlos
0ef830577b distros.foreignDeps made public (#18830)
* Deprecate distros.echoForeignDeps

* Deprecate distros.echoForeignDeps

* https://github.com/nim-lang/Nim/pull/18830#discussion_r705364162

* https://github.com/nim-lang/Nim/pull/18830#discussion_r705364162
2021-09-10 10:20:32 +02:00
flywind
b3ad68edea remove channels (#18801)
* remove channels

* test
2021-09-04 15:57:02 +02:00
Sven Keller
3c2edd142b fix for js strict mode (#18799)
* Assignments, which would accidentally create global
variables, instead throw an error in strict mode

* Assignment to a getter-only property

Co-authored-by: Sven Keller <s.keller@cortona.de>
2021-09-04 12:53:02 +02:00
Andreas Rumpf
ac7acd827c we need something better than warningAsError for effect handling viol… (#18796)
* we need something better than warningAsError for effect handling violations
2021-09-04 08:18:00 +02:00
Jacek Sieka
0635697a89 Document -d:async_backend flag (#18700)
* Document `-d:asyncBackend` flag

Since libraries may want to support multiple async backends, it's useful
to standardize the way this is done, so as to simplify usage of any
async backend within the ecosystem.

A similar text is being added to chronos here:
https://github.com/status-im/nim-chronos/pull/216

See also https://github.com/status-im/nim-chronos/issues/207

* typos, add none

* Update lib/pure/asyncdispatch.nim

* Update lib/pure/asyncdispatch.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-09-03 14:20:57 +02:00
Andreas Rumpf
f46569bafd fixes #18494 (#18783) 2021-09-02 17:16:03 +02:00
Andreas Rumpf
69cabaa81c sequtils now support strict effect tracking (#18782) 2021-09-02 14:35:25 +02:00
Tomohiro
7c8ea490a2 Fix initrand to avoid random number sequences overlapping (#18744)
* Fix initrand to avoid random number sequences overlapping

* Minor fix

* Fix compile error on js backend

* Disable new test for js backend

* Minor fix

* tempfiles module uses random.initRand()

* Remove unused module import from lib/std/tempfiles.nim

* Initialize baseState in initRand()

* Run tests/stdlib/trandom.nim from tests/test_nimscript.nims

* baseState is initialized only with sysrand.urandom and quit if failed

* Add comments
2021-09-02 14:12:14 +02:00
Andreas Rumpf
e0ef859130 strict effects (#18777)
* fixes #17369
* megatest is green for --cpu:arm64
* docgen output includes more tags/raises
* implemented 'effectsOf' 
* algorithm.nim: uses new effectsOf annotation
* closes #18376
* closes #17475
* closes #13905
* allow effectsOf: [a, b]
* added a test case
* parameters that are not ours cannot be declared as .effectsOf
* documentation
* manual: added the 'sort' example
* bootstrap with the new better options
2021-09-02 12:10:14 +02:00
konsumlamm
f02de25ca1 Fix #15150 (#18730) 2021-08-31 08:14:05 +02:00
flywind
c07d8da7b9 add missing docs (#18758) 2021-08-29 09:18:54 +02:00
Juan Carlos
041edaa1df Implement RFC-413 (#18749)
* Implement RFC 413

* Implement RFC 413

* Implement RFC 413

* Implement RFC 413

* https://github.com/nim-lang/Nim/pull/18749#discussion_r696320995

* Update lib/js/dom_extensions.nim

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

* Update lib/js/dom_extensions.nim

* https://github.com/nim-lang/Nim/pull/18749#discussion_r696913310

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-08-26 23:07:54 +02:00
Dankr4d
c70e4040bd fixes #14511 [backport:1.4] (#18732)
* fixes #14511 [backport:1.4]

Signed-off-by: Dankr4d <dude569@freenet.de>

* Replaced fix with code from alaviss, for better readability, with small
changes.

Signed-off-by: Dankr4d <dude569@freenet.de>

* - Specified output in test.

Signed-off-by: Dankr4d <dude569@freenet.de>

* Replaced case in nnkRecCase with a simpler version, which just adds the
last son.

Signed-off-by: Dankr4d <dude569@freenet.de>

* Update tests/macros/t14511.nim

* Update tests/macros/t14511.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-08-25 17:27:00 +00:00
flywind
9674ff4361 make deprecated message better (#18737) 2021-08-23 11:13:10 -07:00
konsumlamm
2d84f6e7c8 Fix #18718 (#18731)
Update tests
2021-08-23 00:13:39 +02:00
Juan Carlos
e65dc36ddd Implement RFC-391 (#18585) 2021-08-22 12:32:55 -07:00
flywind
cc08d5c2c6 fix #17898(randomPathName called twice in a row can return the same string on windows) (#18729)
* close #17898

* no need to consider js
2021-08-22 07:40:20 +02:00
flywind
061a9183f7 replace wrt with proper word (#18724)
* what does wrt mean?

* clarify
2021-08-22 06:21:53 +02:00
Tomohiro
373bbd9bb4 Add ceilDiv to math (#18596)
* Use assert in runnableExamples and improve boundary check
* Add more tests for ceilDiv
* Fix comment in ceilDiv
* Calling ceilDiv with int type T such like sizeof(T) > 8 is error
2021-08-19 11:35:40 +02:00
Timothee Cour
394f4ac7bb improvements to addInt and $ for integer types (#18592)
* improvements to $(SomeInteger) and addInt
* remove mIntToStr, mInt64ToStr
* improvements
* fix tests/pragmas/tinjectstmt.nim; the diff is harmless, cgen code is identical with -d:danger or debug mode
* rm tests/system/tstrmantle.nim
* revert compiler/jsgen.nim for -d:nimVersion140
2021-08-19 11:33:52 +02:00
Emery Hemingway
5fd150b7f7 asynchttpserver: ipv6 support (#18706)
Fix #18705
2021-08-18 14:25:25 +02:00
flywind
901c5ded52 fix #18702(fix parseutils.parseFloat) (#18703) [backport:1.0]
* fix #18702
* Apply suggestions from code review
2021-08-16 15:14:35 +02:00
Juan Carlos
b3e077863a Documentation only, Terminal (#18696)
Add simple progress bar example to terminal module
2021-08-14 20:51:41 -04:00
Timothee Cour
52cc0a82ca fix #18692 AsyncHttpServer was hanging because client.close was not called (#18693) 2021-08-14 02:13:30 -07:00
Timothee Cour
b24812df5f properly fix #10053 ; FieldDefect msg now shows discriminant value + lineinfo, in all backends (c,vm,js) (#11955)
* fix #10053 FieldError for vm

* fixup

* FieldError now also shows runtime value of discriminant

* fix field error reporting in vm

* also report culprit line info in err msg

* fix errors for newruntime 2

* fix for js

* fixup

* PRTEMP4

* works

* works

* works perfect

* refactor

* std/private/repr_impl

* suppport --gc:arc

* cleanup

* refactor

* simplify

* simplify

* simplify

* fixup

* move out compiler.vmgen.genCustom

* fixup

* fixup

* add tests

* revert compiler/debugutils.nim

* simplify reprDiscriminant

* fixup

* lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim

* try to fix D20210812T165220

* honor --declaredlocs

* control toFileLineCol via --declaredlocs
2021-08-13 09:35:48 +02:00
Jaremy Creechley
3a1109a53b initial fix for compiling Nim on Zephyr RTOS (issue #18684) (#18685)
* initial fix for compiling Nim on Zephyr RTOS (issue  #18684)

Co-authored-by: Jaremy J. Creechley <jaremy.creechley@wavebaselabs.com>
2021-08-13 08:57:29 +02:00
flywind
883c04d444 don't use space after proc names (#18681) 2021-08-12 20:57:12 -04:00
flywind
f559319a68 fix a sqlite bug (#18669) 2021-08-12 09:21:01 -07:00
Timothee Cour
5c1304a418 fix #18670 quoteShellCommand, quoteShell, quoteShellWindows on windows (#18671) 2021-08-12 16:50:08 +02:00
RSDuck
d0dd923acf Switch maintanance (#18668)
* Fix and improve Nintendo Switch support

* Document the necessity for nimAllocPagesViaMalloc

* update changelog

* Use --gc:orc in examples
2021-08-11 08:54:49 +02:00
Timothee Cour
8ce782d463 Add optional recursive arg to distinctBase (v2) (#18659)
* Add optional recursive arg to distinctBase
* Add docs and examples

Co-authored-by: ALANVF <alan.invents@gmail.com>
2021-08-09 08:51:39 +02:00
Timothee Cour
988c02b7cb renamed: lib/std/private/vmutils.nim -> lib/std/private/bitops_utils.nim to avoid confusion with unrelated std/vmutils (#18660) 2021-08-08 19:24:45 -07:00
flywind
a7e622267e use lent (#18638) 2021-08-08 20:44:14 +02:00
Christian Ulrich
0d3af5454b Only allow IPv4 literals in strict form (#18656)
* Only allow IPv4 literals in strict form

The strict form as defined in RFC 6943, section 3.1.1 only allows the dotted
form ddd.ddd.ddd.ddd of IPv4 literals, where ddd is a one to three digit decimal
number between 0 and 255. Until now octal numbers (with a leading zero) were
interpreted as decimal numbers which has security implications, see
CVE-2021-29922 and CVE-2021-29923.

* Update lib/pure/net.nim

Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-08-08 19:11:07 +01:00
Kyle Brown
eb19db6595 Nim pretty and add void (#18652)
* pretty and add void

* distro fixup

* Update lib/pure/distros.nim

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

* tab to space

* requested change to be cleaner

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-08-08 19:30:51 +02:00
flywind
9269a72f6f [nre]fix #17129 (#18632)
* fix #17129

* correct

* give reference implementaion links

* add comment

* typo

* I'm conservative

* change
2021-08-08 19:27:43 +02:00
Timothee Cour
c0abdaa2b4 improve runnableExamples and docs for std/nre (#18634)
* improve runnableExamples and docs for std/nre

* avoid too long lines in example
2021-08-02 22:22:47 -07:00
Kyle Brown
499d4690fb Add Artix to distro list (#18629) 2021-08-02 03:38:15 -04:00
flywind
916d0c21af fix #18620 (#18624)
* fix #18620

* add testcase
2021-08-01 11:19:43 +02:00