Skip to content

Commit e48c9f2

Browse files
authored
Fix typos in JEPs (#141)
1 parent 5374b4b commit e48c9f2

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

jep-003-functions.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ data of `["1", "2", "3", "notanumber", true]`, the following expression can
138138
be used to convert (and filter) all elements to numbers:
139139

140140
```
141-
search([].to_number(@), ``["1", "2", "3", "notanumber", true]``) -> [1, 2, 3]
141+
search([].to_number(@), ["1", "2", "3", "notanumber", true]) -> [1, 2, 3]
142142
```
143143

144144
This provides a simple mechanism to explicitly convert types when needed.
@@ -270,13 +270,14 @@ abs(2) -> 2
270270
5. The value of `2` is the resolved value of the function expression
271271
`abs(to_number(bar))`.
272272

273-
### Examples
273+
#### Examples
274274

275275
|Expression|Result
276276
|---|---
277277
| `abs(1)` |1
278278
| `abs(-1)`|1
279279
| ``abs(`abc`)``| |`<error: invalid-type>`
280+
280281
### avg
281282

282283
```
@@ -287,7 +288,7 @@ Returns the average of the elements in the provided array.
287288

288289
An empty array will produce a return value of null.
289290

290-
### Examples
291+
#### Examples
291292

292293
|Given|Expression|Result
293294
|---|---|---
@@ -304,7 +305,7 @@ number ceil(number $value)
304305

305306
Returns the next highest integer value by rounding up if necessary.
306307

307-
### Examples
308+
#### Examples
308309

309310
|Expression|Result
310311
|---|---|
@@ -313,7 +314,7 @@ Returns the next highest integer value by rounding up if necessary.
313314
| ``ceil(`1`)`` | 1
314315
| ``ceil(`abc`)`` | `null`
315316

316-
| ### contains
317+
### contains
317318

318319
```
319320
boolean contains(array|string $subject, array|object|string|number|boolean $search)
@@ -328,7 +329,7 @@ in the array is equal to the provided `$search` value.
328329
If the provided `$subject` is a string, this function returns true if
329330
the string contains the provided `$search` argument.
330331

331-
### Examples
332+
#### Examples
332333

333334
|Given|Expression|Result
334335
|---|---|---
@@ -349,7 +350,7 @@ number floor(number $value)
349350

350351
Returns the next lowest integer value by rounding down if necessary.
351352

352-
### Examples
353+
#### Examples
353354

354355
| Expression | Result
355356
|---|---
@@ -366,7 +367,7 @@ string join(string $glue, array[string] $stringsarray)
366367
Returns all of the elements from the provided `$stringsarray` array joined
367368
together using the `$glue` argument as a separator between each.
368369

369-
### Examples
370+
#### Examples
370371

371372
| Given | Expression | Result
372373
|---|---|---
@@ -383,7 +384,7 @@ array keys(object $obj)
383384

384385
Returns an array containing the keys of the provided object.
385386

386-
### Examples
387+
#### Examples
387388

388389
| Given | Expression | Result
389390
|---|---|---
@@ -409,7 +410,7 @@ Returns the length of the given argument using the following types rules:
409410

410411
3. object: returns the number of key-value pairs in the object
411412

412-
### Examples
413+
#### Examples
413414

414415
| Given | Expression | Result
415416
|---|---|---
@@ -431,7 +432,7 @@ Returns the highest found number in the provided array argument.
431432

432433
An empty array will produce a return value of null.
433434

434-
### Examples
435+
#### Examples
435436

436437
| Given | Expression | Result
437438
|---|---|---
@@ -446,12 +447,13 @@ number min(array[number] $collection)
446447

447448
Returns the lowest found number in the provided `$collection` argument.
448449

449-
### Examples
450+
#### Examples
450451

451452
| Given | Expression | Result
452453
|---|--|--
453454
| `[10, 15]` | `min(@)` | 10
454455
| `[10, false, 20]` | `min(@)` | `<error: invalid-type>`
456+
455457
### sort
456458

457459
```
@@ -464,7 +466,7 @@ elements of the `$list` as an array.
464466
The array must be a list of strings or numbers. Sorting strings is based on
465467
code points. Locale is not taken into account.
466468

467-
### Examples
469+
#### Examples
468470

469471
| Given | Expression | Result
470472
|---|---|---
@@ -489,7 +491,7 @@ string to_string(string|number|array|object|boolean $arg)
489491
JSON encoder should emit the encoded JSON value without adding any additional
490492
new lines.
491493

492-
### Examples
494+
#### Examples
493495

494496
| Given | Expression | Result
495497
|---|---|---
@@ -527,7 +529,7 @@ The return value MUST be one of the following:
527529
* object
528530
* null
529531

530-
### Examples
532+
#### Examples
531533

532534
| Given | Expression | Result
533535
|---|---|---
@@ -548,13 +550,14 @@ array values(object $obj)
548550

549551
Returns the values of the provided object.
550552

551-
### Examples
553+
#### Examples
552554

553555
| Given | Expression | Result
554556
|---|---|---
555557
| `{"foo": "baz", "bar": "bam"}` | `values(@)` | `["baz", "bam"]`
556558
| `["a", "b"]` | `values(@)` | `<error: invalid-type>`
557559
| `false` | `values(@)` | `<error: invalid-type>`
560+
558561
## Compliance Tests
559562

560563
A `functions.json` will be added to the compliance test suite.

jep-006-improved-identifiers.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ in certain environments. For example, in python, this is not a problem:
9898
>>> jmespath_expression = "foo\nbar"
9999
```
100100

101-
Python will interpret the sequence `"\n"` (`%x5C %x6E`) as the newline
101+
Python will interpret the sequence `\n` (`%x5C %x6E`) as the newline
102102
character `%x0A`. However, consider Bash:
103103

104104
```
105105
$ foo --jmespath-expression "foo\nbar"
106106
```
107107

108-
In this situation, bash will not interpret the `"\n"` (`%x5C %x6E`)
108+
In this situation, bash will not interpret the `\n` (`%x5C %x6E`)
109109
sequence.
110110

111111
## Specification
@@ -240,10 +240,10 @@ JSON string must be `\\n` (`%x5C %x5C %x6E`).
240240
```
241241

242242
The above example is a more pathological case of escaping. In this example, we
243-
have a string that represents a windows path “c:\\windowpath”. There are two
243+
have a string that represents a windows path “c:\\\\windows\\path”. There are two
244244
levels of escaping happening here, one at the JSON parser, and one at the
245245
JMESPath parser. The JSON parser will take the sequence
246-
`"\"c:\\\\\\\\windows\\\\path\""` and create the string
247-
`"\"c:\\\\windows\\path\""`. The JMESPath parser will take the string
248-
`"\"c:\\\\windows\\path\"'` and, applying its own escaping rules, will
246+
`"\"c:\\\\\\\\windows\\\\path\""` and create a string with contents
247+
`"c:\\\\windows\\path"` (in which the first and last character are both `"`).
248+
The JMESPath parser will take that and, applying its own unescaping, will
249249
look for a key named `c:\\windows\path`.

jep-007-filter-expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ The expression ``foo[?state == `WA`]`` will return the following value:
184184

185185
Literal expressions are also added in the JEP, which is essentially a JSON
186186
value surrounded by the “\`” character. You can escape the “\`” character via
187-
\\`”, and if the character “\`” appears in the JSON value, it must also be
187+
\\\`”, and if the character “\`” appears in the JSON value, it must also be
188188
escaped. A simple two pass algorithm in the lexer could first process any
189189
escaped “\`” characters before handing the resulting string to a JSON parser.
190190

jep-012-raw-string-literals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ bar!
236236
parsed as `foo\nbar`:
237237

238238
```
239-
foo\nbar
239+
'foo\nbar'
240240
```
241241

242242
### ABNF

0 commit comments

Comments
 (0)