Commit Graph

871 Commits

Author SHA1 Message Date
Andreas Rumpf
c8e33cbb75 fixed merge conflict 2019-02-18 09:56:01 +01:00
narimiran
1eaa18fe84 allow string insert in nimscript, fixes #10561 2019-02-15 11:09:32 +01:00
Arne Döring
d2b3046c70 deprecated leftovers from era of no unsigned integer types (#10605) 2019-02-14 10:58:09 +01:00
cooldome
d70dd6f3cb Move cpp exception handler from system to excpt next to the signal handler (#9435) 2019-02-13 23:30:14 +01:00
cooldome
55fe7c114e Move cpp exception handler from system to excpt next to the signal handler (#9435) 2019-02-08 21:42:45 +01:00
Andreas Rumpf
ec68d89e42 make it work with latest system.nim 2019-02-08 17:41:34 +01:00
Andreas Rumpf
0841c64a32 Merge branch 'devel' into araq-quirky-exceptions 2019-02-08 17:18:17 +01:00
Andreas Rumpf
0036014727 system refactorings (#10559)
* move IO subsystem into its own module; refs #10385
* make standalone test compile again
* make C++ examples compile again
* make more tests green
* make sysAssert and gcAssert work again
2019-02-06 21:00:00 +01:00
LemonBoy
fa7b757823 Remove unused variable 2019-01-30 10:01:59 +01:00
Andreas Rumpf
dee8e6e98a gc: destructors is beginning to work (#10483)
* kochdocs.nim: code cleanup
* docgen: nicer indentation
* parser.nim: code cleanup
* fixes #10458
* make tests green again
* make =destroy mixins
* gc:destructors: produced C code is almost working
* --gc:destructors simple program compiles (but leaks memory)
* gc:destructors make examples compile in C++ mode
* destructors: string implementation bugfixes
* strs.nim: minor code cleanup
* destructors: builtin seqs are beginning to work
* remove debugging helpers
2019-01-29 15:12:16 +01:00
Araq
07a0a61875 fixes #9149 [backport] 2019-01-29 14:31:43 +01:00
Araq
458c827077 make --define:noSignalHandler compile again 2019-01-22 11:45:45 +01:00
Arne Döring
8399e0f78a deprecate += and friends for bool and enum (#10336)
* fixes #10257
* add version to deprecation
2019-01-18 14:36:38 +01:00
Timothee Cour
42bac52426 [CI] now enables NIM_COMPILE_TO_CPP=true to run without allow_failures (#10315)
* better fix for `nim cpp` bootstrap error: error: no member named raise_id
* [CI] now enables runs NIM_COMPILE_TO_CPP=true without allow_failures
* workaround refs #10343
2019-01-17 08:00:44 +01:00
Vindaar
8e600b78ca add unsetControlCHook to remove a Ctrl-C hook after it was set (#7267)
* add unsetControlCHook to remove a Ctrl-C hook after it was set

Adds the inverse proc to setControlCHook in order to lift a Ctrl-C
hook after it has been set.

* remove check for noSignalHandler in system/excpt.nim
2019-01-10 13:44:44 +01:00
Neelesh Chandola
d998cb58dd void object fields are now ignored by codegen and fields/fieldPairs iterator (#10144)
* Codegen now ignores object fields of type void
* Fix `$` bug for objects/tuples where it does not add a comma
* fields/fieldPairs iterators now ignore void types
* Use `isEmptyType` instead of checking for `tyVoid` directly
2019-01-10 12:49:35 +01:00
Oscar Nihlgård
3ed5f83704 Fix exception tracking for system.open (#10253) 2019-01-10 09:28:09 +01:00
Oscar Nihlgård
87232a38e4 ValueError now inherits from CatchableError (#10246) 2019-01-10 08:49:57 +01:00
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
Timothee Cour
ffea3fbfae * move up runnableExamples definition so can be used more in system.nim (#10196)
* document that toInt, toBiggestInt round towards 0 and add runnableExamples
* minor doc fixes
2019-01-05 16:01: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
Timothee Cour
319b46230c fix bug in doAssertRaises when exception==Exception (#10172)
* fix bug in doAssertRaises when exception==Exception
* add testcase for doAssertRaises
2019-01-04 13:54:02 +01:00
Miran
77166ba795 [backport] correctly document toInt, fixes #2764 [ci skip] (#10176) 2019-01-04 09:25:58 +01:00
Andreas Rumpf
cb9110c43d --define:nimQuirky exception handling for Nim; in preparation of a blog post 2019-01-03 18:56:05 +01:00
Oscar Nihlgård
9fb8c3d965 Add {.noReturn.} to system.raiseAssert (#10161) 2019-01-02 17:39:53 +01:00
cooldome
82c009a2cb Dead code elimination for entire modules and their init procs if empty (#10032)
* fixes #9798
* Change order of write modules
* Move datInit calls ahead of initStackBottom
2018-12-30 11:28:12 +01:00
Timothee Cour
0831292863 revives: Move typetraits.$ to system. Fixes #5827 (#10071)
* Move typetraits.`$` to system. Fixes #5827.
* revive PR; adjust code to make sure everything works and add tests
* fix tests/concepts/tstackconcept.nim
* address comments
2018-12-30 01:09:47 +01:00
Timothee Cour
8aa5d126fe clarify doc for <= on tuple uses lexicographic order (#10069) 2018-12-21 22:52:28 +01:00
Yuriy Glukhov
39a8ab469a Fixed insert for nil seq in js (#10068) 2018-12-21 22:45:20 +01:00
hlaaf
da80992577 Add system.$(HSlice) and fix #7898 (#8670)
* Add system.$(HSlice) and fix #7898

* Surround system.$(HSlice) with spaces
2018-12-21 18:10:07 +01:00
Araq
9526009e0e fixes #9120 2018-12-16 20:34:07 +01:00
Araq
d66eb04ce9 fixes #8991, fixes #4446 2018-12-16 19:22:49 +01:00
Araq
7ec77684e9 fixes #9153 2018-12-16 19:17:09 +01:00
Andreas Rumpf
e3a668a33b --gc:destructors: baby steps 2018-12-15 13:54:41 +01:00
Araq
24106ade8f hotfix: discriminants can be of size 8 bytes [backport] 2018-12-05 09:43:59 +01: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
Timothee Cour
ab38c075f8 add: proc deepCopy*[T](y: T): T (#9740) 2018-11-28 08:46:22 +01:00
Andreas Rumpf
eb919c35b2 fixes #9675 2018-11-26 10:41:26 +01:00
Ștefan Talpalaru
f8fa94cb20 fix segfault when calling shallow() on an empty string (#9782) [backport]
shallow() casts its string argument to a seq and then tries to access
its fields. Guess what happens when that string is nil, which seems to
be the representation of an empty string (both the default value and an
explicitly assigned "").

Segfault encountered when running "ntags -R ." on a large project. The relevant line:
a1c62c38e5/ntags.nim (lines-125)
2018-11-22 14:47:27 +01:00
ishowta
6ff596d4f8 Empty check in shallow [backport] (#9676) 2018-11-21 11:56:38 +01:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Mamy Ratsimbazafy
b65c0c336c Inline generic min and max - https://github.com/nim-lang/Nim/issues/9514 (#9688) 2018-11-14 12:37:46 +01:00
Arne Döring
6a57ec6d2e NaN fixes for clang backend (#9652) 2018-11-08 20:17:37 +01:00
Andreas Rumpf
b4f16fab49 Nim devel is version 0.19.9 2018-11-03 12:45:55 +01:00
Araq
1dd1d66f16 system.nim: workaround for the fixed documentation generator 2018-10-30 21:58:59 +01:00
Araq
05964b95e4 change system.nim to adhere to the style guide 2018-10-30 15:03:28 +01:00
Araq
f6def4286c fixes #8603 2018-10-30 11:28:45 +01:00
narimiran
80b78b50d0 more examples for mod and div, plus corrections [ci skip] 2018-10-28 22:37:58 +00:00
Mamy Ratsimbazafy
5b97762787 Openmp parallel iterator improvements (#9493)
* More flexibility in OpenMP pragma
* Use static to constrain to compile-time annotation string
* Update changelog with OpenMP change
2018-10-25 18:09:35 +02:00
Andreas Rumpf
223e92b83a stdlib: documenation updates, the exception names have been changed 2018-10-25 07:42:45 +02:00