
/*
  NOTE: This file is added to tests/config/lint-ignore because of validity
  problems: https://github.com/lesshint/lesshint/issues/133
*/

/*
  For loop
  See https://github.com/seven-phases-max/less.curious/blob/master/articles/generic-for.md
*/
.for(@i, @n) {
    .-each(@i);
}

.for(@n) when (isnumber(@n)) {
    .for(1, @n)
}

.for(@i, @n) when not (@i = @n) {
    .for((@i + (@n - @i) / abs(@n - @i)), @n);
}

/*
  Foreach loop
  See https://github.com/seven-phases-max/less.curious/blob/master/articles/for-each.md
*/
.for(@array) when (default()) {
    .for-impl_(length(@array));
}

.for-impl_(@i) when (@i > 1) {
    .for-impl_((@i - 1));
}

.for-impl_(@i) when (@i > 0) {
    .-each(extract(@array, @i));
}
