Commit Graph

4992 Commits

Author SHA1 Message Date
Timothee Cour
ff3ace2232 fix code-block test bugs: fix #17183, fix https://github.com/timotheecour/Nim/issues/620 (#17184)
* fix code-block test bugs: fix #17183, fix https://github.com/timotheecour/Nim/issues/620

* cleanup
2021-02-26 16:05:20 +01:00
Timothee Cour
63f1c38f4e hashes: support object default hash (#17175) 2021-02-26 08:45:37 +01: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
Timothee Cour
a4e6b242d5 asyncjs: add then, catch for promise pipelining (#16871)
* asyncjs: add then
* improve tests, changelog, API
* fix cryptic windows error: The parameter is incorrect
* address comments
2021-02-24 21:03:21 +01: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
Andreas Rumpf
e9a287fe12 fixes #17170 (#17171) 2021-02-24 17:43:13 +01:00
Timothee Cour
8942586fa6 wrapnils: add ??. which returns an Option (#16931)
* wrapnils: add option-like API with ??., isSome, get
* fix test after rebase
* cleanups
* fix changelog
* address comments regarding get vs unsafeGet
2021-02-24 14:02:32 +01:00
Timothee Cour
11a7fa68f6 fix #17159 items(cstring) works in VM (#17160)
* fix #17159 items(cstring) works in VM

* improve test coverage tests/stdlib/tcstring.nim; add helpers: whenRuntimeJs, whenVMorJs

* document items(cstring)

* address comments
2021-02-24 14:01:06 +01:00
flywind
3021252ad4 close #14581 add testcase (#17169)
* remove unnecessary when statement

* remove outdated codes

* close #14581
2021-02-24 13:49:47 +01:00
Timothee Cour
0bb7e8dcb4 cleanup tests/stdlib/tstring.nim (#17158)
* cleanup tests/stdlib/tstring.nim

* cleanup tests/stdlib/tstring.nim

* cleanup rest of test
2021-02-24 13:47:36 +01:00
flywind
cbe3c993b6 close #15563 add testcase (#17168)
* remove unnecessary when statement

* remove outdated codes

* close #15563

* Update tests/typerel/t15563.nim

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

* address comments

* tiny

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-02-24 13:44:10 +01:00
Andreas Rumpf
6278b5d89a new-style concepts implementation, WIP (#15251)
* fixes #15210 [backport:1.2]

* make tests green
* make ordinal work
* makes Swapable test compile
* make Indexable example work
* concepts: 'self' is now 'Self'
* concepts: make Dictionary example compile
* document the new concept implementation
* concepts: make typeDesc work properly
* concepts: allow documentation comments (d'oh)
2021-02-24 13:17:33 +01:00
flywind
3f38f8fbb7 add strbasics.strip (#16280) 2021-02-24 10:22:47 +01:00
flywind
46bd222c89 [stdlib] make cookies module modern (#17116)
* update cookies module
* introduce sameSite.Default

Co-authored-by: hlaaftana <10591326+hlaaftana@users.noreply.github.com>
2021-02-24 10:14:19 +01:00
Timothee Cour
c274e67198 add enumutils.items for sparse enums, typetraits.SomeSparseEnum (#17080)
* add enumutils.items for enum with holes
* changelog
* ref in lib.rst
* use `type SomeSparseEnum* = (not Ordinal) and enum` instead of concept
* address comment: rename back to enum with holes
2021-02-23 20:25:35 +01:00
Timothee Cour
5d95137ce0 remove tests/deps/ (#17132)
* remove tests/deps/

* fix tests

* fix tests/manyloc/keineschweine/lib/zlib_helpers.nim

* fixup
2021-02-23 13:31:53 +01:00
Saem Ghani
7c2ac98880 Fixes #17039 - ldObj checks node/nodeAddr access (#17123)
Checked field expressions, such as an object variant field access results in
occasionally broken address analysis crashing the VM. This guard added here
mimics guarded access in ldObjAddr as well. This is to prevent a crash, while a
fix is devised.
2021-02-23 09:02:06 +01:00
Timothee Cour
ce7caec4b3 add io.readChars overload (simpler, less error prone) (#16044)
* add simpler to use readChars overload

* use new readChars overload

* Update lib/wrappers/openssl.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-02-22 20:13:08 +01:00
konsumlamm
a1f4113705 Improve the ropes module (#17145)
* Improve ropes module

Improve wording
Update runnableExamples
Add index bound check for `[]`
Minor format changes

* Update tests/stdlib/tropes.nim

Run on C & JS target
Test in VM
Add tests for `[]`
2021-02-22 19:58:37 +01:00
rockcavera
d76d79336f fix #15215 (#17142)
* fix 15215

* fix test

* end line

* Update tests/stdlib/tnetconnect.nim

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

* Update lib/pure/net.nim

Co-authored-by: flywind <xzsflywind@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-22 17:40:57 +01:00
Saem Ghani
2aba116bbc when statements branches exit early (#17143)
When statement branches exit early outside of nimvm. In nimvm it seems that all
sides of the branches must be evaluated as the code gen happens at a later
stage, this remains intact.
2021-02-22 12:27:23 +01:00
flywind
f07a072691 [JS + docs] improve std/monotimes module (#17103) 2021-02-22 11:09:25 +01:00
Timothee Cour
55a33e1664 testament: support disabled:osx as alias to disabled:macosx (#17124) 2021-02-22 11:01:15 +01:00
Andrey Makarov
fab1618eb4 make rst.nim use object variant (#17138)
* make rst.nim use object variant

* add workaround

* fix mistake
2021-02-22 11:00:31 +01:00
flywind
32bf10126c fix #17118 (#17119) [backport:1.2]
* fix js unsigned integer
* Use `std` prefix for standard library modules
* fix #17118
2021-02-22 09:14:18 +01:00
Timothee Cour
cde950e1bc make copySign for js consistent with other backends (#16609)
* make copySign work more robustly in js
* improve tests
* improve tests/vm/tcastint.nim
2021-02-22 08:47:00 +01:00
flywind
146beb2797 remove unnecessary when statement (#17135) 2021-02-21 11:17:25 +01:00
Timothee Cour
e94a3e5fcd move prelude so that include std/prelude also works (#17110)
* move prelude so that `include std/prelude` also works

* add test
2021-02-20 18:08:13 +01:00
konsumlamm
bd199a8d31 Improve the strformat module (#17106)
* Improve the strformat module

Improve documentation
Use runnableExamples

* Fix overflow error for low(int64)

Add test

* Use assert in runnableExamples

* Improve tstrformat

Put tests in proc & test VM
Put tests in blocks
Add c, js targets

* Use doAssert in tests

* Disable JS & VM tests
2021-02-20 18:06:29 +01:00
Timothee Cour
6b3bdd798d enable bsd for tsetutils; improve setutils API (#17098) 2021-02-20 18:02:57 +01:00
Andrey Makarov
d1fec552d0 stricter checks for RST headlines (#17089) 2021-02-20 18:01:45 +01:00
Timothee Cour
0fcf1af765 uri: document removeDotSegments, add tests, show failure modes (#17064)
* uri: document removeDotSegments, add tests, show failure modes
* address comments
2021-02-20 17:58:54 +01:00
flywind
69611ee487 Ref #12700 add testcase (#17096)
* fix js unsigned integer

* better

* ref #12700 add testcase
2021-02-19 14:09:12 +01:00
Andreas Rumpf
4395a26764 fixes #17085 [backport:1.2] (#17101) 2021-02-19 12:30:39 +01:00
flywind
c1a06bd56e close #13859; add testcase (#17099)
* fix js unsigned integer

* better

* close #13859; add testcase
2021-02-19 11:36:35 +01:00
alaviss
ccc0667c29 system/excpt: let the OS handle termination on signal (#16712) 2021-02-19 00:29:21 -08:00
Jason Beetham
35ded02074 Add setutils.complement, setutils.fullSet (#17066) 2021-02-18 17:33:28 -08:00
flywind
cd274a5ac9 fix stringify unsigned integer in JS and JS VM (#17086)
* fix js unsigned integer

* better
2021-02-18 20:13:52 +01:00
flywind
301d784256 [nodejs backend] paramStr, paramCount (#17082) 2021-02-18 08:26:50 +01:00
flywind
8873ec6084 fix #17076 (#17081) 2021-02-18 06:59:58 +01:00
Timothee Cour
31bb67a309 add -d:nimStrictMode in CI to keep code from regressing; fixes ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764) 2021-02-17 19:30:09 +01:00
flywind
35e14998ec fix math.frexp function signature (#16725) 2021-02-17 19:27:48 +01:00
Clyybber
aa3af9e053 ARC Analysis in one pass v3 (#17068)
* Analyse last reads all at once

* Integrate firstWrite analysis

* Small cleanup

* Use sets instead of seqs

* Remove instrTargets

* Reap the benefits

* Implement error diagnostics

* Operate on DFA index for lastRead analysis

* Use mgetOrPut

* Cache alias results

This improves performance by a lot, since many
CFG locations map to a single PNode

* Improve performance

* Improve performance

* Cleanup

* Fix #17025

* Grammar

* Expand testcase
2021-02-17 14:17:35 +01:00
flywind
4f118721be make system random work in VM (#17059)
* make system random work in VM
2021-02-17 11:52:46 +01:00
Andreas Rumpf
f32ffb6ed8 fixes #17033 [backport:1.4] (#17061)
* fixes #17033 [backport:1.4]

* make test robust against stdlib gensym things

* cleanup assertions.nim to make topt_no_cursor easier to get right
2021-02-17 11:00:03 +01:00
Timothee Cour
b9994925f5 remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#16918)
* nimNoArrayToCstringConversion deadcode
* nimbabel deadcode
* nimHasalignOf deadcode
* nimvarargstyped deadcode
* nimhygiene deadcode
* nimNewTypedesc deadcode
* nimlocks deadcode
* nimHasCppDefine deadcode
* nimHasRunnableExamples deadcode
* nimHasNilChecks deadcode
* nimSymKind deadcode
* minor macros refactoring
* nimVmEqIdent deadcode
* nimNoNil deadcode
* nimNoZeroTerminator deadcode
* nimHasSymOwnerInMacro deadcode
* nimVmExportFixed deadcode
* nimNewRuntime deadcode
* nimAshr deadcode
* nimUncheckedArrayTyp deadcode
* nimHasTypeof deadcode
* nimErrorProcCanHaveBody deadcode
* nimHasHotCodeReloading deadcode
* nimHasSignatureHashInMacro deadcode
* nimHasDefault deadcode
* nimMacrosSizealignof deadcode
2021-02-17 09:32:36 +01:00
Andreas Rumpf
e463a67c74 don't introduce 'dispose', use '=dispose', fixes #17003 [backport:1.4] (#17062) 2021-02-17 00:07:37 +01:00
Benoit Favre
81703d4ad4 Fix bug in removeDotSegments: added test (#17050)
* Fix bug in removeDotSegments when path ends with dot

* Add test for trailing period bug in uri
2021-02-16 20:20:37 +01:00
konsumlamm
0a9a90d991 Improve documentation for bitops (#16961)
* Improve documentation for bitops

Use func
Use let in runnableExamples

* Remove unnecessary tests

Fix #7587
2021-02-15 21:17:45 +01:00
Clyybber
70b9e9962f Revert "ARC: Analysis in one pass v2 (#17000)" (#17046)
This reverts commit 216be4060a.
2021-02-15 18:31:15 +01:00