Commit Graph

3571 Commits

Author SHA1 Message Date
Andreas Rumpf
2deb1e354f fixes #10702 (#10705)
* --define:nimQuirky exception handling for Nim; in preparation of a blog post
* make it work with latest system.nim
* make code more readable
* fixes #10702
2019-02-18 15:23:05 +01:00
LemonBoy
cf32d61fa5 Prevent crash on pragma templates w/ generics (#10685)
* Prevent crash on pragma templates w/ generics

* Remove incorrect call to pragma reconversion

`semOverloadedCall` may return a node with more elements than the
original nkCall node had (implicit and/or explicit generics).
2019-02-18 12:17:00 +01:00
Federico Ceratto
d8ff25f032 Provide access to getsockname()/getpeername()
Port of #3323 with added tests
2019-02-17 17:04:57 +00:00
Araq
b081eb4d6d fixes #10651 2019-02-14 15:55:38 +01:00
Arne Döring
b6c22eae6a disable talloc2 on 32 bits (#10656) 2019-02-13 08:04:06 +01:00
Arne Döring
6870345cd2 32 bit fixes (#10608) 2019-02-12 22:00:31 +01:00
LemonBoy
5fd9bf9cd5 Propagate tfGcSafe flag to generic instantiations (#10620)
Fixes a nasty endless loop in the generic instantiation phase.
2019-02-10 22:07:50 +01:00
Timothee Cour
4910608394 revive #10228 (fix #9880) (#10610)
* Make index out of bounds more useful by including the 'bounds'.
* fixes #9880 index out of bounds (remaining cases); revives #10228
* change err msg to: `index 3 not in 0 .. 1`
2019-02-10 22:07:11 +01:00
LemonBoy
0c4d1fd10b Do not walk into type sub-nodes for cast/conv expr (#10616) 2019-02-09 19:55:26 +01:00
LemonBoy
1e88bf1def Misc macro things (#10612)
* Misc cleanup in macro code

Generate error messages using `error` instead of `assert`.

Fixes #10574

* Fix crash with hasCustomPragma on quoted fields

Use the `$` operator instead of reaching for the `strVal` field directly
2019-02-09 18:22:07 +01:00
Andreas Rumpf
c6fdf93c7f fixes #6955 2019-02-09 11:18:21 +01:00
Andreas Rumpf
c4ad297544 disable flaky coroutines test 2019-02-09 07:41:19 +01:00
Arne Döring
594c2576e6 Print missing case labels (#10600) 2019-02-09 07:36:30 +01:00
Andreas Rumpf
444f2231c9 make tests green again 2019-02-08 16:54:12 +01:00
LemonBoy
aa6e40abe6 Fix wrong result in tuple assignment (#9340)
Fixes #9177
2019-02-08 12:24:03 +01:00
Araq
4ed7507cb2 error messages can have spaces, don't be dyslexic 2019-02-08 12:18:42 +01:00
LemonBoy
710cfcecd3 Rework exception handling in the VM (#10544)
* Rework exception handling in the VM

Make the safepoint handling more precise and less forgiving.
The new code is clearer and more commented.
Perform cleanup on `return`.
The no-exception-thrown case in a try block should be slightly faster
since we don't parse the whole set of exceptions every time.
More tests.

* Fix silly error that broke a few tests

* Testament doesn't like files having the same name

* Remove test case that failed compilation to js
2019-02-08 11:57:47 +01:00
LemonBoy
631a8ab57f Fix edge case in type hashing (#10601) [backport]
Empty types introduced by a template produced the same hash of the
"clean" type sharing the same name.
2019-02-08 09:56:32 +01:00
LemonBoy
6b88ce3384 Stop useless suggestion of unsafeAddr (#10598)
Fixes #10594
2019-02-08 08:59:38 +01:00
LemonBoy
f23b0a7dc8 Fix handling of reraise in effect tracking (#10582)
This is the MVP in order not to get a completely useless error message
from the compiler.

Fixes #10579
2019-02-07 17:07:03 +01:00
Timothee Cour
b8f4ff8b9f followup on #10573: prevent common user config to interfere with testament (excessiveStackTrace) (#10590) 2019-02-07 12:29:31 +01:00
Timothee Cour
6f412fc6cb fix #10591 regression (#10592) 2019-02-06 22:31:36 -06:00
LemonBoy
294b2e03b2 Reject assignments with nkEmpty RHS (#9000)
Fixes #8997
2019-02-06 21:26:55 +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
Oscar Nihlgård
bfb2ad5078 New implementation of times.between (#10523)
* Refactor ttimes

* New implementation of times.between

* Deprecate times.toTimeInterval
2019-02-06 20:13:29 +01:00
LemonBoy
6c8dee4180 Avoid evaluating macros twice in type sections (#10550)
Fixes #10548
2019-02-06 11:35:44 +01:00
LemonBoy
26255c72fd Fix getCustomPragmaVal on var fields 2019-02-06 11:34:55 +01:00
Timothee Cour
cf8366a569 prevent common user config to interfere with testament (#10573) 2019-02-06 09:41:05 +01:00
Arne Döring
824f39b32e Vm bitops fixes (#10520) 2019-02-05 09:31:37 +01:00
Oscar Nihlgård
0091f2ad3b Implement {.booldefine.} (#10533) 2019-02-03 09:06:00 +01:00
Arne Döring
b80dbdb77d Fix vm signed xor (#10519)
* fix #10482

* undo changes

* fix for bitwise not

* remove dead opcode
2019-02-01 12:12:10 +01:00
cooldome
1d5437e9d2 vm fix for bitwise signed ints (#10507)
* fixes #10482

* add missing file

* bug fix
2019-01-31 19:48:39 +01:00
Timothee Cour
ec6e5681da fix #8063 by adding a testcase for: Deprecation warnings for enum values print twice (#10508) 2019-01-31 11:44:11 +01:00
Miran
fa058773db fixes #10042 (allow spaces in import) (#10504)
This allows spaces in imports, by using the following syntax:
* `import "directory with spaces" / subdir / file`, or
* `import "directory with spaces/subdir/file"`
2019-01-31 08:20:00 +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
cooldome
690f21043d isLastRead regression fix (#10463)
* fixes #10462

* add a test
2019-01-28 08:32:14 +01:00
LemonBoy
3ce6b2acb9 Fix exception tracking in try blocks (#10455)
Exceptions raised inside a nkFinally/nkExcept block are not caught by
the block itself.

Fixes #3886
2019-01-27 10:32:44 +01:00
Timothee Cour
4d230db5ab closes #8610 ; adds test case (#10454) 2019-01-25 19:28:03 +01:00
Miran
268197add8 properly deprecate parseopt2 (#10452) 2019-01-25 13:13:55 +01:00
narimiran
f0be575ed1 move tests from tospaths to tos, fixes #9671
Also, change some of `echo`s to `doAssert`.
2019-01-23 22:04:00 +01:00
Vindaar
d9ee377517 fix #10339 by returning type attached to nkEmpty (#10370)
* fix #10339 by checking for nkObjConstr

* revert check for nkObjConstr, return type from nkEmpty node

The correct type needed in `semObjConstr` to fix #10339 is indeed
available, but attached to an `nkEmpty` node. These were previously
discarded in `semTypeNode`, which is used to extract the type for the
object.

* simplify return of PType from  `nkEmpty`

* also fixes #9866, add test case
2019-01-23 11:17:32 +01:00
LemonBoy
9c0e5c4c07 Harmonize the var/let and const handling (#10410)
Fixes #10333
2019-01-23 11:10:51 +01:00
narimiran
f1a841c605 remove tdont_be_stupid, fixes #10386 2019-01-23 09:19:42 +01:00
Ico Doornekamp
0d480bfe22 Added basic bit manipulation procs to bitops (#10338) 2019-01-23 09:16:14 +01:00
Vindaar
36e34d9aed close #3899 by adding test case (#10424) 2019-01-23 08:44:19 +01:00
LemonBoy
eee9729f53 Fix semantic analysis with noReturn proc in tail pos (#10422)
Fixes #10417
2019-01-23 07:30:49 +01:00
Ray Imber
94f6a6b294 Fix for issue #10342. better message for generic subclass instantiation (#10354)
* Fix for issue #10342. better message for generic subclass instantiation errors.
2019-01-22 17:05:26 -08:00
Miran
0ebfcd4c0f Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
LemonBoy
6825430831 Restrict ptr/ref to ptr/ref implicit conversion (#10411)
* Restrict ptr/ref to ptr/ref implicit conversion

Fixes #10409

* Make the ptr conversions explicit in db_odbc
2019-01-22 11:17:20 +01:00