Skip to content

Commit

Permalink
docs: Document repeat(exp)
Browse files Browse the repository at this point in the history
  • Loading branch information
wader authored and nicowilliams committed May 26, 2022
1 parent f2ad951 commit cff5336
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/content/manual/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,22 @@ sections:
input: '1'
output: ['[1,2,4,8,16,32,64]']

- title: "`repeat(exp)`"
body: |
The `repeat(exp)` function allows you to repeatedly
apply expression `exp` to `.` until an error is raised.
Note that `repeat(exp)` is internally defined as a
recursive jq function. Recursive calls within `repeat` will
not consume additional memory if `exp` produces at most one
output for each input. See advanced topics below.
examples:
- program: '[repeat(.*2, error)?]'
input: '1'
output: ['[2]']

- title: "`until(cond; next)`"
body: |
Expand Down

0 comments on commit cff5336

Please sign in to comment.