make code more readable

This commit is contained in:
Andreas Rumpf 2019-02-18 10:30:30 +01:00
commit b5eed8ab3f

View file

@ -297,14 +297,14 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
of tyOptAsRef: assert(false, "mapTypeToAstX") of tyOptAsRef: assert(false, "mapTypeToAstX")
proc opMapTypeToAst*(cache: IdentCache; t: PType; info: TLineInfo): PNode = proc opMapTypeToAst*(cache: IdentCache; t: PType; info: TLineInfo): PNode =
result = mapTypeToAstX(cache, t, info, false, true) result = mapTypeToAstX(cache, t, info, inst=false, allowRecursionX=true)
# the "Inst" version includes generic parameters in the resulting type tree # the "Inst" version includes generic parameters in the resulting type tree
# and also tries to look like the corresponding Nim type declaration # and also tries to look like the corresponding Nim type declaration
proc opMapTypeInstToAst*(cache: IdentCache; t: PType; info: TLineInfo): PNode = proc opMapTypeInstToAst*(cache: IdentCache; t: PType; info: TLineInfo): PNode =
result = mapTypeToAstX(cache, t, info, true, false) result = mapTypeToAstX(cache, t, info, inst=true, allowRecursionX=false)
# the "Impl" version includes generic parameters in the resulting type tree # the "Impl" version includes generic parameters in the resulting type tree
# and also tries to look like the corresponding Nim type implementation # and also tries to look like the corresponding Nim type implementation
proc opMapTypeImplToAst*(cache: IdentCache; t: PType; info: TLineInfo): PNode = proc opMapTypeImplToAst*(cache: IdentCache; t: PType; info: TLineInfo): PNode =
result = mapTypeToAstX(cache, t, info, true, true) result = mapTypeToAstX(cache, t, info, inst=true, allowRecursionX=true)