lessphp
lessphp copied to clipboard
guarded recursion fails on exit
This
.recurse(@n, @i:0) when ( @i =< @n ) {
.foo { border:@i; }
.recurse( @n , (@i + 1) );
}
.recurse (5);
fails without a clear error message. plessc says
'src/less/loops.less on line 7ned: failed at '.recurse( @n , (@i + 1) );
the problem is apparently .recurse( 5,6 ); is not defined. this works fine :
.recurse(@n, @i:0) when ( @i =< @n ) {
.foo { border:@i; }
.recurse( @n , (@i + 1) );
}
.recurse(@n, @i:0) when ( @i > @n ) {
// done
}
.recurse (5);
It makes some sense, but it's not documented (I think) and other libs don't do that afaik