summary refs log tree commit diff stats
path: root/lib/pure/asyncmacro.nim
Commit message (Collapse)AuthorAgeFilesLines
* Make async stacktraces less verbose (#21091)Jake Leahy2022-12-151-6/+10
| | | | | | | | | | | | | | | | | | | | | | | * Name iterators something human readable Remove intermediate async procs from stacktraces Clean async traceback message from reraises message * Remove unused import/variable * Fix failing tests Don't add {.stackTrace: off.} to anonymous procs (They already don't appear in stacktrace) * Fix failing tests in pragma category Now check that the nim is a routine type first so we don't run into any assertion defects * Hide stack trace pragma in docs and update doc tests User doesn't need to know if something won't appear so this more becomes verbose noise If this is a bad idea we can always add a `when defined(nimdoc)` switch so we don't add {.stackTrace: off.} to the Future[T] returning proc for docs
* `multisync` now allows tuples in return type (#21074)Jake Leahy2022-12-111-2/+2
| | | | | | | * Add test case * Use .toStrLit() on param node first This means that more complex types are fully rendered
* Use a unique name for template in async macro return (#21058)Jake Leahy2022-12-101-3/+3
| | | Use unique template name
* Implicit return working for async proc (#20933)Jake Leahy2022-12-091-2/+11
| | | | | | | | | | | | | * Implicit return working for asyncdispatch proc Closes #1
discard """
  output: '''x as ParameterizedType[T]
x as ParameterizedType[T]
x as ParameterizedType[T]
x as ParameterizedType
x as ParameterizedType
x as CustomTypeClass'''
"""

type ParameterizedType[T] = object

type CustomTypeClass = concept
  true

# 3 competing procs
proc a[T](x: ParameterizedType[T]) =
  echo "x as ParameterizedType[T]"

proc a(x: ParameterizedType) =
  echo "x as ParameterizedType"

proc a(x: CustomTypeClass) =
  echo "x as CustomTypeClass"

# the same procs in different order
proc b(x: ParameterizedType) =
  echo "x as ParameterizedType"

proc b(x: CustomTypeClass) =
  echo "x as CustomTypeClass"

proc b[T](x: ParameterizedType[T]) =
  echo "x as ParameterizedType[T]"

# and yet another order
proc c(x: CustomTypeClass) =
  echo "x as CustomTypeClass"

proc c(x: ParameterizedType) =
  echo "x as ParameterizedType"

proc c[T](x: ParameterizedType[T]) =
  echo "x as ParameterizedType[T]"

# remove the most specific one
proc d(x: ParameterizedType) =
  echo "x as ParameterizedType"

proc d(x: CustomTypeClass) =
  echo "x as CustomTypeClass"

# then shuffle the order again
proc e(x: CustomTypeClass) =
  echo "x as CustomTypeClass"

proc e(x: ParameterizedType) =
  echo "x as ParameterizedType"

# the least specific one is a match
proc f(x: CustomTypeClass) =
  echo "x as CustomTypeClass"

a(ParameterizedType[int]())
b(ParameterizedType[int]())
c(ParameterizedType[int]())
d(ParameterizedType[int]())
e(ParameterizedType[int]())
f(ParameterizedType[int]())
186c68af1fbcc1185d815f52024c4647fe0b'>Disable unused warnings for await in async macro (#14517)
Danil Yarantsev2020-05-311-2/+2
| | | | | * Disable unused warnings for await in async macro * Remove used for the error template
* discardable async procs are now an error (#14176)hlaaftana2020-05-011-8/+14
| | | | * add discard warning in manual
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-2/+2
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* Make await a template (#12085)Alexander Ivanov2020-04-251-132/+30
| | | | | * Make await a template * Generate await inside async/multisync
* Fix #13889 with testcase (#13896) [backport]Clyybber2020-04-061-1/+1
| | | | | | | | | * Fix https://github.com/nim-lang/Nim/issues/13889 * Add testcase * Reduce test time Co-authored-by: Elie Zedeck RANDRIAMIANDRIRAY <elie.zedeck@gmail.com>
* macros for proc types, macros for types (#13778)Andreas Rumpf2020-03-311-0/+6
| | | | | | | | | * new minor feature: macros for proc types, to be documented * Finished the implementation and added tests * [skip ci] Describe the new custom pragmas in the manual and the changelog Co-authored-by: Zahary Karadjov <zahary@gmail.com>
* fixes #13519Araq2020-03-111-1/+1
|
* [backport] run nimpretty on asyncnarimiran2019-09-301-9/+11
|
* async macro: general stability improvements [bugfix] (#11787)Andreas Rumpf2019-07-191-10/+13
|
* newruntime: progress to make 'async' work with --newruntimeAraq2019-07-151-7/+4
|
* make async tests green againAndreas Rumpf2019-07-111-2/+2
|
* make more parts of the stdlib compile with --styleCheck:errorAraq2019-07-101-1/+1
|
* newruntime: async progressAraq2019-07-091-2/+2
|
* asyncmacro produces 'owned' typesAraq2019-07-091-2/+2
|
* newruntime for async (#11650)Andreas Rumpf2019-07-051-1/+4
| | | | | | | * fixes overloading resolution for passing owned(Future[string]) to Future[T] * WIP: make --newruntime work with .async * memtracker: make it compile again * make Nimble compile again
* Fix header inconsistencies in documentation (#11071)Zed2019-04-231-2/+0
|
* Small change in how tuples are handled in async macroLemonBoy2019-02-041-7/+7
| | | | A small change that brings no functional change beside a flatter tree.
* Restore the docstring during the .async. transform (#10404) [backport]LemonBoy2019-01-221-0/+6
| | | Fixes #9816
* asyncmacro: add nnkSym support for getName() (#9204)alaviss2018-10-091-1/+1
| | | Fixes #9201
* Fix regression w/ templates defined in async procLemonBoy2018-10-031-1/+1
|
* Skip nested procedures in .async. macroLemonBoy2018-09-221-0/+3
| | | | Fixes #3075
* Minor fixes for asyncjs (#8894)LemonBoy2018-09-071-1/+1
| | | | | | | | | | * Minor fixes for asyncjs Mark internal procedures as used Allow .async. for more node kinds Make .async. work for nkStmtList * Fix logic error in both the async macros
* Rip out the `try` transformation in the async macro.Dominik Picheta2018-06-061-105/+6
|
* Fix some usages of typedesc in async procsZahary Karadjov2018-04-131-1/+3
| | | | | This also fixes a compilation error in modules, based only on the new async module (i.e. not importing the full asyncdispatch)
* fix deprecation warnings in asyncmacro and htmlgen (#7573)Arne Döring2018-04-121-20/+20
| | | | | | * fix deprecation warnings in asyncmacro and htmlgen * removed todo
* Merge pull request #6962 from nim-lang/fixes/6100Dominik Picheta2018-01-101-0/+6
|\ | | | | Fixes #6100.
| * Fixes #6100.Dominik Picheta2017-12-271-0/+6
| |
* | optimized friendly stack tracesAraq2017-12-281-0/+2
| |
* | Rename cb0 to asyncProcName_continue + other improvements to async tracebacks.Dominik Picheta2017-12-281-6/+7
|/
* Remove unneeded comment #6708Anatoly Galiulin2017-11-131-3/+0
|