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
flywind
916d0c21af
fix #18620 ( #18624 )
...
* fix #18620
* add testcase
2021-08-01 11:19:43 +02:00
Miran
e616675c41
various small documentation improvements ( #18602 )
2021-07-28 14:31:13 +02:00
Andreas Rumpf
6dc34757b6
fixes #18579 ( #18600 )
2021-07-27 14:32:56 +02:00
Timothee Cour
cc0f02d57d
rename nimFpRoundtrips => nimPreviewFloatRoundtrip ( #18566 )
2021-07-23 14:57:47 -07:00
Andreas Rumpf
01fc9e58ca
fixes #18550 ( #18553 )
...
* fixes #18550
* update the manual to reflect reality
2021-07-21 16:55:50 +02:00
Timothee Cour
cf0cf32d27
make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400 , etc ( #18531 )
...
* compiler/vmhooks: add getVar to allow vmops with var params
* addFloat vmops with var param
* cgen now renders float32 literals in c backend using roundtrip float to string
2021-07-20 22:13:52 +02:00
Araq
e38388eb4e
use .} instead of } for code highlighters
2021-07-20 08:36:02 +02:00
Andreas Rumpf
25efb53862
make dragonbox opt-in via -d:nimFpRoundtrips ( #18504 )
...
* make dragonbox opt-in via -d:nimFpRoundtrips
* make tests green again
* make tests green again
2021-07-16 18:29:49 +02:00
Andreas Rumpf
af3d2d8ad9
added nimAllocPagesViaMalloc switch ( #18490 )
...
* added switch
* alloc.nim needs page aligned memory blocks
2021-07-15 17:58:47 +02:00
Miran
0d74f60742
Revert "Make 'echo' raise IOErrors when appropriate ( #16367 )" ( #18460 )
...
This reverts commit 23d23ecb08 .
2021-07-08 16:09:56 +02:00
Andreas Rumpf
3eb3e6b9a3
ORC: use =destroy instead of =dispose ( #18440 )
...
* ORC refactoring in preparation for further changes (=dispose must die)
* ORC: embrace =destroy, avoid =dispose
* ORC: no need for =dispose
* closes #18421
2021-07-07 09:39:01 +02:00
Andreas Rumpf
1bed777314
fixes #18411 ( #18432 ) [backport:1.4]
2021-07-05 18:04:07 +02:00
Timothee Cour
779b4e307b
don't use {.rtl.} for generics, otherwise -d:useNimRtl gives ambiguous identifier nimrtl error ( #18406 )
2021-07-01 11:14:01 +02:00
Andreas Rumpf
19263f2775
fixes #18400 ( #18402 )
2021-06-30 12:36:24 +02:00
Clyybber
808db3b284
Fix unused warning for $ on empty object ( #18381 )
2021-06-28 22:01:06 +02:00
Clyybber
6e74fecb42
Simplify addInt, remove digits10 ( #18356 )
...
* Simplify addInt, remove digits10
Co-authored-by: Charles Blake <charlechaud@gmail.com >
* Fix bootstrapping
* Add noInit to tmp array
* noInit -> noinit
Co-authored-by: Charles Blake <charlechaud@gmail.com >
2021-06-28 15:00:14 +02:00
Timothee Cour
b8f761b7e2
even lighter version of #17938 : fix most issues with UnusedImport, XDeclaredButNotUsed, etc; fix #17511 , #17510 , #14246 (without realModule) ( #18362 )
...
* {.used: symbol}
* add tests
* fix tests with --import
* --import works without giving spurious unused warnings
* new warning warnDuplicateModuleImport for `import foo; import foo`
* fix test, add resolveModuleAlias, use proper line info for module aliases
* fix spurious warnings
* fix deprecation msg for deprecated modules even with `import foo as bar`
* disable a test for i386 pending sorting XDeclaredButNotUsed errors
* UnusedImport now works with re-exported symbols
* fix typo [skip ci]
* ic support
* add genPNode to allow writing PNode-based compiler code similarly to `genAst`
* fix DuplicateModuleImport warning
* adjust test
* fixup
* fixup
* fixup
* fix after rebase
* fix for IC
* keep the proc inline, move the const out
* [skip ci] fix changelog
* experiment: remove calls to resolveModuleAlias
* followup
* fixup
* fix tests/modules/tselfimport.nim
* workaround tests/deprecated/tmodule1.nim
* fix properly
* simplify
2021-06-26 15:21:46 +02:00
Timothee Cour
5badeea170
followup #18318 : simplify dollarImpl and add a test ( #18330 )
2021-06-22 21:42:39 -07:00
flywind
9a81e91fa5
merge similar procs regarding digits ( #18318 )
2021-06-22 17:02:32 +02:00
xioren
9d3a813fb9
convert code-blocks to runnableExamples in io ( #18315 )
...
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com >
2021-06-21 18:56:16 -07:00
Timothee Cour
6030e139b5
move {.injectStmt.} to experimental; add a test ( #18300 )
...
* move {.injectStmt.} to experimental; add a test
* undocument and deprecat `.injectStmt` but keep its implementation until we have a replacement
2021-06-20 09:51:07 +02:00
Andreas Rumpf
fd8b79707c
Revert "system/excpt: check if the exception is not nil before pop ( #18247 )" ( #18265 )
...
This reverts commit 0adb47aa15 .
2021-06-17 08:20:10 +02:00
alaviss
0adb47aa15
system/excpt: check if the exception is not nil before pop ( #18247 )
...
In CPS we would consume an exception in the except branch by stashing it
into a local then remove the exception from Nim environment so as not to
leak it to other code that would be running before the continuation
continues
However since popCurrentException() assumes that the exception always
exist, removing the exception from an except branch will cause a
SIGSEGV to happen. This commit fixes that.
2021-06-14 18:26:12 +02:00
Timothee Cour
c871e22da2
fix #7717 roundtrip float to string; fix parseFloat for js ( #18248 )
...
* refs #7717 roundtrip float to string
* make parseFloat more correct
* improve float tests
* improve float tests
* cleanup
2021-06-13 07:32:47 +02:00
Miran
57609902c4
use more meaningful name than "workaround14447" ( #18237 )
2021-06-11 10:07:23 +02:00
slangmgh
e7aa41ff3f
fix 18186 with adding importc _umul128 ( #18200 )
2021-06-07 11:42:32 +02:00
Andreas Rumpf
daaa40973c
added float32 schubfach algorithm; wip ( #18155 )
...
* added float32 schubfach algorithm; wip
* fixes #18418
2021-06-03 12:09:40 +02:00
Timothee Cour
0de3d4292f
fix #16993 , #18054 , #17835 runnableExamples now works with templates and nested templates ( #18082 )
2021-06-02 09:02:14 -07:00
Andreas Rumpf
63db2b19bf
use dragonbox algorithm; alternative to #18008 ( #18139 )
...
* use dragonbox algorithm; alternative to #18008
* removed unsafe code
2021-06-01 22:29:53 +02:00
flywind
c2e3dc0ed1
close #18129 Add setCurrentException for JS backend ( #18145 )
...
* [std/re] make interface consistent
* tiny
* revert
* close #18129 add setCurrentException
* changelog entry
2021-06-01 18:16:25 +02:00
Ștefan Talpalaru
a1c82c39af
asyncdispatch+stackTraceOverride: fix premature collection ( #18039 ) [backport:1.2]
...
Copying StackTraceEntry instances when nimStackTraceOverride is defined
breaks the link between a cstring field that's supposed to point at
another string field in the same object.
Sometimes, the original object is garbage collected, that memory region
reused for storing other strings, so when the StackTraceEntry copy tries
to use its cstring pointer to construct a traceback message, it accesses
unrelated strings.
This only happens for async tracebacks and this patch prevents that by
making sure we only use the string fields when nimStackTraceOverride is
defined.
Async tracebacks also beautified slightly by getting rid of an extra line
that was supposed to be commented out, along with the corresponding debugging output.
There's also a micro-optimisation to avoid concatenating two strings just
to get their combined length.
2021-05-19 19:19:11 +02:00
Andreas Rumpf
53935b8b27
ARC: fixes memory leaks with newSeq used in a loop [backport:1.4] ( #18040 )
...
* ARC: fixes memory leaks with newSeq used in a loop [backport:1.4]
* Update tests/arc/tnewseq_legacy.nim
2021-05-18 21:45:37 +02:00
Andreas Rumpf
4857c462d5
Revert "fix #14873 properly by skipping abi field in importc type ( #17944 )" ( #17992 )
...
This reverts commit 98c29c01eb .
2021-05-15 06:50:39 +02:00
Andreas Rumpf
3bc625aff1
ORC: progress ( #18000 )
...
* ORC: progress
* ORC: bugfix; don't follow acyclic data even if only at runtime the subtype is marked as acyclic
* progress
* minor style changes
2021-05-12 22:00:37 +02:00
Timothee Cour
38b41f893a
fix #17941 : UnusedImport works for var/let/const/type invoked inside a generic ( #17942 )
...
* fix #17941 : UnusedImport works for var/let/const/type invoked inside a generic
* fixup
2021-05-08 09:56:46 +02:00
Timothee Cour
98c29c01eb
fix #14873 properly by skipping abi field in importc type ( #17944 )
...
* fix #14873 properly by skipping `abi` field in importc type
* add test
* fix test for windows
2021-05-07 19:36:41 +02:00
Timothee Cour
0b4b9b3ad0
remove unsused OsPlatform.nimVM ( #17953 )
2021-05-07 06:55:46 +02:00
Danil Yarantsev
9b126de65c
Fix C++ compilation error in excpt.nim ( #17951 )
2021-05-06 22:33:57 +02:00
Andreas Rumpf
98cd1671a3
minor cleanups ( #17948 )
2021-05-06 13:27:40 +02:00
Andreas Rumpf
fb86271556
system.nim cleanup some exported constants which should never have be… ( #17909 )
...
* system.nim cleanup some exported constants which should never have been exported
2021-05-01 11:10:40 +02:00
flywind
22e06ee95a
Ref #17831(synchapi.h: No such file or directory) ( #17832 )
...
* Ref #17831 use windows.h
* use header: "windows.h"
* Update syslocks.nim
* Update lib/system/syslocks.nim
2021-04-25 10:34:53 +02:00
flywind
53c898de41
fix #17812 (repr fails to compile with ARC/ORC) ( #17816 )
2021-04-22 08:08:56 +02:00
Clyybber
6de5aa1971
Rename = to =copy in stdlib ( #17781 )
2021-04-19 13:16:10 +02:00
flywind
dc89b21257
[std/locks]close #7998(complete condition variables) ( #17711 )
...
* close #7998
* workaround genode
* Update lib/system/syslocks.nim
2021-04-19 10:51:13 +02:00
Timothee Cour
42c6eec4ef
fix #17749 ignore SIGPIPE signals, fix nim CI #17748 ( #17752 )
...
* fix #17749 SIGPIPE
* fix for windows
2021-04-18 15:34:29 +02:00
Timothee Cour
7e94420847
cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString ( #17744 )
2021-04-17 11:14:09 +02:00
flywind
12783dbcf0
make the copy operation of Thread an error ( #17734 )
2021-04-16 08:50:44 +02:00