Commit Graph

1105 Commits

Author SHA1 Message Date
Timothee Cour
6ce3949c8a add isNamedTuple; make $(1, 2) be (1, 2) instead of (Field0: 1, Field1: 2) which leaked implementation detail (#10070)
* add `isNamedTuple`; make $(1, 2) be (1, 2) instead of leaking implementation detail (Field0: 1, Field1: 2)
  fixes this: #8670 (comment) /cc @alehander42 @Vindaar @mratsim

* Note: isNamedTuple is useful in other places, eg #10010 (comment)

* move isNamedTuple to helpers.nim to avoid exposing new symbol to system.nim

* remove workaround in tests/vm/tissues.nim failing test now that #10218 was makes it work
2019-01-08 18:37:25 -08:00
alaviss
20402579a2 system/strmantle: avoid leaking docs to system.nim [ci skip] (#10233)
thanks @timotheecour for spotting this
2019-01-08 08:42:10 +01:00
alaviss
be0a4d1342 fix system.nim documentations (#10168)
* system: fix nimGC_getStackBottom doc
* system/helpers: avoid leaking docs to system
2019-01-04 15:13:07 +01:00
rec
ba7d33b4e4 Guard against null exception (#10162) 2019-01-04 15:05:03 +01:00
Timothee Cour
eba8ffcf70 checkErr now shows actual system error msg instead of unknown error (#9987) 2018-12-27 22:46:53 +01:00
Andreas Rumpf
cd65e5328d GC: avoid pathological behaviour; fixes #10040 [backport] (#10052) 2018-12-20 08:20:32 +01:00
Neelesh Chandola
48437d0a84 Give better error message when profiler and memProfiler used at same time (#9948)
* Give better error message when profiler and memProfiler used at same time

* Move to profiler.nim
2018-12-19 10:02:20 +01:00
Andreas Rumpf
d7d17d5ab0 see what breaks with a global config.nims (#10016)
* see what breaks with a global config.nims

* make tests green with a global config.nims file
2018-12-18 09:29:15 +01:00
Timothee Cour
c4e3c4ca2d add getCurrentCompilerExe to vmops (eg allows to get nim compiler at CT); add tests for vmops (#9925) 2018-12-18 09:07:12 +01:00
Araq
09b9a54418 make tests green with a global config.nims file 2018-12-17 23:03:54 +01:00
Araq
d91d1865b8 fixes #9420 2018-12-16 20:11:04 +01:00
Araq
359a4b5fac timers.nim: avoid parser warning 2018-12-14 09:56:43 +01:00
Andreas Rumpf
5dc83d0c8f cleanup of excpt.nim 2018-12-11 23:04:49 +01:00
Andreas Rumpf
e3d91a5b74 Merge pull request #9923 from stefantalpalaru/calldepth
replace misleading "stack overflow" message when reaching Nim's call depth limit
2018-12-11 22:07:44 +01:00
Ștefan Talpalaru
497e8c41e8 replace misleading "stack overflow" message on call depth limit
The new error message looks like this:
"Error: call depth limit reached in a debug build (2000 function calls).
You can change it with -d:nimCallDepthLimit=<int> or switch to a release
build with -d:release."
2018-12-10 19:35:37 +01:00
Timothee Cour
f3ecc15a94 refs #9880 show index and bound in lots of index out of bounds errors 2018-12-09 16:50:45 -08:00
rec
e3e5ae287f Fix fat pointers, object copying, magic double evals on JS (#9411) [backport]
* Add a test for issue #9389

* Fixes #9389.

* Make object contructors copy objects properly by checking whether the expressions passed to them don't need to be copied.
* Make mArrToSeq implementation actually check if a copy needs to be made.

* Avoid unnecessary copy in mChr impl

* Assume set constructor elements need no copy

* Add a test for issue #9410

* Add a test

* fix passing fat pointers (#9410)

* Enhance tests

* More tests and fixes

* Add more (failing) tests [ci skip]

* Added equality operator for fat pointers, more tests and fixes

* Fix printing uninitialized strings

* Fix mInc, mDec double eval, add more tests

* Tests

* Refactored, fixed multiple evals, revamped the tests, added missing ops

* Fix ups

* Fix #9643 and #9644

* add pointer normalization
2018-12-04 12:04:27 +01:00
Jacek Sieka
87568830ab Remove dead code (#9777)
* gc/gc2: remove unused ref counting stuff
* also removes some false threading support - hasSharedHeap is always
false in gc/gc2
* gc: remove some threading cruft
* remove asgnRefNoCycle
* compiler: remove TLoc.dup (unused)
2018-11-26 09:47:39 +01:00
alaviss
c7eba64dee don't raise exception in the default handler (#9783)
fixes #9657
2018-11-22 14:46:07 +01:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Araq
dd3e1cbc9b make testament compile again with -d:nimCoroutines 2018-11-15 15:15:20 +01:00
Andreas Rumpf
632ec94b5d gc_common: fixes a typo 2018-11-15 11:36:35 +01:00
Andreas Rumpf
8d850f7a69 deprecated ospaths (#9665) 2018-11-09 16:36:49 +01:00
Araq
5c25b93898 change system.nim to adhere to the style guide 2018-10-30 15:03:28 +01:00
cooldome
dfb8730f51 Implements #9434. Minimal Stacktrace for Exceptions in release mode (#9480)
* Fixes #9434
2018-10-28 13:40:42 +01:00
recloser
2b03bed2db Fix printing and comparing uninitialized strings 2018-10-21 21:18:10 +02:00
Vindaar
e190f485ae fixes #9456 by only calling c_fclose if non nil 2018-10-20 20:35:04 +02:00
Timothee Cour
7d8e281239 [nimscript] document currentSourcePath in thisDir (#9402) 2018-10-18 12:18:40 +02:00
Yuriy Glukhov
dc72cf7564 No setjump in GC for emscripten/wasm (#9386) 2018-10-17 00:46:13 +02:00
LemonBoy
72cd3b7914 Fix repr() for UncheckedArray (#9385) 2018-10-16 14:27:42 +02:00
LemonBoy
71636059e9 Avoid memory allocation during dynlib loading (#9320)
By using `write` instead of `rawWrite` we'd end up asking the compiler
to generate the GC dynlib _while_ we were already generating another
dynlib!

Fixes #9123
2018-10-12 08:56:14 +02:00
Ștefan Talpalaru
10f5f67767 gogc: GCC-8.2.0 compatibility and other improvements (#9211)
- Go's write barriers are now plugged-in in all the relevant points
- "gcGo" is correctly classified by usesWriteBarrier()
- some gogc structures and functions now use golib wrappers to keep GCC
  version-specific conditions out of the compiler/stdlib code
- we no longer allow mixing the C malloc with Go's
- fix a problem with string copying
2018-10-11 22:15:17 +02:00
Solitude
027a11d7c8 Add procs to retrieve project name, directory and full path to nimscript (#9274) 2018-10-11 09:56:12 +02:00
LemonBoy
334032294f Fix linking issue in cpp codegen
Declare the root symbol only once and have the other modules depending
on it emit an `extern` declaration.

Fixes #9013
2018-09-19 12:46:50 +02:00
skilchen
e317745098 don't reuse code from 0.18.0 2018-09-15 14:05:42 +02:00
skilchen
9fa477de75 more efficient fix for #8961 2018-09-15 01:04:23 +02:00
Andreas Rumpf
0c04b80651 Merge pull request #8966 from LemonBoy/fix-8964
Fix hashing for codegenProc (sic) types
2018-09-14 22:28:12 +02:00
Araq
5709736e82 Merge branch 'devel' into araq-better-docgen 2018-09-14 15:48:07 +02:00
LemonBoy
839953c3e1 Fix hashing for codegenProc (sic) types
Since the name mangling is inhibited we should take the user-supplied
name during the sighash computation.

Fixes #8964
2018-09-14 15:37:51 +02:00
Araq
4ab9953787 fixes #8961 2018-09-14 11:40:43 +02:00
LemonBoy
e7d4043406 Always emit hti object types if needed (#8940)
The compiler is now smart enough to emit types only if needed without
all the importc tricks. This also fixes a codegen bug where, if all the
stars align correctly, typeinfo doesn't include any definition of
`TNimType` but uses it.

Found by @skilchen in #8938
2018-09-11 17:03:21 +02:00
LemonBoy
9ba80d2044 JS strings have no trailing zero anymore (#8936) 2018-09-11 11:45:02 +02:00
alaviss
198e34ec1d system/excpt: nil is no longer vaild for seqs (#8825) 2018-08-31 11:24:01 +02:00
Dominik Picheta
9ad17091cc Allow Nimble to override the `task` template in nimscript. (#8798) 2018-08-28 23:05:46 +02:00
Timothee Cour
3a626179ee doAssert, assert now print full path of failing line on error (#8555) 2018-08-25 21:48:37 +02:00
Timothee Cour
56de4c81b2 fixes #8739; allow --hint:foo:on --warning:bar:off (#8757) 2018-08-25 07:55:05 +02:00
Araq
27f488e5d9 make more tests green; system.repr does not produce 'nil' for strings and seqs anymore 2018-08-22 15:37:57 +02:00
Araq
7896903fd0 make tio test green again 2018-08-22 13:15:19 +02:00
Araq
64517445ea even more strict isNil handling for strings/seqs in order to detect bugs 2018-08-22 12:35:46 +02:00
Andreas Rumpf
696c0c48c7 fixes merge conflict 2018-08-19 15:14:03 +02:00