Skip to content
Myr

Fix redundant subexpression in Generators and iterators example in doc (#3239)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Han Jiang · committed by GitHub · parent 31dac28 · Browse files · 3 files+4 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−5 removed

  • tests:+1 added−1 removed
  • other:+3 added−4 removed

3 files+4 added−5 removed

modified:docs/content/manual/dev/manual.yml+2 added-3 removed
3221 unmodified lines
3222 - program: 'def range(init; upto; by):3223 def _range:3224 if (by > 0 and . < upto) or (by < 0 and . > upto)3225 then ., ((.+by)|_range)3226 else . end;3227 if by == 0 then init else init|_range end |3228 select((by > 0 and . < upto) or (by < 0 and . > upto));3226 else empty end;3227 if init == upto then empty elif by == 0 then init else init|_range end;3228 range(0; 10; 3)'3229 input: 'null'3230 output: ['0', '3', '6', '9']3231 - program: 'def while(cond; update):
595 unmodified lines
modified:tests/man.test+1 added-1 removed
925 unmodified lines
926{"index":1,"item":"foo"}927{"index":2,"item":"bar"}928{"index":3,"item":"baz"}929930def range(init; upto; by): def _range: if (by > 0 and . < upto) or (by < 0 and . > upto) then ., ((.+by)|_range) else . end; if by == 0 then init else init|_range end | select((by > 0 and . < upto) or (by < 0 and . > upto)); range(0; 10; 3)930def range(init; upto; by): def _range: if (by > 0 and . < upto) or (by < 0 and . > upto) then ., ((.+by)|_range) else empty end; if init == upto then empty elif by == 0 then init else init|_range end; range(0; 10; 3)931null932093339346
45 unmodified lines
modified:jq.1.prebuilt+1 added-1 removed
3642 unmodified lines
3643.IP "" 43644.3645.nf36463647jq \'def range(init; upto; by): def _range: if (by > 0 and \. < upto) or (by < 0 and \. > upto) then \., ((\.+by)|_range) else \. end; if by == 0 then init else init|_range end | select((by > 0 and \. < upto) or (by < 0 and \. > upto)); range(0; 10; 3)\'3647jq \'def range(init; upto; by): def _range: if (by > 0 and \. < upto) or (by < 0 and \. > upto) then \., ((\.+by)|_range) else empty end; if init == upto then empty elif by == 0 then init else init|_range end; range(0; 10; 3)\'3648 null3649=> 0, 3, 6, 936503651jq \'def while(cond; update): def _while: if cond then \., (update | _while) else empty end; _while; [while(\.<100; \.*2)]\'
616 unmodified lines