]> dreyeck.freedombox.rocks Git - topic-maps.git/blob - docs/slice-20g-triple-strings.md
feat(ctm): decode ISO-8859-5 with qualified charset aliases
[topic-maps.git] / docs / slice-20g-triple-strings.md
1 # Slice 20G: Triple-Quoted Strings
2
3 CTM 3.4.1 [37]/[39]/[40] and 3.4.2 [41]-[43] define the delimiters and shared
4 String escapes: https://www.isotopicmaps.org/ctm/ctm.html .
5 The pinned corpus retains its historical 2010-03-31 draft qualification.
6
7 Only src/ctm/lexer.lisp changes production behavior. next-token consumes the
8 first quote, and read-ctm-string detects and consumes two more opening quotes.
9 In Triple mode, one or two raw quotes are content; three consecutive raw
10 quotes close the token. Escaped quotes and quotes produced by Unicode escapes
11 remain content. The lexer consumes exactly the three closing quotes, leaving
12 any extra characters for the existing token/parser diagnostics. There is no
13 dedenting, whitespace trimming, line-ending conversion or new Unicode policy.
14
15 The same existing escape branch handles backslash, quote, n/r/t, four-digit
16 lowercase-u and six-digit uppercase-U escapes, including scalar validation.
17 Missing delimiters use ctm-rejection / unterminated-string at the opening
18 quote. Invalid escapes retain the existing error codes and character positions.
19 Occurrences, Names, Variants, qualified literals and existing Template
20 arguments/body strings already consume the same String token. Neither Reader
21 operations, TMDM/CXTM nor the Template grammar require changes.
22
23 The new ASDF test stage runs unconditionally after Slice 20F. It reuses the
24 Slice 20A exercise-case function and the same discovered Case Records for
25 exactly four originals: occurrence-string-triple, occurrence-string-triple2,
26 unicode-escape-u4-triple-string and unicode-escape-u6-triple-string.
27 Their baselines contain 367, 370, 331 and 331 bytes. Each actual Original
28 comparison is accompanied by a separately parsed ordinary-string control,
29 plus explicit model properties, stable Document IRI, raw map/handle state
30 and source immutability checks.
31
32 Counterprobes cover empty strings, quote runs, escaped terminal quotes,
33 Unicode, LF/CR/CRLF, whitespace and syntax-looking content in all three
34 value contexts. CR fixtures construct Return explicitly so source editing
35 cannot normalize them. Other controls cover typed values, the existing
36 Template String path, exact closing-token boundaries, malformed/unclosed
37 Triple Strings and unchanged ordinary-string diagnostics captured before
38 implementation in a fresh offline SBCL.
39
40 Only obsolete Unsupported assertions are updated in retained tests: the
41 identity and existing Template String paths now assert their actual Name
42 values; the prolog and CTM-integer boundary controls now reject unclosed
43 Triple Strings. Regenerated reports allow only these named label/control
44 substitutions. All archived report bytes remain unchanged.
45
46 Reproduce with an existing SBCL 2.5.4 and a new output directory:
47
48 python3 scripts/validate-slice-20g.py --sbcl /absolute/path/to/sbcl --output /private/tmp/new-slice-20g-report
49
50 The committed preimplementation.json is the default diagnostic reference.
51 For the initial run, pass --preimplementation with the pre-change capture.
52 The validator uses verified local Store sources and unchanged XML patches
53 without downloads. Fresh SBCL processes have network denied. The complete
54 suite covers TMDM, CTM/CXTM, Include, XML qualification, standalone XTM,
55 CTM/XTM Mergemap, prior Slice 20 stages, Python tests and the NFC oracle.
56 Every pinned source/baseline and every historical report hash is rechecked.
57 execution.json records observed results; current.triple.json stores controls
58 and Conditions, current.cxtm.json actual/baseline streams and
59 current.validation.json the final shared Case Records.
60
61 The normal tool sandbox previously failed on the writable-root symlink
62 /Users/rgb/.nix-profile. Regular require_escalated approval is used without
63 changing that symlink or the sandbox configuration. No persistent Lisp image,
64 HyperDoc content, original source, baseline, push or deployment is involved.