Fix docs YAML (introduced in #432)

This commit is contained in:
Nicolas Williams committed 2014-08-08 18:01:42 -05:00
1 parent a696c6b551
commit eb12f0358e
1 file changed
+10 -19
+10 -19
View File
@@ -712,7 +712,7 @@ sections:
output: ['[5,3,7]'] output: ['[5,3,7]']
- program: '.[] | select(.id == "second")' - program: '.[] | select(.id == "second")'
input: '[{"id": "first", "val": 1}, {"id": "second", "val": 2}]' input: '[{"id": "first", "val": 1}, {"id": "second", "val": 2}]'
output: '{"id": "second", "val": 2}' output: ['{"id": "second", "val": 2}']
- title: "`arrays`, `objects`, `iterables`, `booleans`, `numbers`, `strings`, `nulls`, `values`, `scalars`" - title: "`arrays`, `objects`, `iterables`, `booleans`, `numbers`, `strings`, `nulls`, `values`, `scalars`"
@@ -1720,7 +1720,7 @@ sections:
examples: examples:
- program: 'capture("(?<a>[a-z]+)-(?<n>[0-9]+)")' - program: 'capture("(?<a>[a-z]+)-(?<n>[0-9]+)")'
input: '"xyzzy-14"' input: '"xyzzy-14"'
output: '{ "a": "xyzzy", "n": "14" }'' output: ['{ "a": "xyzzy", "n": "14" }']
- title: "`scan(regex)`, `scan(regex; flags)`" - title: "`scan(regex)`, `scan(regex; flags)`"
body: | body: |
@@ -1729,20 +1729,18 @@ sections:
that match the regex in accordance with the flags, if any that match the regex in accordance with the flags, if any
have been specified. If there is no match, the stream is empty. have been specified. If there is no match, the stream is empty.
To capture all the matches for each input string, use the idiom To capture all the matches for each input string, use the idiom
[ expr ], e.g. [ scan(regex) ]. `[ expr ]`, e.g. `[ scan(regex) ]`.
example: example:
- program: 'scan("c")' - program: 'scan("c")'
input: '"abcdefabc"' input: '"abcdefabc"'
output: '"c"' output: ['"c"', '"c"']
'"c"'
- program: 'scan("b")' - program: 'scan("b")'
input: ("", "") input: ("", "")
output: '[]' output: ['[]', '[]']
'[]"'
- title: "`split(regex)`, split(regex; flags)`" - title: "`split(regex)`, `split(regex; flags)`"
body: | body: |
For backwards compatibility, `split` emits an array of the strings For backwards compatibility, `split` emits an array of the strings
@@ -1757,8 +1755,8 @@ sections:
example: example:
- program: 'split(", *")' - program: 'split(", *")'
input: '"ab,cd, ef"` input: '"ab,cd, ef"'
output: '["ab","cd","ef"]' output: ['"ab","cd","ef"']
- title: "`splits(regex)`, splits(regex; flags)`" - title: "`splits(regex)`, splits(regex; flags)`"
@@ -1769,15 +1767,10 @@ sections:
example: example:
- program: 'splits(", *")' - program: 'splits(", *")'
input: '("ab,cd", "ef, gh")` input: '("ab,cd", "ef, gh")'
output: output: ['"ab"', '"cd"', '"ef"', '"gh"']
'"ab"'
'"cd"'
'"ef"'
'"gh"'
- title: "`sub(regex; tostring)`" - title: "`sub(regex; tostring)`"
body: | body: |
Emit the string obtained by replacing the first match of regex in the Emit the string obtained by replacing the first match of regex in the
@@ -1794,7 +1787,6 @@ sections:
- title: "`gsub(regex; string)`" - title: "`gsub(regex; string)`"
body: | body: |
`gsub` is like `sub` but all the non-overlapping occurrences of the regex are `gsub` is like `sub` but all the non-overlapping occurrences of the regex are
@@ -1802,7 +1794,6 @@ sections:
example: example:
- program: 'gsub("(?<x>.)[^a]*"; "+\(.x)-")' - program: 'gsub("(?<x>.)[^a]*"; "+\(.x)-")'
input: '"Abcabc"' input: '"Abcabc"'
output: '"+A-+a-"' output: '"+A-+a-"'