Branch: Tag:

2003-09-11

2003-09-11 19:23:54 by Martin Stjernholm <mast@lysator.liu.se>

Backported from 7.5: Changed foreach to step the iterator after the loop
instead of before it, so that the iterator points to the current element
instead of the next one. Also some cleanup in iterators.cmod.

Rev: src/docode.c:1.163
Rev: src/interpret_functions.h:1.126
Rev: src/iterators.cmod:1.34
Rev: src/testsuite.in:1.592

1: - test_true([["$Id: testsuite.in,v 1.591 2003/09/09 16:58:30 mast Exp $"]]); + test_true([["$Id: testsuite.in,v 1.592 2003/09/11 19:23:54 mast Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])
6406:    return ret;   ]],315)    + test_any([[ +  String.Iterator iter = String.Iterator ("foo"); +  foreach (iter; int idx;) +  if (idx != iter->index()) return 1; +  return 0; + ]], 0) +    // do-while   test_any(int e;string t=""; e=0; do{ t+=e; }while(++e<6); return t,"012345";)