Commit Graph

19647 Commits

Author SHA1 Message Date
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
flywind
72fa5833ad fix #9778 (pairs iterator calling a helper proc with tuple return type will cut the iterator yield into half) (#18767)
* test someSymFromImportTable
* Update compiler/lookups.nim
* test nkTupleConstr
* use isConstExpr
* add tests
* add comments and todo
* use todo
2021-09-02 07:41:14 +02:00
flywind
3469f3a393 add Apple Silicon to supporting platforms (#18772)
* add Apple Silicon to supporting platforms

* Update readme.md

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

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-08-31 14:05:45 +02:00
flywind
8f4bdb3596 [minor]break loops after a candidate is added to seqs (#18770)
* [minor]break loops when added

* Update compiler/lookups.nim

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

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-08-31 13:32:37 +02:00
konsumlamm
f02de25ca1 Fix #15150 (#18730) 2021-08-31 08:14:05 +02:00
Timothee Cour
fa7c1aa864 move PNode.comment to a side channel, reducing memory usage during compilation by a factor 1.25x (#18760)
* move PNode.comment so a side channel, reducing memory usage

* fix a bug

* fixup

* use sfHasComment to speedup comment lookups

* fix for IC

* Update compiler/parser.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-08-29 15:54:07 +02:00
konsumlamm
0ddd9519c0 Remove Covariance section from the experimental manual (#18688)
* Remove `Covariance` section

* Add blank lines after `.. code-block::`

* Fix CI?
2021-08-29 10:42:52 +02:00
flywind
c07d8da7b9 add missing docs (#18758) 2021-08-29 09:18:54 +02:00
Timothee Cour
014edde36a followup #18759: make compiler build cleanly with 0 warnings/hints (#18764) 2021-08-28 16:34:27 -07:00
Miran
719718df2f more minor bootstrapping cleanups (#18759) 2021-08-28 08:27:56 +02:00
flywind
5eba372570 [minor] break loops if it is ambiguous (#18745)
* [minor] break loops if it is ambiguous

* Update compiler/lookups.nim

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

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-08-27 11:50:06 +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
Timothee Cour
98f7254fb2 followup #18711 grammar_nanny now reports unused non-terminals (#18746)
* followup #18711 cleanup unused grammar rules

* make tools/grammar_nanny.nim report unused terminals

* revert removal of some grammar comments
2021-08-26 07:04:18 +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
Timothee Cour
3aa16c1de0 fix RFC #341: dot-like operators are now parsed with same precedence as . (#18711)
* fix RFC #341: dot-like operators are now parsed with same precedence as `.`

* fixup

* [skip ci] address comment in changelog

* address comment

* update grammmar

* add manual entry

* fixup

* -d:nimPreviewDotLikeOps

* address comment to unblock PR: move nimPreviewDotLikeOps out of config/config.nims
2021-08-25 06:50:40 +02:00
flywind
3d1bba04ab [minor]use addInt and addFloat (#18733)
* unify int and uint

* back

* minor
2021-08-24 17:16:12 +02:00
Miran
24178bf8aa get rid of the warnings during bootstrapping (#18741)
* fix bootstrapping hints and warnings

* revert removals in ccgtypes
2021-08-24 17:15:26 +02:00
flywind
9674ff4361 make deprecated message better (#18737) 2021-08-23 11:13:10 -07:00
flywind
8a8267e2bc fix a typo (#18736) 2021-08-23 21:05:22 +08: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
flywind
5b26f2bd81 fix deprecated example (#18721) 2021-08-21 08:22:00 +02:00
flywind
f0c6593412 add testcase for overloadable_enums (#18722)
* add testcase for overloadable_enums

* link
2021-08-21 08:21:06 +02:00
flywind
e52221e296 [docs]fix an item missing (#18717) 2021-08-20 20:00:04 +02:00
Timothee Cour
f2910077ac sigmatch: support optional params with last block arg(s) (#18631)
* sigmatch: support optional params with last block arg
* add tests
* works with multiple block args
* cleanup
* address comment
2021-08-20 10:13:03 +02:00
flywind
13b9729183 fix #18627(Program segfaults with ARC when using openArray[string]) (#18713)
* fix #18627
* add testcase
* rename
* another
* remove tyVarargs
2021-08-19 19:56:52 +02:00
flywind
8fa0decf6b fix a typo (#18715) 2021-08-19 21:54:45 +08: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
Timothee Cour
7b58dc2de0 allow building 1.4.0 from devel (#18708)
* allow building 1.4.0 from devel

* changelog
2021-08-18 19:33:11 +02:00
flywind
0778a38bbd [wip]better hint message for JS (#18704)
* better hint message for JS

* both
2021-08-18 15:53: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
Timothee Cour
1acba63cb7 cross compilation targetting windows now supports nim r: nim r -d:mingw main (#18682)
* cross compilation targetting windows now supports `nim r`: `nim r -d:mingw main`

* quoteShell

* address comment: remove `conf.getConfigVar("nimrun.exe")`
2021-08-16 09:32:12 +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
Andreas Rumpf
4463a3c3d7 manual: minor improvements (#18687) 2021-08-13 12:34:28 +02: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
Andreas Rumpf
018465a234 fixes #18643 [backport:1.0] (#18678) 2021-08-12 08:25:11 +02:00
Timothee Cour
c94933acb7 fix #18674 --nimcache now works better with --os:windows (#18675) 2021-08-11 13:30:51 -07:00
Andreas Rumpf
bc14b77359 fixes #18665 DFA generator bug (#18676) 2021-08-11 17:19:23 +02:00
Timothee Cour
6c1bd4bb1c fix: var a{.foo.} = expr inside templates (refs #15920) (except when foo is overloaded) (#13869)
* fix: `var a{.foo.} = expr` inside templates
* add test
* improve tdecls test
* improve tests
* add failing test
* PRTEMP
* fixup
2021-08-11 12:17:17 +02:00
Timothee Cour
8540065754 --cc:env now works correctly to assign linker executable, allowing to cross-compile/run for windows on osx via wine (#18672)
* --cc:env now works correctly to assign linker executable, allowing using wine on osx

* fixup
2021-08-11 11:42:01 +02:00