summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-02-18 13:37:54 +0100
committerAndreas Rumpf <rumpf_a@web.de>2015-02-18 13:37:54 +0100
commit8a8c2567385382d94b464ee578fab633c80a9aed (patch)
tree4fc039461d02d6d428b319602796e8dc2e77b547
parent5668ab3a49d5ebfce8952615ead75b0d98a28e2f (diff)
parent456aa7fdfe3d7e1458a41b41f00ceb06521d4fd3 (diff)
downloadNim-8a8c2567385382d94b464ee578fab633c80a9aed.tar.gz
Merge pull request #2163 from def-/declared-doc
Fix documentations for declared (instead of defined)
-rw-r--r--compiler/semgnrc.nim2
-rw-r--r--examples/talk/hoisting.nim2
-rw-r--r--lib/system.nim2
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim
index 13941fa58..2601f05ac 100644
--- a/compiler/semgnrc.nim
+++ b/compiler/semgnrc.nim
@@ -243,7 +243,7 @@ proc semGenericStmt(c: PContext, n: PNode,
     elif fn.kind == nkDotExpr:
       result.sons[0] = fuzzyLookup(c, fn, flags, ctx, mixinContext)
       first = 1
-    # Consider 'when defined(globalsSlot): ThreadVarSetValue(globalsSlot, ...)'
+    # Consider 'when declared(globalsSlot): ThreadVarSetValue(globalsSlot, ...)'
     # in threads.nim: the subtle preprocessing here binds 'globalsSlot' which 
     # is not exported and yet the generic 'threadProcWrapper' works correctly.
     let flags = if mixinContext: flags+{withinMixin} else: flags
diff --git a/examples/talk/hoisting.nim b/examples/talk/hoisting.nim
index df13ba2cb..54e00884f 100644
--- a/examples/talk/hoisting.nim
+++ b/examples/talk/hoisting.nim
@@ -14,7 +14,7 @@ template optRe{re(x)}(x: string{lit}): Regex =
   g
 
 template `=~`(s: string, pattern: Regex): bool =
-  when not definedInScope(matches):
+  when not declaredInScope(matches):
     var matches {.inject.}: array[maxSubPatterns, string]
   match(s, pattern, matches)
 
diff --git a/lib/system.nim b/lib/system.nim
index b86ab7080..accc2ef25 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -124,7 +124,7 @@ proc declared*(x: expr): bool {.magic: "Defined", noSideEffect.}
   ## feature or not:
   ##
   ## .. code-block:: Nim
-  ##   when not defined(strutils.toUpper):
+  ##   when not declared(strutils.toUpper):
   ##     # provide our own toUpper proc here, because strutils is
   ##     # missing it.
 
'n218' href='#n218'>218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351