mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
add somes links to docs (#19668)
This commit is contained in:
@@ -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.}
|
||||
|
||||
Reference in New Issue
Block a user