Commit Graph

5169 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
Araq
b081eb4d6d fixes #10651 2019-02-14 15:55:38 +01:00
Timothee Cour
9913cef872 fix typo in codeReordering error msg (#10667)
* fix typo in codeReordering

* reorder=>codeReordering
2019-02-14 09:52:15 +01:00
alaviss
3520253a09 compiler/types: correctly generates signature for non-proc types (#10658)
This makes signatures generated for nimsuggest correctly distinguish
template/macro/converter from proc.
2019-02-13 08:07:58 +01:00
Arne Döring
6870345cd2 32 bit fixes (#10608) 2019-02-12 22:00:31 +01:00
Arne Döring
0e5d4f1036 reduce debug output (#10638) 2019-02-12 08:27:38 +01:00
LemonBoy
1d1360496f Fix codegen problem with strict C++ compilers (#10639)
Since tyCString is convertible to a tyPointer we must be extra careful
to emit a cast to (void*) in order to appease clang++.

Reported by masnagam on the Nim forum.
2019-02-12 08:23:24 +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
Andreas Rumpf
f0e6becc23 fixes #10547 2019-02-10 17:03:32 +01:00
LemonBoy
0c4d1fd10b Do not walk into type sub-nodes for cast/conv expr (#10616) 2019-02-09 19:55:26 +01:00
Andreas Rumpf
c6fdf93c7f fixes #6955 2019-02-09 11:18:21 +01:00
Andreas Rumpf
3c909ae8ff fixes #10606 2019-02-09 08:18:33 +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
alaviss
2fdf816332 compiler/[msgs, suggest]: improve highlighter accuracy (#10496)
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.

This commit implements a simple source scanner for the suggest module to
address the problem outlined above.

Fixes nim-lang/nimsuggest#24
2019-02-07 17:08:15 +01:00
LemonBoy
29fbf111a8 Fix codegen when debugger is enabled (#10595)
Decrement the frame length before closing the parent scope.

Fixes #10589
2019-02-07 17:07:35 +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
Araq
84d10f7d8a fixes #10585 2019-02-07 15:04:05 +01:00
Araq
d5da450100 helpers2 now has a real name 2019-02-07 12:12:20 +01:00
Andreas Rumpf
2851f316f6 ignore nkCommentStmt in lambda lifting 2019-02-06 22:00:16 +01:00
Andreas Rumpf
4338f86acb fixes some bug 2019-02-06 22:00:16 +01:00
LemonBoy
294b2e03b2 Reject assignments with nkEmpty RHS (#9000)
Fixes #8997
2019-02-06 21:26:55 +01:00
LemonBoy
864c3e874c Merge pull request #10577 from zielmicha/fix-10568
Fixes #10568: Fix null pointer dereference in address computation for incrSeqV3.
2019-02-06 14:23:24 +01:00
LemonBoy
6c8dee4180 Avoid evaluating macros twice in type sections (#10550)
Fixes #10548
2019-02-06 11:35:44 +01:00
Michał Zieliński
580f62220c Fixes #10568: Fix null pointer dereference in address computation.
According to https://hownot2code.com/2016/08/18/null-pointer-dereferencing-causes-undefined-behavior/ this was an undefined behaviour.
2019-02-06 10:13:44 +01:00
LemonBoy
4c3f841212 Do not raise ProveInit/WanrUninit for .noinit. var (#10566) 2019-02-06 09:14:09 +01:00
Araq
2e880c726b fixes a lexer regression for 'nimble check' 2019-02-05 15:40:03 +01:00
Arne Döring
824f39b32e Vm bitops fixes (#10520) 2019-02-05 09:31:37 +01:00
Araq
9fa116b6e1 compiler: don't use 2 spaces in an error message 2019-02-04 15:59:18 +01:00
Araq
23c11987b4 make the lexer more forgiving so that nim-regex compiles again 2019-02-04 15:59:18 +01:00
Oscar Nihlgård
0091f2ad3b Implement {.booldefine.} (#10533) 2019-02-03 09:06:00 +01:00
Miran
ad4e3fd28c devel docs should point to devel src (#10529)
Currently, devel docs (https://nim-lang.github.io/Nim/lib.html)
source links point to master branch,
leading to outdated source code and showing the wrong line.
2019-02-02 13:23:10 +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
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
Araq
2ce9845fe4 fixes silly typo causing tons of async regressions 2019-01-30 19:48:21 +01:00
Araq
0a628f36f0 destructors: do not produce strong backrefs in closure environments so that refcounting works 2019-01-30 18:17:49 +01:00
LemonBoy
49710b9d14 The file directive is relative to the file it is in 2019-01-30 10:01:59 +01:00
LemonBoy
9031c8fb0f Make sure the test snippet directory exists 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
Neelesh Chandola
2b0ed9995d Fixes https://github.com/nim-lang/Nim/issues/8484 (#10470) [backport] 2019-01-28 09:52:48 +01:00
slangmgh
dfa5faea0f Fixes #10352 (#10416) 2019-01-28 09:34:03 +01:00
alaviss
74a7b09412 suggest: quote operators and keywords on suggestion (#10460) 2019-01-28 09:29:49 +01:00