tuple unpacking is not enforced in for loops anymore
This commit is contained in:
parent
4fa80956b8
commit
a15475f582
6 changed files with 40 additions and 4 deletions
18
tests/accept/compile/tgenericmatcher2.nim
Normal file
18
tests/accept/compile/tgenericmatcher2.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
type
|
||||
TMatcherKind = enum
|
||||
mkTerminal, mkSequence, mkAlternation, mkRepeat
|
||||
TMatcher[T] = object
|
||||
case kind: TMatcherKind
|
||||
of mkTerminal:
|
||||
value: T
|
||||
of mkSequence, mkAlternation:
|
||||
matchers: seq[TMatcher[T]]
|
||||
of mkRepeat:
|
||||
matcher: ref TMatcher[T]
|
||||
min, max: int
|
||||
|
||||
var
|
||||
m: ref TMatcher[int]
|
||||
|
||||
|
||||
13
tests/accept/compile/titer_no_tuple_unpack.nim
Normal file
13
tests/accept/compile/titer_no_tuple_unpack.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
iterator xrange(fromm, to: int, step = 1): tuple[x, y: int] =
|
||||
var a = fromm
|
||||
while a <= to:
|
||||
yield (a, a+1)
|
||||
inc(a, step)
|
||||
|
||||
for a, b in xrange(3, 7):
|
||||
echo a, " ", b
|
||||
|
||||
for tup in xrange(3, 7):
|
||||
echo tup
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue