add somes links to docs (#19668)

This commit is contained in:
flywind
2022-04-02 01:30:02 +08:00
committed by GitHub
parent a7024f49af
commit c3f03cfa5d

View File

@@ -933,21 +933,21 @@ proc treeTraverse(n: NimNode; res: var string; level = 0; isLisp = false, indent
proc treeRepr*(n: NimNode): string {.benign.} =
## Convert the AST `n` to a human-readable tree-like string.
##
## See also `repr`, `lispRepr`, and `astGenRepr`.
## See also `repr`, `lispRepr`_, and `astGenRepr`_.
result = ""
n.treeTraverse(result, isLisp = false, indented = true)
proc lispRepr*(n: NimNode; indented = false): string {.benign.} =
## Convert the AST `n` to a human-readable lisp-like string.
##
## See also `repr`, `treeRepr`, and `astGenRepr`.
## See also `repr`, `treeRepr`_, and `astGenRepr`_.
result = ""
n.treeTraverse(result, isLisp = true, indented = indented)
proc astGenRepr*(n: NimNode): string {.benign.} =
## Convert the AST `n` to the code required to generate that AST.
##
## See also `repr`, `treeRepr`, and `lispRepr`.
## See also `repr`_, `treeRepr`_, and `lispRepr`_.
const
NodeKinds = {nnkEmpty, nnkIdent, nnkSym, nnkNone, nnkCommentStmt}
@@ -1602,7 +1602,7 @@ macro hasCustomPragma*(n: typed, cp: typed{nkSym}): untyped =
## Expands to `true` if expression `n` which is expected to be `nnkDotExpr`
## (if checking a field), a proc or a type has custom pragma `cp`.
##
## See also `getCustomPragmaVal`.
## See also `getCustomPragmaVal`_.
##
## .. code-block:: nim
## template myAttr() {.pragma.}
@@ -1626,7 +1626,7 @@ macro getCustomPragmaVal*(n: typed, cp: typed{nkSym}): untyped =
## Expands to value of custom pragma `cp` of expression `n` which is expected
## to be `nnkDotExpr`, a proc or a type.
##
## See also `hasCustomPragma`
## See also `hasCustomPragma`_.
##
## .. code-block:: nim
## template serializationKey(key: string) {.pragma.}