Commit Graph

133 Commits

Author SHA1 Message Date
cooldome
d8c3df2683 fixes #10805 (#10806) 2019-03-13 10:23:06 +01:00
cooldome
8ceba8a7f3 fixes #10807 (#10814)
* fixes  #10807
* use nkAddr instead of nkHiddenAddr
2019-03-12 13:45:05 +01:00
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
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
LemonBoy
6c8dee4180 Avoid evaluating macros twice in type sections (#10550)
Fixes #10548
2019-02-06 11:35:44 +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
Araq
3c2d82eaae make megatest green 2019-01-13 17:19:36 +01:00
Araq
2ccc9db59d closes #3744 2019-01-13 16:05:42 +01:00
Araq
aa7ad88978 fixes #10075 [backport] 2019-01-13 15:52:50 +01:00
Araq
34815a4697 megatest: make it green on Linux 2018-12-11 21:23:25 +01:00
Araq
3b783f7e13 Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
Arne Döring
a5ecbf823f lots of small changes 2018-12-11 21:23:22 +01:00
Arne Döring
2a4c09ff88 megatest can be executed 2018-12-11 21:23:21 +01:00
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
Araq
af815c3c18 fixes #9864 [backport] 2018-12-05 10:58:18 +01:00
Araq
562d185cb7 cleanup tests; don't use non-working 'msg' spec field 2018-11-23 13:16:45 +01:00
Arne Döring
9c2365d5c2 activated more tests, allow input in test spec 2018-11-23 11:58:28 +01:00
Arne Döring
031bfdec6f make run the default action of a test in tester 2018-11-23 11:58:28 +01:00
cooldome
086676782a Add isInstanceOf for generic procs to the macros module (#9730) 2018-11-21 21:30:03 +01:00
Lolo Iccl
37d88e5168 Add proc [](n: NimNode, s: HSlice[T, U]): seq[NimNode] to macros (#7735)
fixes #7670.
2018-11-10 14:10:50 +01:00
Arne Döring
573d02760e newLit works on enum (#9662)
* newLit works on enum

* remove debugging echo
2018-11-09 12:15:00 +01:00
Arne Döring
77a0f3768b adopt tests 2018-11-08 22:28:29 +01:00
jcosborn
fc740c54ec fixes #9600 (#9601) 2018-11-07 08:40:00 +01:00
PMunch
e9ed4dccb6 Quote do now works with result in block (#7343)
* Fix result not being able to use in quote do

This fixes the annoying issue of not be able to use result inside a
quote do block. It works by a simple trick. The quote do mechanic is
based on dynamically creating a template and immediately calling it with
the arguments found within the quote do block. Since this is called in
the scope of the macro the result variable is shadowed. This trick works
by changing all occurences of result (which shouldn't cause any issues
as result isn't used for anything else for the same reason) to another
name and then passing in an IdentNode with result as a named parameter
with that name.

Note that currently this just replaces it with a fixed named variable
"res" which should be changed to a non-colliding, dynamically created
name.

* Fix hard coded parameter "res" to anonymous symbol

This fixes the hard coded parameter "res" to be an anonymous symbol
instead so it won't collide with other parts of the argument list.

* Add test case for result in quote do block

A simple test case based on GitHub issue #7323 on how you can't put
result in a quote do block. This test verifies that it actually works
correctly now.

* Add test for explicit capturing of result

* Rebased against devel
2018-10-31 22:14:29 +01:00
jcosborn
69c0a9c6fb getTypeImpl now returns pragmas for object types (#9538) 2018-10-30 06:41:12 +01:00
Miran
1b17c9f693 More descriptive names of test files (#9531)
* change generic `tissues` name to more specific
* change `tvarious` to more specific names
2018-10-29 17:07:27 +01: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
Arne Döring
48697dc5bb added test case for or operator 2018-10-18 15:39:22 +02:00
Miran
a30ba8cc37 merge macros tests (#9367) 2018-10-14 17:08:42 +02:00
xzfc
8fc7cecfa2 compiler: show name of instantiating context in error traces (#6763) (#9207) 2018-10-11 09:34:56 +02:00
LemonBoy
0ead36dae6 Unchecked arrays now have their own type (#9267) 2018-10-10 21:03:18 +02:00
LemonBoy
32d5b80938 Fix macro expansion in expandMacros (#8998)
* Fix macro expansion in expandMacros

Running a semanticized node trough the semantic pass was a bad idea.

Fixes #7723

* Simpler smaller implementation
2018-10-09 23:24: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
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
Andreas Rumpf
de02f5fa0a add tcollect test for the new for-loops as expressions feature 2018-09-11 19:14:31 +02:00
cooldome
c033ff990a Renderer bug fixes (#8804)
Fixes #8763: render bug: pure enums not handled correctly
Fixes #8762: render bug: binary operators called with quotes rendered incorrectly
FIxes #8761: render bug: inversion of operator priorities
2018-09-07 01:52:42 +02:00
cooldome
e63c66b810 Add sym owner to macros (#8253) 2018-09-03 13:25:59 +02:00
LemonBoy
b74faf354e Do not materialize empty varargs[untyped] arrays (#8715)
When an empty nkArgList `varargs[untyped]` is passed around it is now
reused for efficiency sake and to prevent the introduction of a spurious
element: before this commit we'd pass the caller a
nkArgList[nkHiddenStdConv[nkBracket]] node instead of just an empty
nkArgList.

Fixes #8706
2018-08-31 12:16:46 +02:00
LemonBoy
5cd152bfda Allow hint and warning to specify its loc info (#8771)
Let's bring those to feature-parity with `error`.
2018-08-28 22:59:28 +02:00
cooldome
d5e1d102df fixes 8754 (#8755)
* fixes 8754

* improve test
2018-08-24 09:57:38 +02:00
Andreas Rumpf
da41fc1801 put the new for loop macros under an experimental switch named 'forLoopMacros' 2018-08-15 17:45:57 +02:00
andri lim
6e3d1dced5 fixes #5617, 'copyLineInfo' addition (#8523) 2018-08-05 23:38:21 +02:00
andri lim
78c0ac5407 fixes #7827, bindSym enhancement (#8499)
* bindSym power up, working prototype

* update bindSym doc

* add bindSym test

* fix some typo

* fix bindSym doc

* get rid of specialops field from vm

* add experimental: dynamicBindSym
2018-08-02 12:56:44 +02:00
cooldome
ec02940185 Render bug: if expression with statement list expression as condition (#8375)
* Fixes #8348
2018-07-21 13:01:47 +02:00
cooldome
a651809411 Fixes #8343, Fixes #8344 (#8347) 2018-07-18 14:54:44 +02:00
Andreas Rumpf
0cbfd67522 make typesafeprintf test green 2018-07-17 20:33:42 +02:00
cooldome
231a83a6b1 Fixes #8287 (#8288) 2018-07-12 11:03:08 +02:00
Andreas Rumpf
c7298561c1 system.nim: remove deprecated symbols 2018-06-28 07:42:46 +02:00
LemonBoy
52fc16d5d2 Return an error symbol as macro output if needed (#8116)
Return an error symbol if the macro output has no type and a typedesc
is expected.

Fixes #7454
2018-06-27 21:43:07 +02:00