tevil_spaces.nim 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. if true:
  2. echo 7
  3. type
  4. TCallingConvention* = enum # \
  5. # asdfkljsdlf
  6. #
  7. ccDefault, # proc has no explicit calling convention
  8. ccStdCall, # procedure is stdcall
  9. ccCDecl, # cdecl
  10. ccSafeCall, # safecall
  11. ccSysCall, # system call
  12. ccInline, # proc should be inlined
  13. ccNoInline, # proc should not be inlined
  14. #
  15. # continuing here
  16. ccFastCall, # fastcall (pass parameters in registers)
  17. ccClosure, # proc has a closure
  18. ccNoConvention # needed for generating proper C procs sometimes
  19. # asyncmacro.nim:260
  20. # asfkjaflk jkldas
  21. proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
  22. ## Doc comment here.
  23. # Now an ordinary comment.
  24. outerProcBody.add(
  25. newVarStmt(retFutureSym,
  26. newCall(
  27. newNimNode(nnkBracketExpr, prc.body).add(
  28. newIdentNode("newFuture"),
  29. subRetType),
  30. newLit(prcName)))) # Get type from return type of this proc
  31. # -> iterator nameIter(): FutureBase {.closure.} =
  32. # -> {.push warning[resultshadowed]: off.}
  33. # -> var result: T
  34. # -> {.pop.}
  35. # -> <proc_body>
  36. # -> complete(retFuture, result)
  37. var iteratorNameSym = genSym(nskIterator, $prcName & "Iter")
  38. var procBody = prc.body.processBody(retFutureSym, subtypeIsVoid,
  39. futureVarIdents)
  40. if tue:
  41. foo() # comment here
  42. # end if
  43. proc distribute*[T](s: seq[T], num: Positive, spread = true): seq[seq[T]] =
  44. ## Splits and distributes a sequence `s` into `num` sub-sequences.
  45. let num = int(num) # XXX probably only needed because of .. bug
  46. # This is part of the above.
  47. result = newSeq[seq[T]](num)
  48. proc distribute*[T](s: seq[T], num: Positive, spread = true): seq[seq[T]] =
  49. ## Splits and distributes a sequence `s` into `num` sub-sequences.
  50. let num = int(num) # XXX probably only needed because of .. bug
  51. # This belongs below.
  52. result = newSeq[seq[T]](num)