Fix manual source code to follow the schema definition

This commit is contained in:
itchyny authored and Nico Williams committed 2023-07-22 19:00:16 -05:00
1 parent 9044f540bb
commit 34629ed223
5 files changed
+108 -125

No files matched your search

+19 -22
View File
@@ -404,7 +404,7 @@ sections:
examples:
- program: '.foo'
input: '{"foo": 42, "bar": "less interesting data"}'
output: [42]
output: ['42']
- program: '.foo'
input: '{"notfoo": true, "alsonotfoo": false}'
@@ -412,7 +412,7 @@ sections:
- program: '.["foo"]'
input: '{"foo": 42}'
output: [42]
output: ['42']
- title: "Optional Object Identifier-Index: `.foo?`"
body: |
@@ -423,13 +423,13 @@ sections:
examples:
- program: '.foo?'
input: '{"foo": 42, "bar": "less interesting data"}'
output: [42]
output: ['42']
- program: '.foo?'
input: '{"notfoo": true, "alsonotfoo": false}'
output: ['null']
- program: '.["foo"]?'
input: '{"foo": 42}'
output: [42]
output: ['42']
- program: '[.foo?]'
input: '[1,2]'
output: ['[]']
@@ -583,7 +583,7 @@ sections:
examples:
- program: '(. + 2) * 5'
input: '1'
output: [15]
output: ['15']
- title: Types and Values
body: |
@@ -825,8 +825,8 @@ sections:
examples:
- program: '10 / . * 3'
input: 5
output: [6]
input: '5'
output: ['6']
- program: '. / ", "'
input: '"a, b,c,d, e"'
output: ['["a","b,c,d","e"]']
@@ -861,7 +861,7 @@ sections:
examples:
- program: '.[] | length'
input: '[[1,2], "string", {"a":2}, null, -5]'
output: [2, 6, 1, 0, 5]
output: ['2', '6', '1', '0', '5']
- title: "`utf8bytelength`"
@@ -873,7 +873,7 @@ sections:
examples:
- program: 'utf8bytelength'
input: '"\u03bc"'
output: [2]
output: ['2']
- title: "`keys`, `keys_unsorted`"
body: |
@@ -1175,7 +1175,7 @@ sections:
examples:
- program: '1, empty, 2'
input: 'null'
output: [1, 2]
output: ['1', '2']
- program: '[1,2,empty,3]'
input: 'null'
output: ['[1,2,3]']
@@ -1253,7 +1253,7 @@ sections:
output: ['"abc"']
- program: add
input: '[1, 2, 3]'
output: [6]
output: ['6']
- program: add
input: '[]'
output: ["null"]
@@ -1402,7 +1402,7 @@ sections:
examples:
- program: '.[] | tonumber'
input: '[1, "1"]'
output: [1, 1]
output: ['1', '1']
- title: "`tostring`"
body: |
@@ -1867,11 +1867,8 @@ sections:
- '1'
- program: 'recurse(. * .; . < 20)'
input: 2
output:
- 2
- 4
- 16
input: '2'
output: ['2', '4', '16']
- title: "`walk(f)`"
body: |
@@ -2258,7 +2255,7 @@ sections:
else
"many"
end
input: 2
input: '2'
output: ['"many"']
- title: "`>`, `>=`, `<=`, `<`"
@@ -2273,7 +2270,7 @@ sections:
examples:
- program: '. < 5'
input: 2
input: '2'
output: ['true']
- title: "`and`, `or`, `not`"
@@ -2329,10 +2326,10 @@ sections:
examples:
- program: '.foo // 42'
input: '{"foo": 19}'
output: [19]
output: ['19']
- program: '.foo // 42'
input: '{}'
output: [42]
output: ['42']
- title: try-catch
body: |
@@ -2510,7 +2507,7 @@ sections:
- program: '[ match("."; "g")] | length'
input: '"abc"'
output: [3]
output: ['3']
- title: "`capture(val)`, `capture(regex; flags)`"