Commit Graph

4751 Commits

Author SHA1 Message Date
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
LemonBoy
f98a3056c6 Fix transformation of yield in inline context (#9135)
When the loop variables are part of the envP block it is not safe to use
a nkFastAsgn.

Fixes #2656
2018-10-09 19:43:31 +02:00
LemonBoy
b97a7dbf3d Make the registered passes local to the ModuleGraph (#9259)
Closes #9068
2018-10-09 19:24:02 +02:00
LemonBoy
8a1055adce Fix range type construction in the VM (#9205)
The `range[X,Y]` representation is wrong, we use `range[X .. Y]`
instead.

Fixes #9194
2018-10-09 15:51:49 +02:00
cooldome
036c52f0b6 fixes #9222 (#9224) 2018-10-09 15:19:21 +02:00
LemonBoy
d36f98fa8b nim doc can run code blocks (#9228) 2018-10-09 14:58:40 +02:00
xzfc
505ae14f4b Codegen fix for procs taking type(nil) (#9231) 2018-10-09 14:51:34 +02:00
LemonBoy
b8d2f79ef0 Prevent the construction of recursive tyStatic types (#9256)
Fixes #9255
2018-10-09 14:26:34 +02:00
Dheepak Krishnamurthy
70018aa683 Add checks for except: body blocks (#9191) 2018-10-09 14:09:22 +02:00
jcosborn
dd65986795 fixes #4435 (#9185) 2018-10-09 13:34:03 +02:00
Araq
82693514c5 attempt to fix the .line pragma 2018-10-03 01:25:47 +02:00
Araq
c92fdb24c8 fixes #5015 2018-10-03 00:00:19 +02:00
Araq
bf85955802 fixes #7092 2018-10-02 23:45:27 +02:00