Commit Graph

4763 Commits

Author SHA1 Message Date
Oscar Nihlgård
16c3d4332f Fix infinite loop with nim check (#9448) 2018-10-22 17:24:14 +02:00
LemonBoy
b613092de8 Don't crash if GC_{un,}ref is called on nil (#9445)
Fixes #9442
2018-10-22 17:09:15 +02:00
cooldome
9c88df220a Compile pragma. Recompile on external file compilation failure (#9455) 2018-10-22 12:49:57 +02:00
LemonBoy
16a70c84aa Fixes 6544 (#9427)
* Fix call to converters with var/lent args

Fixes #6544

* Fix printing of lent types

* lent is only valid for result types
2018-10-19 21:04:32 +02:00
cooldome
b1ff37c08f Transf minor code optimization (#9433) 2018-10-19 20:17:30 +02:00
Araq
cd9bc941e1 incremental compilation: fixes basic caching logic of 'module' table 2018-10-19 16:27:20 +02:00
cooldome
eaca5be9d6 Change the order of compilation passes, transformation is made lazy at code gen (#8489)
* Ast no transformation
* Add getImplNoTransform to the macros module
* progress on delaying transf
* Fix methods tranformation
* Fix lazy lambdalifting
* fix create thread wrapper
* transform for lambda lifting
* improve getImplTransformed
* Fix destructor tests
* try to fix nimprof for linux
2018-10-18 20:21:25 +02:00
Araq
604dfebee0 disallow 'continue' that is not used within a loop; fixes #6367 2018-10-18 17:42:57 +02:00
Araq
68c6d709d3 fixes #5519 2018-10-18 17:06:04 +02:00
Araq
ec4985a573 fixes #7972 2018-10-18 17:00:23 +02:00
Miran
675c629fee replace deprecated safeAdd with add (#9416) 2018-10-18 12:29:32 +02:00
LemonBoy
6ef198e07b Relax the restrictions on the index types (#9412) 2018-10-18 11:08:05 +02:00
Araq
bd9d5787f0 nimpretty: fixes #9384 2018-10-17 13:07:29 +02:00
PMunch
db95fad6fa Fixes #9364 and add moduleDescription to jsondoc (#9396)
This fixes `jsondoc0` so that it has comments in the output as described
by the documentation. It also fixes `jsondoc`/`jsondoc2` as it stored
it's output in a file with an html extension. Along with this it also
adds a new field `moduleDescription` to `jsondoc`/`jsondoc2` which
contains the module description.
2018-10-17 00:34:47 +02:00
Miran
e8cf289bee improve error message, closes #2361 (#9387)
* improve error message

* use single % operation
2018-10-17 00:18:51 +02:00
Oscar Nihlgård
163e9de3c2 Unicode escape in string literals (#9390) 2018-10-17 00:14:22 +02:00
Andreas Rumpf
0d48bafcf0 fixes a regression about indexing into UncheckedArray 2018-10-16 20:09:12 +02:00
Andreas Rumpf
778e4d1775 nimpretty: fixes #9144 2018-10-16 17:21:41 +02:00
Andreas Rumpf
f3c0703b7d nimpretty: add #!nimpretty on/off directives 2018-10-16 16:55:04 +02:00
Andreas Rumpf
ed38079b9b nimpretty: fixes #8626 2018-10-16 16:55:04 +02:00
Andreas Rumpf
89ba0f8592 nimpretty: render r-strings properly, fixes #9236 2018-10-16 13:33:14 +02:00
Araq
bf01d7136e Merge branch 'Fixes-7845' of https://github.com/cooldome/Nim into cooldome-Fixes-7845 2018-10-15 11:50:12 +02:00
Araq
f8e805a614 fixes #2760 2018-10-15 10:43:56 +02:00
Andreas Rumpf
b39302b0d2 DFA: implement exception handling properly 2018-10-14 17:36:55 +02:00
LemonBoy
4808ef72db [WIP] Early evaluation of mIs (#8723)
* Early evaluation of mIs

The `evalIs` implementation was just a broken copy of `isOpImpl` so
let's just avoid it alltogether: `mIs` nodes are either resolved during
the semantic phase or bust.

* Remove dead code and tidy it up
2018-10-14 08:53:41 +02:00
Timothee Cour
eb946f37a7 fixes #8671; show helpful msg (lookup symbol, eg iterator) on 'attempting to call undeclared routine' error (#8786) 2018-10-14 01:16:04 +02:00
Araq
8232bd04f9 sizeof(UncheckedArray) should be invalid; fixed the formating of sizealignoffsetimpl.nim to make it bearable 2018-10-14 00:58:43 +02:00
Timothee Cour
745f1642d6 implement sizeof and alignof operator (manually squashed #5664) (#9356) 2018-10-14 00:52:28 +02:00
LemonBoy
166720bdf9 Make sure the annotation for || is avail. at CT (#9354)
Closes #9353
2018-10-14 00:00:21 +02:00
Andreas Rumpf
33cdae8c32 dfa.nim: clarify exception handling 2018-10-13 08:28:56 +02:00
Andreas Rumpf
fcca59e415 destructors: optimize more assignments into moves; also fixes #9294 2018-10-12 20:36:42 +02:00
Andreas Rumpf
2fecf4f36a compiler: cleanup dfa.nim 2018-10-12 19:56:51 +02:00
Andreas Rumpf
dcc3ac74f4 don't crash when rendering wrong nkInfix nodes 2018-10-12 19:22:39 +02:00
c-blake
1b3725e395 Add toOpenArray[T](ptr UncheckedArray[T]) for clarity. (#9316)
* Add `toOpenArray[T](ptr UncheckedArray[T])` for clarity.  `ptr array[0,T]`
for some unchecked type already works but A) `UncheckedArray` seems to be
the intended future way for this kind of access, and B) essentially all use
cases will have a `ptr` for that kind of array source and this call signature
lets callers drop the trailing `[]` corresponding to that `ptr` deref.
This PR relates to issue https://github.com/nim-lang/Nim/issues/9001 .

* Add a test for toOpenArray() for UncheckedArray[T]s.
2018-10-12 17:40:07 +02:00
LemonBoy
fab4d38411 string to string conversion keeps the dest type (#9323)
Fixes #9322
2018-10-12 08:50:28 +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
Araq
d48e964950 fixes #9281 2018-10-11 19:52:48 +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
cooldome
7a5b614edc fixes #9297 (#9298)
* fixes #9297

* improve spacing
2018-10-11 09:54:50 +02:00
Timothee Cour
a58c982a49 test case for #9180 and re-enables the disabled tcompilerapi test (#9181)
* add findNimStdLibCompileTime and un-disable tcompilerapi test; add test case for #9180

* address comments
2018-10-11 09:44:35 +02:00
xzfc
8fc7cecfa2 compiler: show name of instantiating context in error traces (#6763) (#9207) 2018-10-11 09:34:56 +02:00
LemonBoy
7775b7efd1 Fix wrong heuristic in codegen (#9293)
A bare return may trigger the insertion of a genericReset.

Fixes #9286
2018-10-11 08:36:05 +02:00
LemonBoy
0ead36dae6 Unchecked arrays now have their own type (#9267) 2018-10-10 21:03:18 +02:00
Andreas Rumpf
0803b532f4 fixes #9263 2018-10-10 21:00:54 +02:00
manterolat
16a941a642 Fixes #9154 (#9193) 2018-10-10 13:17:28 +02:00
Timothee Cour
77f836b403 fix #9264 regression (#9265) 2018-10-09 23:48:27 +02:00
Steve Kellock
173e8c4913 fixes unexpected transforming of runnableExamples (#9158) 2018-10-09 20:14:54 +02:00
LemonBoy
33458894da Fix overload resolution for pragmas evaluation (#8902)
Fixes #6448
Fixes #4384
2018-10-09 19:58:23 +02:00
LemonBoy
ee14ace5d3 Field checks for everybody (#8957)
* Field checks for JS backend

* Clean nkCall nodes with no arguments

Generating a nkEmpty in place of no arguments makes no sense form the
AST point of view and also trips up the VM codegen.

* Field checks for VM backend

* Test case for #6612

This patchset fixes #6612

* Add test case for LHS double evaluation

* Prevent LHS double-eval for JS backend

* Prevent double evaluation in VM backend
2018-10-09 19:54:12 +02:00
LemonBoy
a3fb0a769c Try/Catch support for native JS exceptions (#8955)
* Try/Catch support for native JS exceptions

* Better tests
2018-10-09 19:51:29 +02:00