Merge pull request #2163 from def-/declared-doc
Fix documentations for declared (instead of defined)
This commit is contained in:
commit
8a8c256738
3 changed files with 3 additions and 3 deletions
|
|
@ -243,7 +243,7 @@ proc semGenericStmt(c: PContext, n: PNode,
|
||||||
elif fn.kind == nkDotExpr:
|
elif fn.kind == nkDotExpr:
|
||||||
result.sons[0] = fuzzyLookup(c, fn, flags, ctx, mixinContext)
|
result.sons[0] = fuzzyLookup(c, fn, flags, ctx, mixinContext)
|
||||||
first = 1
|
first = 1
|
||||||
# Consider 'when defined(globalsSlot): ThreadVarSetValue(globalsSlot, ...)'
|
# Consider 'when declared(globalsSlot): ThreadVarSetValue(globalsSlot, ...)'
|
||||||
# in threads.nim: the subtle preprocessing here binds 'globalsSlot' which
|
# in threads.nim: the subtle preprocessing here binds 'globalsSlot' which
|
||||||
# is not exported and yet the generic 'threadProcWrapper' works correctly.
|
# is not exported and yet the generic 'threadProcWrapper' works correctly.
|
||||||
let flags = if mixinContext: flags+{withinMixin} else: flags
|
let flags = if mixinContext: flags+{withinMixin} else: flags
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ template optRe{re(x)}(x: string{lit}): Regex =
|
||||||
g
|
g
|
||||||
|
|
||||||
template `=~`(s: string, pattern: Regex): bool =
|
template `=~`(s: string, pattern: Regex): bool =
|
||||||
when not definedInScope(matches):
|
when not declaredInScope(matches):
|
||||||
var matches {.inject.}: array[maxSubPatterns, string]
|
var matches {.inject.}: array[maxSubPatterns, string]
|
||||||
match(s, pattern, matches)
|
match(s, pattern, matches)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ proc declared*(x: expr): bool {.magic: "Defined", noSideEffect.}
|
||||||
## feature or not:
|
## feature or not:
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## when not defined(strutils.toUpper):
|
## when not declared(strutils.toUpper):
|
||||||
## # provide our own toUpper proc here, because strutils is
|
## # provide our own toUpper proc here, because strutils is
|
||||||
## # missing it.
|
## # missing it.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue