Skip to content

Commit 5374b4b

Browse files
authored
Fix inline code formatting in JEPs (#140)
1 parent cf8c6df commit 5374b4b

7 files changed

+27
-27
lines changed

jep-001-nested-expressions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Given:
5959
}
6060
```
6161

62-
With: `foo.[baz[\*].bar, qux[0]]`
62+
With: `foo.[baz[*].bar, qux[0]]`
6363

6464
Result:
6565

@@ -96,7 +96,7 @@ Given:
9696
}
9797
```
9898

99-
With: `foo.[baz[\*].[bar, boo], qux[0]]`
99+
With: `foo.[baz[*].[bar, boo], qux[0]]`
100100

101101
Result:
102102

@@ -139,7 +139,7 @@ Given:
139139
}
140140
```
141141

142-
With: `foo.[baz[\*].not_there || baz[\*].bar, qux[0]]`
142+
With: `foo.[baz[*].not_there || baz[*].bar, qux[0]]`
143143

144144
Result:
145145

jep-003-functions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ the string contains the provided `$search` argument.
338338
| n/a | ``contains(`false`, `bar`)`` | `<error: invalid-type>`
339339
| n/a | ``contains(`foobar`, 123)`` | `false`
340340
| `["a", "b"]` | ``contains(@, `a`)`` | `true`
341-
| `["a"]` | ``contains(@, `a\`)`` | `true`
342-
| `["a"]` | ``contains(@, `b\`)`` | `false`
341+
| `["a"]` | ``contains(@, `a`)`` | `true`
342+
| `["a"]` | ``contains(@, `b`)`` | `false`
343343

344344
### floor
345345

@@ -353,9 +353,9 @@ Returns the next lowest integer value by rounding down if necessary.
353353

354354
| Expression | Result
355355
|---|---
356-
| ``floor(`1.001\`)`` | 1
357-
| ``floor(`1.9\`)`` | 1
358-
| ``floor(`1\`)`` | 1
356+
| ``floor(`1.001`)`` | 1
357+
| ``floor(`1.9`)`` | 1
358+
| ``floor(`1`)`` | 1
359359

360360
### join
361361

jep-006-improved-identifiers.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ in XML (`&#nnnn`), JMESPath should support the same escape sequences
7979
used in JSON. JSON also supports a 12 character escape sequence for
8080
characters outside of the BMP, by encoding the UTF-16 surrogate pair.
8181
For example, the code point `U+1D11E` can be represented
82-
as `"\\uD834\\uDD1E"`.
82+
as `"\uD834\uDD1E"`.
8383

8484
### Escape Sequences
8585

@@ -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
@@ -226,11 +226,11 @@ This has to do with the updated escaping rules. Each one will be explained.
226226
},
227227
```
228228

229-
This has to be updated because a JSON parser will interpret the `\\n` sequence
229+
This has to be updated because a JSON parser will interpret the `\n` sequence
230230
as the newline character. The newline character is **not** allowed in a
231231
JMESPath identifier (note that the newline character `%0A` is not in any
232232
rule). In order for a JSON parser to create a sequence of `%x5C %x6E`, the
233-
JSON string must be `\\\\n` (`%x5C %x5C %x6E`).
233+
JSON string must be `\\n` (`%x5C %x5C %x6E`).
234234

235235
```
236236
- "expression": "\"c:\\\\windows\\path\"",
@@ -243,7 +243,7 @@ The above example is a more pathological case of escaping. In this example, we
243243
have a string that represents a windows path “c:\\windowpath”. 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
249-
look for a key named `c:\\\\windows\\path`.
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
249+
look for a key named `c:\\windows\path`.

