summary refs log tree commit diff stats
path: root/tests/macros
Commit message (Collapse)AuthorAgeFilesLines
* Quote do now works with result in block (#7343)PMunch2018-10-311-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* getTypeImpl now returns pragmas for object types (#9538)jcosborn2018-10-301-0/+18
|
* More descriptive names of test files (#9531)Miran2018-10-292-0/+0
| | | | | * change generic `tissues` name to more specific * change `tvarious` to more specific names
* Change the order of compilation passes, transformation is made lazy at code ↵cooldome2018-10-181-1/+1
| | | | | | | | | | | | | | | 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
* added test case for `or` operatorArne Döring2018-10-181-0/+14
|
* merge macros tests (#9367)Miran2018-10-1417-373/+352
|
* compiler: show name of instantiating context in error traces (#6763) (#9207)xzfc2018-10-111-1/+1
|
* Unchecked arrays now have their own type (#9267)LemonBoy2018-10-101-0/+4
|
* Fix macro expansion in expandMacros (#8998)LemonBoy2018-10-091-0/+19
| | | | | | | | | | * Fix macro expansion in expandMacros Running a semanticized node trough the semantic pass was a bad idea. Fixes #7723 * Simpler smaller implementation
* Fix overload resolution for pragmas evaluation (#8902)LemonBoy2018-10-091-1/+1
| | | | Fixes #6448 Fixes #4384
* Fix range type construction in the VM (#9205)LemonBoy2018-10-091-0/+20
| | | | | | The `range[X,Y]` representation is wrong, we use `range[X .. Y]` instead. Fixes #9194
* add tcollect test for the new for-loops as expressions featureAndreas Rumpf2018-09-111-0/+63
|
* Renderer bug fixes (#8804)cooldome2018-09-071-1/+46
| | | | | | 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
* Add sym owner to macros (#8253)cooldome2018-09-031-1/+30
|
* Do not materialize empty varargs[untyped] arrays (#8715)LemonBoy2018-08-311-0/+21
| | | | | | | | | 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
* Allow `hint` and `warning` to specify its loc info (#8771)LemonBoy2018-08-281-0/+24
| | | Let's bring those to feature-parity with `error`.
* fixes 8754 (#8755)cooldome2018-08-241-5/+14
| | | | | | * fixes 8754 * improve test
* put the new for loop macros under an experimental switch named 'forLoopMacros'Andreas Rumpf2018-08-151-1/+1
|
* fixes #5617, 'copyLineInfo' addition (#8523)andri lim2018-08-051-0/+14
|
* fixes #7827, bindSym enhancement (#8499)andri lim2018-08-021-0/+42
| | | | | | | | | | | | | | | | * 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
* Render bug: if expression with statement list expression as condition (#8375)cooldome2018-07-211-0/+16
| | | | * Fixes #8348
* Fixes #8343, Fixes #8344 (#8347)cooldome2018-07-181-1/+16
|
* make typesafeprintf test greenAndreas Rumpf2018-07-171-3/+4
|
* Fixes #8287 (#8288)cooldome2018-07-121-0/+20
|
* system.nim: remove deprecated symbolsAndreas Rumpf2018-06-281-16/+0
|
* Return an error symbol as macro output if needed (#8116)LemonBoy2018-06-271-0/+8
| | | | | | Return an error symbol if the macro output has no type and a typedesc is expected. Fixes #7454
* fix #5930Arne Döring2018-06-131-2/+2
|
* make tests green againAndreas Rumpf2018-06-111-3/+3
|
* A motivating example for the new `bindSym` behavior.Zahary Karadjov2018-05-071-0/+154
| | | | | | | | The example is a proof-of-concept logging library, allowing you to define lexically-scoped environments where certain logging attributes are applied automatically to all logging statements. fixes tmacro1 (use of `bindSym` inside static blocks)
* Better support for treating templates and macros as symbols.Zahary Karadjov2018-05-071-0/+173
| | | | | | | | | | | | | | | | | | | This allows you to pass a template or a macro to another macro which can then inspect the implementation of the former template/macro using `getImpl`. Since templates can be freely redefined, this allows you to treat their symbols as compile-time variables that have lexical scope. A motivating PoC example for a logging library taking advantage of this will be provided in the next commit. Implementation details: * The name of a template or a macro will be consider a symbol if the template/macro requires parameters * For parameterless templates/macros, you can use `bindSym`, which was extended to also work outside of compile-time procs.
* eqIdent new returns false on non identifier types (#7629)Arne Döring2018-04-171-0/+17
|
* move eqIdent to vm.nim (#7585)Arne Döring2018-04-151-0/+42
| | | | | | * Strutils comment changes. * fix typo
* implements first version of for-loop macrosAndreas Rumpf2018-04-151-0/+44
|
* Get symbol kind (#7491)Arne Döring2018-04-111-0/+2
|
* Add CommentStmt to astGenRepr (#7313)PMunch2018-03-161-4/+24
| | | | | | * Added codeRepr and dumpCode to the macros module. This allows those writing macros to write examples, get the code to generate the AST for that example, and then modify that code to be dynamic with the macro function.
* fixes #7093Andreas Rumpf2018-01-181-0/+19
|
* modify getTypeImpl to reduce result to final implementation (#6891)jcosborn2017-12-091-2/+12
| | | | | * added test case for getTypeImpl * modify getTypeImpl to reduce result to final implementation
* fix getTypeInst for tyGenericInst (#6868)jcosborn2017-12-041-6/+26
|
* make tests green againAraq2017-11-231-12/+0
|
* make tests green againAndreas Rumpf2017-10-011-2/+2
|
* the parser finally parses 'echo {1,2}' as it shouldAndreas Rumpf2017-09-301-1/+1
|
* Fix #6295 (#6296)BigEpsilon2017-08-301-0/+13
|
* Fixed NimTypeKind enum, added missing values. (#6157)Yuriy Glukhov2017-07-301-0/+7
|
* Added codeRepr and dumpCode to the macros module. (#5778)PMunch2017-07-261-0/+25
|
* Remove expr/stmt (#5857)Arne Döring2017-07-2532-68/+56
|
* newLit emty seq fix (#6091)Arne Döring2017-07-131-0/+9
| | | | * the type of the empty seq is still the correct type * updated test
* fixes anon procs created by macrosAndreas Rumpf2017-07-111-1/+32
|
* improved comment satement support in macros (#5904)Arne Döring2017-06-021-19/+19
|
* more and improved newLit procs in macros moduleArne Döring2017-05-231-0/+140
|
* Merge branch 'zahary' into araq2Andreas Rumpf2017-05-161-3/+2
|\