summary refs log tree commit diff stats
path: root/tests/macros
Commit message (Collapse)AuthorAgeFilesLines
* fix #15691 (#21623)metagn2023-04-111-0/+22
| | | `semProcAux` has a check for `checkMinSonsLen(n, bodyPos + 1)`
* macros: Extend treeTraverse intVal range to nnkUInt64Lit (#21597)chmod2222023-04-011-0/+13
| | | | | | | | | * Extend intVal range to nnkUInt64Lit Fixes #21593 * Properly cast intVal as unsigned * Add testcase for #21593
* tuple unpacking for vars as just sugar, allowing nesting (#21563)metagn2023-03-281-1/+3
| | | | | | | | | | | | | | | | | | | * tuple unpacking for vars as just sugar, allowing nesting * set temp symbol AST * hopeful fix some issues, add test for #19364 * always use temp for consts * document, fix small issue * fix manual indentation * actually fix manual * use helper proc * don't resem temp tuple assignment
* Add `contains` to `std/macrocache` (#21304)Jake Leahy2023-02-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add test cases * Implement contains for CacheSeq * Implement contains for CacheTable * Fix implementation of hasKey * Remove contains for CacheSeq Fix runnable examples I was accidently using --doccmd:skip so I didn't spot the failure locally * Implement hasKey as a VM callback instead of magic * Implement suggestions from PR Co-Authored-By: ringabout <ringabout@users.noreply.github.com> * Update lib/core/macrocache.nim --------- Co-authored-by: ringabout <ringabout@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Implement setLineInfo (#21153)Peter Munch-Ellingsen2022-12-221-1/+22
| | | | | * Implement setLineInfo * Add tests
* fix #16758 Nim crashes in fixAbstractType (#20855)Bung2022-12-111-0/+38
| | | | | | | | | * fix #16758 Nim crashes in fixAbstractType * Update compiler/semexprs.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* store full definition AST for consts, fix noRewrite (#20115)metagn2022-09-282-1/+17
| | | | | | | | | | | | | | | | | | | | | | | * continue #9582 for consts, close #9331, fix #20114 also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc * changelog correctly * fix jsgen * update tgetimpl * fix sighashes * fix #19766, add comment about postfix * fix noRewrite LOL refs #16620 * fix changelog * fix destructors
* defaults to ORC (#19972)ringabout2022-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * defaults to Orc * bootstrap using refc * use gc * init orc defines * unregister orc * fix gc * fix commands * add prepareMutation for orc * enable deepcopy for orc * prepareMutation * more fixes * some cases * bug #20081 * partial fixes * partial fixes * fixes command line * more fixes * build Nim with refc * use gc * more fixes * rstore * orc doesn't support threadpool * more shallowCopy * more fixes * fixes unsafeNew * workarounds * small * more fixes * fixes some megatest * tcodegenbugs1 refc * fxies megatest * build nimble with refc * workaround tensordsl tests * replace shallowCopy with move * fixes action * workaround * add todo * fixes important packages * unpublic unregisterArcOrc * fixes cpp * enable windows Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * remove deprecated pragma syntax from 0.20.0 closes #4651, closes #16653 with a cheap fix for now due to how early `tfFinal` is set * remove type pragma between name and generics * undo removal, try removing bind expression (0.8.14) * fix test, unremove bind expr * remove again * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * dependencies @ HEAD & weave test dependencies * try fix package ci Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* new .redefine pragma for templates, warn on redefinition without it (#20211)metagn2022-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test CI for template redefinitions * adapt asyncmacro * fix quote * fix again * try something else * revert * fix ioselectors_select, disable packages CI * adapt more tests & simplify * more * more * more * rename to redefine, warn on implicit redefinition * basic documentation [skip ci] * Update compiler/lineinfos.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fix #20067, fix #18976 [backport] (#20069)metagn2022-07-221-0/+28
|
* fix NimNode comment repr() regression [backport: 1.2] (#19726)flywind2022-04-251-0/+19
|
* Allow std/macros.params to work with nnkProcTy (#19563)Tanguy2022-02-251-0/+22
| | | | | * Allow std/macros.params to work with nnkProcTy * Add tests for proc params & pragma
* [testcase] genSym fails to make unique identifier for ref object types (#19506)flywind2022-02-141-0/+60
| | | close #15118
* accept object type node from macros (#19179)hlaaftana2021-11-241-0/+16
|
* parseExpr/parseStmt accept filename, fixes #13540 (#19182)hlaaftana2021-11-242-0/+15
|
* `caseStmtMacros` no longer experimental, experimental manual refactor (#19173)hlaaftana2021-11-231-2/+0
| | | | | | | | | | | * `caseStmtMacros` no longer experimental, experimental manual refactor * Update doc/manual.rst * apply review suggestions * apply review Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #14511 [backport:1.4] (#18732)Dankr4d2021-08-251-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | * fixes #14511 [backport:1.4] Signed-off-by: Dankr4d <dude569@freenet.de> * Replaced fix with code from alaviss, for better readability, with small changes. Signed-off-by: Dankr4d <dude569@freenet.de> * - Specified output in test. Signed-off-by: Dankr4d <dude569@freenet.de> * Replaced case in nnkRecCase with a simpler version, which just adds the last son. Signed-off-by: Dankr4d <dude569@freenet.de> * Update tests/macros/t14511.nim * Update tests/macros/t14511.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Fix doubly typed forward declarations (#18279)Clyybber2021-06-161-1/+21
| | | | | | | | | * Add testcase * Fix testcase * Fix doubly typed forward decls * Better fix
* Don't report unused hints for consumed AST (#18270)Clyybber2021-06-161-0/+15
| | | | | | | | | * Fix #18203 * Add testcase * Fix testcase * Fix test
* fixes #18235 - proc annotation type macro sym leak (#18249)Saem Ghani2021-06-142-0/+60
| | | | | | | | | | | | | | | | | | | | | * fixes #18235 - proc annotation type macro sym leak - also fixed a typo - proc annotations guard symbol exports with shadow scopes - symbol handling is shadow scope aware * test for exporting an existing unexported sym this one is for my homie alaviss. * Special handling not needed in semProcAnnotation * Testcasing * [skip ci] clean-up and add some more comments * [skip ci] rm trailing whitespace Co-authored-by: Clyybber <darkmine956@gmail.com>
* getType now works with tyInferred (arising from concepts); refs #18220 (#18241)Timothee Cour2021-06-121-22/+78
| | | | | | | * getType now works with tyInferred (concepts); refs #18220 * avoid cast * add more docs
* macros.treeRepr + friends: collapse SymChoice (#18072)Timothee Cour2021-06-051-28/+108
| | | | | | | * macros.treeRepr + friends: collapse SymChoice * make repr+friends work with invalid symchoice nodes * address comment
* Fixes #5034 illformed AST from getImpl with proc returning value (#17976)Dylan Modesitt2021-05-311-0/+31
| | | | | * Fixes 5034 * address comments
* fix #17836 (typed macro isNil for proc params) (#17841)Saem Ghani2021-04-251-0/+15
| | | thanks @alaviss for the test
* close #7875 add testcase (#17611)flywind2021-04-021-0/+22
| | | | | * close #7875 add testcase * fix
* unify tuple expressions (#13793)Arne Döring2021-03-301-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * unify tuple expressions * fix test * fix test * apply feedback * Handle empty tuples * Fix rendering named unary tuple * Protect static NimNode against stripping * Slightly less hacky * Revert "Slightly less hacky" This reverts commit 170c5aec0addc029f637afbc948700ca006b7942. * Slightly less hacky * Cleanup * Fix test * Fix another test * Add condsym * Rebase fallout * changelog: Move from compiler changes to language changes * Add stricter tests * Add empty tuple example to doc/astspec * Fix test Co-authored-by: Clyybber <darkmine956@gmail.com>
* nnkArglist => nnkArgList + special case stylecheck:error (#17529)Timothee Cour2021-03-271-1/+1
| | | | | * nnkArglist => nnkArgList * special case stylecheck:error
* Remove support for named procs with sugar.=> (#17220)konsumlamm2021-03-051-8/+2
| | | | | | * Add docs & tests for named procs with sugar.=> * Remove support for named procs in sugar.=> * Resolve conflict * Fix test
* rename case statement macro from match to `case` (#16923)hlaaftana2021-02-081-0/+35
| | | | | * rename case statement macro from match to `case` * fix test
* fix broken => for typed procs with pragmas (#16190)hlaaftana2020-12-011-0/+13
| | | | | | | * fix broken => for typed procs with pragmas * add more sugar tests * add ending quote
* make megatest consistent with unjoined tests wrt newlines, honor newlines in ↵Timothee Cour2020-11-281-0/+1
| | | | | | | output spec (#16151) * fix megatest newlines * still allow missing trailing newline for now but in a more strict way than before
* More on #16110 (#16130)cooldome2020-11-261-6/+21
| | | | | | | | | | | * fix #16110 * refs #16110 * fix comment * Trigger build * use shallowCopy for efficiency
* fix #14339, #13511, #14420: fixes limited VM support for addr (#16002)Timothee Cour2020-11-251-0/+25
| | | | | | | | | | | * fix #14339: fixes limited VM support for addr * strengthen test * reference bug #16003 * also fixes #13511 * also fixes #14420
* fix #16110 (#16117)cooldome2020-11-241-0/+18
|
* Revert "fix #16110"Andrey R (cooldome)2020-11-241-19/+0
| | | | This reverts commit f8b9d8c1904c662f07e5ee1138357695a1df9ac3.
* fix #16110Andrey R (cooldome)2020-11-241-0/+19
|
* close #14847(add testcase for #14847) (#16045)flywind2020-11-191-0/+20
|
* add testcase for #14227 (#15794)flywind2020-10-301-0/+23
|
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-2/+9
| | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim
* renderer: use the biggest integer type for masking literals (#15482)alaviss2020-10-041-0/+2
| | | | | | | | On 32-bit system the mask would have a size of 32-bit, which is smaller than the BiggestInt (usually 64-bit) it was masked against. For some reason this only affect 32-bit Windows but not 32-bit Linux. Might just be a difference in how gcc handle out of bound shifts for Windows and Linux.
* Added std/effecttraits.nim (#15462)Andreas Rumpf2020-10-021-0/+22
|
* Fix #15389 (#15390)cooldome2020-09-241-0/+17
| | | | | | | | | * allow result symbol reuse * try different approach * Revert "try different approach" This reverts commit abcfb6b75983c2f798cc887342ff1a9ff10c0324.
* Fix forward declarations in shadow scope contexts (#15386)Clyybber2020-09-221-0/+77
| | | | | | | | | | | | | | | * Fix forward declarations in shadow scope contexts * Add testcase for #15385 * Less empty lines * Fix tests * Inline isShadowScope * Add original testcase (with reduced amount of iterations) * Add testcase without forward decl
* fix #15326 (#15341)cooldome2020-09-161-0/+8
|
* proc params as syms (#15332)cooldome2020-09-161-0/+8
| | | | | | | | | | | | | | | | | * proc params are now syms * Fix typesrenderer * Add testcase for disrupteks issue * fix test * Trigger build * Trigger build * Trigger build Co-authored-by: Clyybber <darkmine956@gmail.com>
* "for-loop macros" are no longer an experimental feature (#15288)Miran2020-09-081-1/+1
|
* Fix #5691 (#15158)Clyybber2020-08-272-0/+17
| | | | | | | | * Fix #5691 * Cleanup and thoughts * Use scope approach * Seperate defined/declared/declaredInScope magics * Fix declaredInScope * Update spec accordingly
* Fix forward declaration issues in template/macro context (#15091)Clyybber2020-07-291-0/+114
| | | | | | | | | | | | | | | | | | | | | | | * Fix forward declaration issues in template/macro context * Correct forward declaration resolving for overloads * Remove old dead code * WIP consistent gensym ids * Minimize diff * Remove obsoleted hack * Add templInstCounter to give unique IDs to template instantiations * Remove obsoleted code * Eh, init in myOpen, not myProcess... * Remove optNimV019 * Add testcase for #13484
* enable,document,test getImplTransformed, very useful for understanding how ↵Timothee Cour2020-07-181-0/+20
| | | | | | nim transforms code (#14924) * enable,document,test getImplTransformed, very useful for understanding how nim transforms code