spelling corrections; untabify
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by pkoppstein · committed by David Tolnay · parent 16d0e52 · Browse files · 1 file·+17 added−17 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+17 added−17 removed
- other:+17 added−17 removed
Provenance
- Commit
dea7868- Tree
343f518- Author
pkoppstein <pkoppstein@gmail.com>- Committer
David Tolnay <dtolnay@gmail.com>- Parent
16d0e52
1 file changed+17 added−17 removed
modified:docs/content/3.manual/manual.yml+17 added-17 removed
235 unmodified lines236 Do not use. Use `--slurpfile` instead.237 238 (This option is like `--slurpfile`, but when the file has just239 one text, then that is used, else an array of texts is used as240- in `--slurfile`.)240+ in `--slurpfile`.)241 242 * `--run-tests [filename]`:243 244 Runs the tests in the given file or standard input. This must245 be the last option given and does not honor all preceding246- options. The input consts of comment lines, empty lines, and246+ options. The input consists of comment lines, empty lines, and247 program lines followed by one input line, as many lines of248 output as are expected (one per output), and a terminating empty249 line. Compilation failure tests start with a line containing250 only "%%FAIL", then a line containing the program to compile,86 unmodified lines337 and so on.338 339 The `.foo` syntax only works for simply keys i.e. keys that340 are all alphanumeric characters. `.[<string>]` works with341- keys that contain special charactors such as colons and dots.341+ keys that contain special characters such as colons and dots.342 For example `.["foo::bar"]` and `.["foo.bar"]` work while343 `.foo::bar` and `.foo.bar` would not.344 345 The `?` "operator" can also be used with the slice operator,251 unmodified lines597 - title: Subtraction - `-`598 body: |599 600 As well as normal arithmetic subtraction on numbers, the `-`601- operator can be used on arrays to remove all occurences of601+ operator can be used on arrays to remove all occurrences of602 the second array's elements from the first array.603 604 examples:605 - program: '4 - .a'919 unmodified lines1525 - title: "`walk(f)`"1526 body: |1527 1528 The `walk(f)` function applies f recursively to every1529- component of the input entity. When an array is1530- encountered, f is first applied to its elements and then to1531- the array itself; when an object is encountered, f is first1532- applied to all the values and then to the object. In1533- practice, f will usually test the type of its input, as1534- illustrated in the following examples. The first example1535- highlights the usefulness of processing the elements of an1536- array of arrays before processing the array itself. The second1537- example shows how all the keys of all the objects within the1538- input can be considered for alteration.1529+ component of the input entity. When an array is1530+ encountered, f is first applied to its elements and then to1531+ the array itself; when an object is encountered, f is first1532+ applied to all the values and then to the object. In1533+ practice, f will usually test the type of its input, as1534+ illustrated in the following examples. The first example1535+ highlights the usefulness of processing the elements of an1536+ array of arrays before processing the array itself. The second1537+ example shows how all the keys of all the objects within the1538+ input can be considered for alteration.1539 1540 examples:1541 - program: 'walk(if type == "array" then sort else . end)'1542 input: '[[4, 1, 7], [8, 5, 2], [3, 6, 9]]'1543 output:1544 - '[[1,4,7],[2,5,8],[3,6,9]]'1545 1546- - program: 'walk( if type == "object" then with_entries( .key |= sub( "^_+"; "") ) else . end )1546+ - program: 'walk( if type == "object" then with_entries( .key |= sub( "^_+"; "") ) else . end )'1547 input: '[ { "_a": { "__b": 2 } } ]'1548 output:1549 - '[{"a":{"b":2}}]'1550 100 unmodified lines1651 Calls `tostring`, see that function for details.1652 1653 * `@json`:1654 1655- Serialises the input as JSON.1655+ Serializes the input as JSON.1656 1657 * `@html`:1658 1659 Applies HTML/XML escaping, by mapping the characters782 unmodified lines2442 As described above, `recurse` uses recursion, and any jq2443 function can be recursive. The `while` builtin is also2444 implemented in terms of recursion.2445 2446- Tail calls are optmized whenever the expression to the left of2446+ Tail calls are optimized whenever the expression to the left of2447 the recursive call outputs its last value. In practice this2448 means that the expression to the left of the recursive call2449 should not produce more than one output for each input.2450 455 unmodified lines