use two spaces indentation (#19696)
This commit is contained in:
parent
e1929deac7
commit
0978276ed9
1 changed files with 14 additions and 14 deletions
|
|
@ -1505,20 +1505,20 @@ macro expandMacros*(body: typed): untyped =
|
||||||
result = body
|
result = body
|
||||||
|
|
||||||
proc extractTypeImpl(n: NimNode): NimNode =
|
proc extractTypeImpl(n: NimNode): NimNode =
|
||||||
## attempts to extract the type definition of the given symbol
|
## attempts to extract the type definition of the given symbol
|
||||||
case n.kind
|
case n.kind
|
||||||
of nnkSym: # can extract an impl
|
of nnkSym: # can extract an impl
|
||||||
result = n.getImpl.extractTypeImpl()
|
result = n.getImpl.extractTypeImpl()
|
||||||
of nnkObjectTy, nnkRefTy, nnkPtrTy: result = n
|
of nnkObjectTy, nnkRefTy, nnkPtrTy: result = n
|
||||||
of nnkBracketExpr:
|
of nnkBracketExpr:
|
||||||
if n.typeKind == ntyTypeDesc:
|
if n.typeKind == ntyTypeDesc:
|
||||||
result = n[1].extractTypeImpl()
|
result = n[1].extractTypeImpl()
|
||||||
else:
|
else:
|
||||||
doAssert n.typeKind == ntyGenericInst
|
doAssert n.typeKind == ntyGenericInst
|
||||||
result = n[0].getImpl()
|
result = n[0].getImpl()
|
||||||
of nnkTypeDef:
|
of nnkTypeDef:
|
||||||
result = n[2]
|
result = n[2]
|
||||||
else: error("Invalid node to retrieve type implementation of: " & $n.kind)
|
else: error("Invalid node to retrieve type implementation of: " & $n.kind)
|
||||||
|
|
||||||
proc customPragmaNode(n: NimNode): NimNode =
|
proc customPragmaNode(n: NimNode): NimNode =
|
||||||
expectKind(n, {nnkSym, nnkDotExpr, nnkBracketExpr, nnkTypeOfExpr, nnkCheckedFieldExpr})
|
expectKind(n, {nnkSym, nnkDotExpr, nnkBracketExpr, nnkTypeOfExpr, nnkCheckedFieldExpr})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue