mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-26 12:55:06 +00:00
fixes #3767
This commit is contained in:
@@ -3541,16 +3541,22 @@ proc `^`*(x: int): int {.noSideEffect, magic: "Roof".} =
|
||||
## overloaded ``[]`` or ``[]=`` accessors.
|
||||
discard
|
||||
|
||||
template `..^`*(a, b: expr): expr =
|
||||
template `..^`*(a, b: untyped): untyped =
|
||||
## a shortcut for '.. ^' to avoid the common gotcha that a space between
|
||||
## '..' and '^' is required.
|
||||
a .. ^b
|
||||
|
||||
template `..<`*(a, b: expr): expr =
|
||||
template `..<`*(a, b: untyped): untyped {.dirty.} =
|
||||
## a shortcut for '.. <' to avoid the common gotcha that a space between
|
||||
## '..' and '<' is required.
|
||||
a .. <b
|
||||
|
||||
iterator `..<`*[S,T](a: S, b: T): T =
|
||||
var i = T(a)
|
||||
while i < b:
|
||||
yield i
|
||||
inc i
|
||||
|
||||
proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.} = discard
|
||||
proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect.} =
|
||||
## returns the length of a sequence or a string without testing for 'nil'.
|
||||
|
||||
Reference in New Issue
Block a user