docs(tools): name both raw routes, complete the evaluation-floor list
The previous commit's `UNPRINTABLE` sentence said the raw-reach point for all three characters is `pyScalar`'s `JSON.stringify`, and the test comment said that route is the only one. Both are exclusive claims and both are false: the subscript tool-name comment calls `JSON.stringify` itself, and a tool name carrying NEL, LS, or PS always lands there, none of the three being `XID_Continue`. `pyScalar`'s own docstring already recorded that inheritance, so the file contradicted itself. Both sentences now name the two call sites. The note's evaluation axis was introduced as "the `typing` names the block spells", which excludes one of its own members (`A | B` is operator syntax) and omitted PEP 585 builtin generics — `dict[str, Any]` and `list[…]` appear in nearly every render and need 3.9. The axis is now "the names and syntax the block would evaluate at definition time", enumerated 3.8 through 3.11. The test title covered two of the three characters it asserts; NEL is NEXT LINE, neither a line nor a paragraph separator.
This commit is contained in:
@@ -67,7 +67,7 @@ describe('jsonSchemaToPy', () => {
|
||||
expect(jsonSchemaToPy({ type: 'string', const: 'ends\\' })).toBe(String.raw`Literal["ends\\"]`)
|
||||
})
|
||||
|
||||
it('passes the line and paragraph separators through raw, which CPython does not treat as line terminators', () => {
|
||||
it('passes NEL and the line/paragraph separators through raw, which CPython does not treat as line terminators', () => {
|
||||
// `JSON.stringify` escapes LF and CR but not NEL (U+0085), LS (U+2028), or
|
||||
// PS (U+2029), which is safe here and not by accident: those three are
|
||||
// `str.splitlines()` boundaries, not tokenizer line terminators, so they
|
||||
@@ -78,8 +78,9 @@ describe('jsonSchemaToPy', () => {
|
||||
// same bytes, and none of the three has a visible width.
|
||||
expect(jsonSchemaToPy({ type: 'string', const: 'a\u2028b' })).toBe('Literal["a\u2028b"]')
|
||||
expect(jsonSchemaToPy({ type: 'string', enum: ['a\u2029b'] })).toBe('Literal["a\u2029b"]')
|
||||
// NEL is inside `UNPRINTABLE`'s class, so the description path escapes it;
|
||||
// this is the one route that carries it raw.
|
||||
// NEL is inside `UNPRINTABLE`'s class, so the description path escapes it.
|
||||
// This is one of the two routes that carry it raw; the other is the
|
||||
// subscript tool-name comment's own `JSON.stringify` call.
|
||||
expect(jsonSchemaToPy({ type: 'string', const: 'a\u0085b' })).toBe('Literal["a\u0085b"]')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user