From 15e7fe787a2bf89b82aeba965ed4fd8b200dca1a Mon Sep 17 00:00:00 2001 From: patrick dw Date: Fri, 19 Jun 2015 01:02:22 -0500 Subject: renamed writeln to writeLine in lib --- lib/impure/re.nim | 2 +- lib/packages/docutils/rst.nim | 2 +- lib/pure/cgi.nim | 6 +++--- lib/pure/logging.nim | 6 +++--- lib/pure/nimprof.nim | 6 +++--- lib/pure/parsesql.nim | 2 +- lib/pure/pegs.nim | 2 +- lib/pure/strutils.nim | 12 ++++++------ lib/pure/terminal.nim | 6 +++--- lib/system/endb.nim | 6 +++--- 10 files changed, 25 insertions(+), 25 deletions(-) (limited to 'lib') diff --git a/lib/impure/re.nim b/lib/impure/re.nim index 5f9371f28..0df8d4a9c 100644 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -369,7 +369,7 @@ iterator split*(s: string, sep: Regex): string = ## ## .. code-block:: nim ## for word in split("00232this02939is39an22example111", re"\d+"): - ## writeln(stdout, word) + ## writeLine(stdout, word) ## ## Results in: ## diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index ae3ed8feb..2fbde632e 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -307,7 +307,7 @@ proc defaultMsgHandler*(filename: string, line, col: int, msgkind: MsgKind, let a = messages[msgkind] % arg let message = "$1($2, $3) $4: $5" % [filename, $line, $col, $mc, a] if mc == mcError: raise newException(EParseError, message) - else: writeln(stdout, message) + else: writeLine(stdout, message) proc defaultFindFile*(filename: string): string {.procvar.} = if existsFile(filename): result = filename diff --git a/lib/pure/cgi.nim b/lib/pure/cgi.nim index e8977b80b..cfd768f91 100644 --- a/lib/pure/cgi.nim +++ b/lib/pure/cgi.nim @@ -25,9 +25,9 @@ ## # generate content: ## write(stdout, "\n") ## write(stdout, "Test\n") -## writeln(stdout, "your name: " & myData["name"]) -## writeln(stdout, "your password: " & myData["password"]) -## writeln(stdout, "") +## writeLine(stdout, "your name: " & myData["name"]) +## writeLine(stdout, "your password: " & myData["password"]) +## writeLine(stdout, "") import strutils, os, strtabs, cookies diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim index b28298dfa..7a900daae 100644 --- a/lib/pure/logging.nim +++ b/lib/pure/logging.nim @@ -132,12 +132,12 @@ method log*(logger: Logger, level: Level, args: varargs[string, `$`]) {. method log*(logger: ConsoleLogger, level: Level, args: varargs[string, `$`]) = ## Logs to the console using ``logger`` only. if level >= logger.levelThreshold: - writeln(stdout, substituteLog(logger.fmtStr, level, args)) + writeLine(stdout, substituteLog(logger.fmtStr, level, args)) method log*(logger: FileLogger, level: Level, args: varargs[string, `$`]) = ## Logs to a file using ``logger`` only. if level >= logger.levelThreshold: - writeln(logger.f, substituteLog(logger.fmtStr, level, args)) + writeLine(logger.f, substituteLog(logger.fmtStr, level, args)) proc defaultFilename*(): string = ## Returns the default filename for a logger. @@ -228,7 +228,7 @@ method log*(logger: RollingFileLogger, level: Level, args: varargs[string, `$`]) logger.curLine = 0 logger.f = open(logger.baseName, logger.baseMode, bufSize = logger.bufSize) - writeln(logger.f, substituteLog(logger.fmtStr, level, args)) + writeLine(logger.f, substituteLog(logger.fmtStr, level, args)) logger.curLine.inc # -------- diff --git a/lib/pure/nimprof.nim b/lib/pure/nimprof.nim index 765d1e341..cfe6bc40d 100644 --- a/lib/pure/nimprof.nim +++ b/lib/pure/nimprof.nim @@ -155,7 +155,7 @@ proc writeProfile() {.noconv.} = var f: File if open(f, filename, fmWrite): sort(profileData, cmpEntries) - writeln(f, "total executions of each stack trace:") + writeLine(f, "total executions of each stack trace:") var entries = 0 for i in 0..high(profileData): if profileData[i] != nil: inc entries @@ -175,13 +175,13 @@ proc writeProfile() {.noconv.} = for i in 0..min(100, entries-1): if profileData[i].total > 1: inc sum, profileData[i].total - writeln(f, "Entry: ", i+1, "/", entries, " Calls: ", + writeLine(f, "Entry: ", i+1, "/", entries, " Calls: ", profileData[i].total // totalCalls, " [sum: ", sum, "; ", sum // totalCalls, "]") for ii in 0..high(StackTrace): let procname = profileData[i].st[ii] if isNil(procname): break - writeln(f, " ", procname, " ", perProc[$procname] // totalCalls) + writeLine(f, " ", procname, " ", perProc[$procname] // totalCalls) close(f) echo "... done" else: diff --git a/lib/pure/parsesql.nim b/lib/pure/parsesql.nim index 91917b1c5..cfa60094d 100644 --- a/lib/pure/parsesql.nim +++ b/lib/pure/parsesql.nim @@ -1323,7 +1323,7 @@ proc ra(n: SqlNode, s: var string, indent: int) = # where: x.name == y.name #db.select(fromm = [t1, t2], where = t1.name == t2.name): #for x, y, z in db.select(fromm = a, b where = a.name == b.name): -# writeln x, y, z +# writeLine x, y, z proc renderSQL*(n: SqlNode): string = ## Converts an SQL abstract syntax tree to its string representation. diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index e165d7dca..28f6a17e6 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -979,7 +979,7 @@ iterator split*(s: string, sep: Peg): string = ## ## .. code-block:: nim ## for word in split("00232this02939is39an22example111", peg"\d+"): - ## writeln(stdout, word) + ## writeLine(stdout, word) ## ## Results in: ## diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 317da9a0a..93fcf4d3d 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -206,7 +206,7 @@ iterator split*(s: string, seps: set[char] = Whitespace): string = ## ## .. code-block:: nim ## for word in split(" this is an example "): - ## writeln(stdout, word) + ## writeLine(stdout, word) ## ## ...generates this output: ## @@ -220,7 +220,7 @@ iterator split*(s: string, seps: set[char] = Whitespace): string = ## ## .. code-block:: nim ## for word in split(";;this;is;an;;example;;;", {';'}): - ## writeln(stdout, word) + ## writeLine(stdout, word) ## ## ...produces the same output as the first example. The code: ## @@ -228,7 +228,7 @@ iterator split*(s: string, seps: set[char] = Whitespace): string = ## let date = "2012-11-20T22:08:08.398990" ## let separators = {' ', '-', ':', 'T'} ## for number in split(date, separators): - ## writeln(stdout, number) + ## writeLine(stdout, number) ## ## ...results in: ## @@ -259,7 +259,7 @@ iterator split*(s: string, sep: char): string = ## ## .. code-block:: nim ## for word in split(";;this;is;an;;example;;;", ';'): - ## writeln(stdout, word) + ## writeLine(stdout, word) ## ## Results in: ## @@ -309,7 +309,7 @@ iterator splitLines*(s: string): string = ## ## .. code-block:: nim ## for line in splitLines("\nthis\nis\nan\n\nexample\n"): - ## writeln(stdout, line) + ## writeLine(stdout, line) ## ## Results in: ## @@ -571,7 +571,7 @@ iterator tokenize*(s: string, seps: set[char] = Whitespace): tuple[ ## ## .. code-block:: nim ## for word in tokenize(" this is an example "): - ## writeln(stdout, word) + ## writeLine(stdout, word) ## ## Results in: ## diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim index 2efdf72d5..b6d99e429 100644 --- a/lib/pure/terminal.nim +++ b/lib/pure/terminal.nim @@ -430,8 +430,8 @@ macro styledEcho*(m: varargs[expr]): stmt = case item.kind of nnkStrLit..nnkTripleStrLit: if i == m.len - 1: - # optimize if string literal is last, just call writeln - result.add(newCall(bindSym"writeln", bindSym"stdout", item)) + # optimize if string literal is last, just call writeLine + result.add(newCall(bindSym"writeLine", bindSym"stdout", item)) if reset: result.add(newCall(bindSym"resetAttributes")) return else: @@ -470,7 +470,7 @@ when not defined(testing) and isMainModule: writeStyled("styled text ", {styleBright, styleBlink, styleUnderscore}) setBackGroundColor(bgCyan, true) setForeGroundColor(fgBlue) - writeln(stdout, "ordinary text") + writeLine(stdout, "ordinary text") styledEcho("styled text ", {styleBright, styleBlink, styleUnderscore}) diff --git a/lib/system/endb.nim b/lib/system/endb.nim index ef2664796..cba11ac5e 100644 --- a/lib/system/endb.nim +++ b/lib/system/endb.nim @@ -117,7 +117,7 @@ proc dbgRepr(p: pointer, typ: PNimType): string = proc writeVariable(stream: File, slot: VarSlot) = write(stream, slot.name) write(stream, " = ") - writeln(stream, dbgRepr(slot.address, slot.typ)) + writeLine(stream, dbgRepr(slot.address, slot.typ)) proc listFrame(stream: File, f: PFrame) = write(stream, EndbBeg) @@ -125,7 +125,7 @@ proc listFrame(stream: File, f: PFrame) = write(stream, f.len) write(stream, " slots):\n") for i in 0 .. f.len-1: - writeln(stream, getLocal(f, i).name) + writeLine(stream, getLocal(f, i).name) write(stream, EndbEnd) proc listLocals(stream: File, f: PFrame) = @@ -141,7 +141,7 @@ proc listGlobals(stream: File) = write(stream, EndbBeg) write(stream, "| Globals:\n") for i in 0 .. getGlobalLen()-1: - writeln(stream, getGlobal(i).name) + writeLine(stream, getGlobal(i).name) write(stream, EndbEnd) proc debugOut(msg: cstring) = -- cgit 1.4.1-2-gfad0 a id='n200' href='#n200'>200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 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 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452