Commit Graph

9574 Commits

Author SHA1 Message Date
Etan Kissling
8bba04078c avoid AnyEnumConv warning in genEnumCaseStmt (#22061)
When parsing enums from strings using `genEnumCaseStmt`, `AnyEnumConv`
warnings are generated due to conversion from integer value. It seems
possible meanwhile to refer to the actual `enum` value by symbol instead
of being required to do the conversion from `ord`, even when the `enum`
is defined in a `block`.
2023-06-10 14:45:00 +02:00
Jake Leahy
d3af0882cf BackwardsIndex overload for CacheSeq.[] (#22043)
* Add `BackwardsIndex` support for `CacheSeq`

* Add changelog entry

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-06-10 14:43:32 +02:00
Juan Carlos
b2d7761975 Remove Deprecated Nimfix (#22062)
* Remove Deprecated Nimfix
* Trailing whitespace cleanups
2023-06-10 07:09:03 +02:00
Qinsi (James) ZHU
744a99d75c add const RLIMIT_STACK (#21772)
* add const RLIMIT_STACK

* generate by detect.nim

* add generated const for linux-amd64
2023-06-09 16:03:28 +02:00
litlighilit
1d6fd30afb Update browsers.nim, fix openDefaultBrowser()'s bug (#22052)
modified to fix blank page fault. see openDefaultBrowser()

The previous implement use "http:about:blank" which will be processed by "prepare" and be considered as a file path, turning to "file://...", which is no doubt beyond expectation.
To fix it,firstly the "about:blank" is used instead. Next, a new "openDefaultBrowserImplPrep" proc is added, take place of the previous version of "openDefaultBrowserImpl"
2023-06-09 15:54:33 +02:00
ringabout
64b27edd3a make move use =wasMoved internally (#22032)
* make `move` use `=wasMoved` internally

* fixes tests

* fixes spawn finally

* fixes views

* rename to internalMove

* add a test case
2023-06-09 15:53:12 +02:00
Antonis Geralis
a3bbb71240 Remove debug echo from with (#22047) 2023-06-08 22:52:24 +08:00
awr1
6514eaa8e0 Nested with blocks (#22042)
* Implemented with-nesting in underscoredCalls()

* Add tests for nested with
2023-06-08 08:02:57 +02:00
ringabout
7ee00d86b1 fixes overriden typo (#22044) 2023-06-08 08:02:11 +02:00
ringabout
0f3d6b5a52 small fixes for atomicArc (#22017)
* small fixes for atomicArc

* Update lib/system/arc.nim
2023-06-06 21:22:07 +02:00
metagn
2ab948ce53 post expr blocks colon fix + correct grammar (#21983)
* post expr blocks colon fix + correct grammar

fixes #21982

* fix dochelpers

* this is remarkably common

* use head for unchained

* fix atlas

* final grammar fix
2023-06-06 06:53:21 +02:00
ringabout
1133f20fe2 lift the =dup hook (#21903)
* fixes tests again
* remove helper functions
* fixes closures, owned refs
* final cleanup
2023-06-02 16:03:32 +02:00
ringabout
b3e1892eb7 fixes #21977; add sideEffects to dirExists, fileExists and symlinkExists (#21978) 2023-06-01 08:03:17 +02:00
Etan Kissling
b880cdff49 handle out of range value for COLUMNS / LINES (#21968)
* handle out of range value for `COLUMNS` / `LINES`

Querying terminal size may fail with a `ValueError` if size is too big.
Return highest possible value instead. Note that `ValueError` is also
reported on underflow (negative size) but that is out of POSIX specs.

* `parseSaturatedNatural`
2023-05-31 19:10:58 +02:00
Juan M Gómez
e43a51fcf3 Implements: [C++] constructor pragma improvement (fix #21921) (#21916)
* implements: [C++] constructor pragma improvement (fix #21921)

t

* fix test so it doesnt use echo in globals

* Update compiler/ccgtypes.nim

* Update lib/std/private/dragonbox.nim

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-05-30 21:47:26 +02:00
metagn
20446b437b make proc not implicitly convert to pointer with a preview define (#21953)
* test `proc` not converting to `pointer`

* ignore define for now to test

* remove cstring

* fixes, changelog
2023-05-30 21:29:38 +02:00
ringabout
40f88da90b alternative to #21914; split, rsplit now forbid an empty separator (#21961) 2023-05-30 13:40:09 +02:00
Andreas Rumpf
244565397d fixes #21734; backport (#21957) 2023-05-29 21:31:53 +02:00
Federico Ceratto
ef060e8184 Suggest files and paths modules (#21950) 2023-05-29 17:51:31 +02:00
ringabout
108410ac34 fixes fieldDefect loses enum type info in ORC; consistent with VM and refc (#21954)
fixes fieldDefect loses enum type info in ORC
2023-05-29 14:59:59 +02:00
Simon Krauter
8c55e2999b Fix documentation typo in endians.nim (#21949) 2023-05-28 19:40:37 +02:00
Juan Carlos
b96c501836 Refactor pragma inline (#21930)
* Add __force_inline support
2023-05-27 20:52:08 +02:00
Juan Carlos
38fdf13982 Clean nimbase (#21927)
* .

* Clean out nimbase.h

* Clean out nimbase.h
2023-05-27 07:44:15 +02:00
Zoom
656706026b JS: Add some to-cstring converters for DateTime (#21912)
Add some to-cstring converters for DateTime

Changelog update
2023-05-26 16:40:53 +02:00
Jake Leahy
a8718d8a9e Fix const in async regression (#21898)
* Add test case for a const being used inside an async proc

* Use `typeof` to get the type of the block instead of overloaded templates

This removes the problem with the symbol having different types

I am unsure why I didn't use this in the first place. IIRC I had problems with `typeof` when I first tried to use it in the original implementation
2023-05-25 07:08:36 +02:00
Juan Carlos
b7925bf5c9 Remove GC (#21904)
* .

* Remove GC v2
2023-05-25 07:06:31 +02:00
Juan Carlos
cb3f6fdc66 Improve times (#21901)
* .

* Improve times
2023-05-24 17:55:48 +02:00
metagn
4d6be458a0 js -r defines nodejs & program result undeclared if unavailable (#21849)
* js -r defines nodejs & program result undefined if unavailable

fixes #16985, fixes #16074

* fix

* add changelog too

* minor word change
2023-05-24 17:55:09 +02:00
Bung
76a98fee65 fix #21251 Compiler SIGSEGV when using SharedTable (#21876)
fix #21251
2023-05-23 09:39:44 +02:00
Carlo Capocasa
9c2d2773ec Weekday parse/format (replacement) (#21857)
* parsing capability for iso week year

* remove outdated test
2023-05-21 20:12:05 +02:00
noah edward hall
4186529ff7 Update threadpool.nim with correct link to typedthreads module (#21865) 2023-05-19 21:23:44 +02:00
Andreas Rumpf
1314ea7516 tasks that support return values (#21859)
tasks.nim: Code cleanups and support expressions that produce a value
2023-05-17 06:02:11 +02:00
ringabout
f22e5067c5 fixes #21847; let parseFloat behave like strtod (#21854) 2023-05-17 00:21:34 +02:00
Andreas Rumpf
f4a9b258c3 isolation spec update; WIP (#21843)
* isolation spec update; WIP

* wip

* docs update, WIP

* progress

* Update doc/manual.md
2023-05-14 16:58:28 +02:00
ringabout
ddce555998 improve wasMoved hooks; allow reset to use the overridden wasMoved hook (#21831)
* improve `wasMoved` hooks

* Because `wasMoved` is lifted
2023-05-12 15:24:14 +02:00
Ecorous
871e4af6ef add getDataDir to std/appdirs.nim (#21754)
* add getDataDir to std/appdirs.nim

* reuse `osappdirs.getDataDir`

* Update lib/std/appdirs.nim

---------

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2023-05-12 20:44:29 +08:00
Matt Wilson
ea39c600ab Add minmax to comparisons (#21820)
* Add `minmax` to sequtils

This adds a `minmax` proc to complement `min` and `max`; it computes
both results in a single pass for efficiency.

* Update lib/pure/collections/sequtils.nim

* Add minmax note to changelog.

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-05-12 14:02:09 +08:00
metagn
9810b8cf7f just set CallNodes = nnkCallKinds, follows up #21829 (#21833)
These sets are now equal
2023-05-11 20:50:01 +02:00
Matt Wilson
802d57c237 Add nnkHiddenCallConv to nnkCallKinds (#21781) (#21829) 2023-05-11 20:14:44 +08:00
ringabout
3b9999b93c adds documentation for =wasMoved and =dup hooks and small fixes (#21827)
* adds documentation for `=wasMoved` and `=dup` hooks and small fixes

* Update doc/destructors.md

* Update doc/destructors.md

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-05-11 19:38:27 +08:00
metagn
02be212dae clean up SOME pending/xxx/issue link comments (#21826)
* clean up SOME pending/xxx/issue link comments

* great
2023-05-11 10:23:52 +02:00
ringabout
055a00a6ef make reset use the =destroy and wasMoved pair (#21821)
* make reset use the `=destroy` and `waMoved` pair

* fixes a space

* fixes `shrink` instead

* tiny fix

* fixes vm

* suppress the annotations since it breaks some important packages
2023-05-11 09:02:29 +02:00
Andreas Rumpf
f3a4cc584e make ORC threadlocal, take two (#21818)
* ORC: make rootsThreshold thread local [backport]

* fixes the regression
2023-05-10 12:54:43 +02:00
ringabout
deaf684375 fix #9423 followup #17594: distinct generics now work in VM (#21816)
* fix #9423 distinct generics now work in vm

* fixes cpp tests

---------

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2023-05-10 11:06:14 +02:00
metagn
5592d1ef2c fix nimrtl and nimhcr on arc/orc (#21814)
* fix/workaround for nimrtl and nimhcr on arc/orc

fixes #21803

* try fix clang, debug linux failure

* just make duplicated procs not rtl

* actual fix for duplicated procs
2023-05-09 20:34:39 +02:00
Jordan Gillard
b169dad1e5 Improve and refactor cellseqs_v2 in Nim standard library (#21796)
* Refactor and optimize cellseqs_v2 in Nim standard library

* Extract resizing logic into a separate 'resize' procedure for better readability and separation of concerns
* Implement realloc for non-threaded cases to improve memory operations efficiency
* Use ',' instead of ';' between parameters in 'add' procedure for consistency with other Nim code

* Respond to Araq's feedback: Refactor resize function to use reallocShared

This commit replaces the usage of allocShared and deallocShared with reallocShared to optimize memory allocation and deallocation while resizing the CellSeq.
2023-05-09 20:33:35 +02:00
Andreas Rumpf
ec3bca8fab Windows: use __declspec(thread) TLS implementation, it is MUCH faster… (#21810)
* Windows: use __declspec(thread) TLS implementation, it is MUCH faster than _Thread_local [backport]

* Update lib/nimbase.h

* better fix
2023-05-08 18:52:47 +02:00
ringabout
4533e894ad adds an experimental mm:atomicArc switch (#21798) 2023-05-08 16:25:47 +02:00
Jordan Gillard
71f2e1a502 🚀 Enhancing CellSeq for Better Readability and Maintainability (#21797)
Refactor and improve readability of CellSeq in system directory

* Use half-open range in the contains procedure for better readability and to avoid potential off-by-one errors
* Extract resizing logic from add procedure into a separate resize procedure for better code readability and separation of concerns
2023-05-07 09:25:25 +02:00
ringabout
4a94f3606e revert #21799 and #21802 which don't pass the tests (#21804)
* Revert "ORC: make rootsThreshold thread local [backport] (#21799)"

This reverts commit b74d49c037.

* Revert "fixes #21752 [backport] (#21802)"

This reverts commit d0c62fa169.
2023-05-07 09:22:42 +02:00