diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/core/macros.nim | 7 | ||||
-rwxr-xr-x | lib/system.nim | 14 | ||||
-rwxr-xr-x | lib/system/sysio.nim | 4 |
3 files changed, 11 insertions, 14 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 272b9a45e..2eab1750c 100755 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -46,14 +46,17 @@ type nnkYieldStmt, nnkTryStmt, nnkFinally, nnkRaiseStmt, nnkReturnStmt, nnkBreakStmt, nnkContinueStmt, nnkBlockStmt, nnkStaticStmt, nnkDiscardStmt, nnkStmtList, nnkImportStmt, nnkFromStmt, - nnkIncludeStmt, nnkBindStmt, nnkPattern, + nnkIncludeStmt, nnkBindStmt, nnkCommentStmt, nnkStmtListExpr, nnkBlockExpr, nnkStmtListType, nnkBlockType, nnkTypeOfExpr, nnkObjectTy, nnkTupleTy, nnkRecList, nnkRecCase, nnkRecWhen, nnkRefTy, nnkPtrTy, nnkVarTy, nnkConstTy, nnkMutableTy, nnkDistinctTy, - nnkProcTy, nnkEnumTy, nnkEnumFieldDef, nnkReturnToken + nnkProcTy, nnkEnumTy, + nnkEnumFieldDef, + nnkArglist, nnkPattern + nnkReturnToken TNimNodeKinds* = set[TNimrodNodeKind] TNimrodTypeKind* = enum ntyNone, ntyBool, ntyChar, ntyEmpty, diff --git a/lib/system.nim b/lib/system.nim index b40f161f1..100707687 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -1314,10 +1314,11 @@ iterator items*(a: cstring): char {.inline.} = yield a[i] inc(i) -iterator items*(E: typedesc{enum}): E = - ## iterates over the values of the enum ``E``. - for v in low(E)..high(E): - yield v +when not defined(booting): + iterator items*(E: typedesc[enum]): E = + ## iterates over the values of the enum ``E``. + for v in low(E)..high(E): + yield v iterator pairs*[T](a: openarray[T]): tuple[key: int, val: T] {.inline.} = ## iterates over each item of `a`. Yields ``(index, a[index])`` pairs. @@ -1832,12 +1833,9 @@ when not defined(EcmaScript) and not defined(NimrodVM): ## ``CRLF``. The newline character(s) are not part of the returned string. ## Returns ``false`` if the end of the file has been reached, ``true`` ## otherwise. If ``false`` is returned `line` contains no new data. - proc writeln*[Ty](f: TFile, x: Ty) {.inline.} - ## writes a value `x` to `f` and then writes "\n". - ## May throw an IO exception. proc writeln*[Ty](f: TFile, x: varargs[Ty, `$`]) {.inline.} - ## writes a value `x` to `f` and then writes "\n". + ## writes the values `x` to `f` and then writes "\n". ## May throw an IO exception. proc getFileSize*(f: TFile): int64 diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index fa41a83cb..9f7866fdc 100755 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -146,10 +146,6 @@ proc EndOfFile(f: TFile): bool = ungetc(c, f) return c < 0'i32 -proc writeln[Ty](f: TFile, x: Ty) = - write(f, x) - write(f, "\n") - proc writeln[Ty](f: TFile, x: varargs[Ty, `$`]) = for i in items(x): write(f, i) write(f, "\n") |