jep-007-filter-expressions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Using the previous example, given the following data:
174174
{"state": "CA", "value": 4}]}
175175
```
176176

177-
The expression `foo[?state == \`WA\`]` will return the following value:
177+
The expression ``foo[?state == `WA`]`` will return the following value:
178178

179179
```
180180
[{"state": "WA", "value": 1}]
@@ -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

@@ -262,7 +262,7 @@ list with a single integer value of 2: `[foo == [2]]`.
262262

263263
* Adding literal expressions makes them useful even outside of a filter
264264
expression. For example, in a `multi-select-hash`, you can create
265-
arbitrary key value pairs: `{a: foo.bar, b: \`some string\`}`.
265+
arbitrary key value pairs: ``{a: foo.bar, b: `some string`}``.
266266

267267
This JEP is purposefully minimal. There are several extensions that can be
268268
added in future:

jep-010-slice-projections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This JEP proposes that a slice expression will create a projection.
2828

2929
A reasonable objection to this JEP is that this is unnecessary because, as
3030
shown in the example above, you can take any slice and create a projection via
31-
`[\*]`. This is entirely true, unlike other JEPs, this JEP does not enable
31+
`[*]`. This is entirely true, unlike other JEPs, this JEP does not enable
3232
any behavior that was previously not possible.
3333

3434
Instead, the main reason for this JEP is for consistency. Right now there are

jep-011-let-function.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Here we have nested let calls, and the expression we are trying to
174174
evaluate is the multiselect hash `{a: a, b: b, c: c}`. The
175175
`c` identifier comes from the evaluation context `{"c": "z"}`.
176176
The `b` identifier comes from the scope object in the second `let`
177-
call: `{b: \`y\`}`. And finally, here’s the lookup process for the
177+
call: ``{b: `y`}``. And finally, here’s the lookup process for the
178178
`a` identifier:
179179

180180

@@ -187,7 +187,7 @@ call: `{b: \`y\`}`. And finally, here’s the lookup process for the
187187
* Is there a parent scope? Yes
188188

189189

190-
* Does the parent scope, `{a: \`x\`}`, define `a`? Yes, `a` has
190+
* Does the parent scope, ``{a: `x`}``, define `a`? Yes, `a` has
191191
the value of `"x"`, so `a` is resolved as the string `"x"`.
192192

193193
### Current Node Evaluation

jep-012-raw-string-literals.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Raw string literals are provided in [various programming languages](https://en.w
3636
language specific interpretation (i.e., JSON parsing) and remove the need for
3737
escaping, avoiding a common problem called [leaning toothpick syndrome (LTS)](https://en.wikipedia.org/wiki/Leaning_toothpick_syndrome). Leaning toothpick
3838
syndrome is an issue in which strings become unreadable due to excessive use of
39-
escape characters in order to avoid delimiter collision (e.g., `\\\\\\\\\\\\`).
39+
escape characters in order to avoid delimiter collision (e.g., `\\\\\\`).
4040

4141
When evaluating a JMESPath expression, it is often necessary to utilize string
4242
literals that are not extracted from the data being evaluated, but rather
@@ -64,7 +64,7 @@ These string literals are parsed using a JSON parser according to
6464
escape sequences, newline characters, and several other escape sequences
6565
documented in RFC 4627 section 2.5.
6666

67-
For example, the use of an escaped unicode value `\\u002B` is expanded into
67+
For example, the use of an escaped unicode value `\u002B` is expanded into
6868
`+` in the following JMESPath expression:
6969

7070
```
@@ -89,7 +89,7 @@ problems:
8989
2. Requires the cognitive overhead of escaping escape characters if you
9090
actually want the data to be represented as it was literally provided
9191
(which can lead to LTS). If the data being escaped was meant to be used
92-
along with another language that uses `\\` as an escape character, then the
92+
along with another language that uses `\` as an escape character, then the
9393
number of backslash characters doubles.
9494

9595

@@ -233,7 +233,7 @@ bar!
233233

234234

235235
* A raw string literal that contains escape characters,
236-
parsed as `foo\\nbar`:
236+
parsed as `foo\nbar`:
237237

238238
```
239239
foo\nbar

0 commit comments

Comments
 (0)