diff options
author | Araq <rumpf_a@web.de> | 2019-07-09 11:37:34 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-07-09 11:38:01 +0200 |
commit | eefcea88927ee4845d3c46f38394fa39172c9987 (patch) | |
tree | e09d0d21be2728440ac81439d4a9fadea504da44 /nimpretty/tests/expected | |
parent | fc3419348381316e7e48118e85cca7c01244e398 (diff) | |
download | Nim-eefcea88927ee4845d3c46f38394fa39172c9987.tar.gz |
nimpretty: more improvements
Diffstat (limited to 'nimpretty/tests/expected')
-rw-r--r-- | nimpretty/tests/expected/tevil_spaces.nim | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/nimpretty/tests/expected/tevil_spaces.nim b/nimpretty/tests/expected/tevil_spaces.nim new file mode 100644 index 000000000..9c6b08854 --- /dev/null +++ b/nimpretty/tests/expected/tevil_spaces.nim @@ -0,0 +1,45 @@ +if true: + echo 7 + +type + TCallingConvention* = enum # \ + # asdfkljsdlf + # + ccDefault, # proc has no explicit calling convention + ccStdCall, # procedure is stdcall + ccCDecl, # cdecl + ccSafeCall, # safecall + ccSysCall, # system call + ccInline, # proc should be inlined + ccNoInline, # proc should not be inlined + # + # continueing here + ccFastCall, # fastcall (pass parameters in registers) + ccClosure, # proc has a closure + ccNoConvention # needed for generating proper C procs sometimes + +# asyncmacro.nim:260 +# asfkjaflk jkldas +proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} = + ## Doc comment here. + # Now an ordinary comment. + outerProcBody.add( + newVarStmt(retFutureSym, + newCall( + newNimNode(nnkBracketExpr, prc.body).add( + newIdentNode("newFuture"), + subRetType), + newLit(prcName)))) # Get type from return type of this proc + + # -> iterator nameIter(): FutureBase {.closure.} = + # -> {.push warning[resultshadowed]: off.} + # -> var result: T + # -> {.pop.} + # -> <proc_body> + # -> complete(retFuture, result) + var iteratorNameSym = genSym(nskIterator, $prcName & "Iter") + var procBody = prc.body.processBody(retFutureSym, subtypeIsVoid, + futureVarIdents) + if tue: + foo() # comment here + # end if |