Skip to content
Topazdocs

Search documentation

Specification 6.0

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Download →

    Design decisions

    Standard library

    Host reads, closes and writes have separate runtime faults

    Adopted November 8, 2026 · 6.0.0 · In progress

    Problem

    A failure while consuming bytes differs from failing to release a resource or deliver output. Callers need to identify the failed operation.

    Decision

    Use TPZ4008 for input, TPZ4009 for close and TPZ4010 for output at runtime. Each code has its own operation cause.

    Alternatives considered

    • Use one host I/O code with different causes. The code alone would not identify the failed operation.

    Why

    The diagnostic identity indicates which operation failed.

    Changed rules Host write failures →

    Resolved pending items Host-write fault identity →

    WriteLine returns unit and reports host write failure as a runtime fault

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    The output destination can refuse a write. The language needs to state both what the call returns and how failure is reported.

    Decision

    Keep the unit signature of std.io.writeLine. A host write failure produces a structured runtime fault.

    Examples

    A successful write has a Unit result

    write-line-unit-result.tpzA successful write has a Unit resultOpen in Playground →
    1. import std.io
    2. let result: () = io.writeLine("hello")
    Expected outputExit code 0
    No stdout.
    $ topaz check write-line-unit-result.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    A write result cannot use Result propagation

    write-line-not-result.tpzA write result cannot use Result propagationOpen in Playground →
    1. import std.io
    2. function greeting() -> Result<(), string> {
    3. io.writeLine("hello")?
    4. Ok(())
    5. }
    Expected outputNonzero exit
    No stdout.
    $ topaz check write-line-not-result.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5001 →

      result-required-for-propagation at write-line-not-result.tpz:4:3

    Alternatives considered

    • Return Result from output calls. Existing callers would have to handle a different return type.
    • Let the host decide how the program ends. Topaz must define how a host write failure is observed.

    Why

    The call retains its signature and the host failure is visible to Topaz.

    Changed rules Host write failures →writeLine contract →

    Resolved pending items Output boundaries and failures →

    A host output fault points to the failed write call

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Lumping an output failure together with an unrelated runtime fault makes the cause hard to identify. Multiple writes also need a location that identifies the one that failed.

    Decision

    Use a dedicated runtime fault for a host write failure in writeLine and point its diagnostic at that call.

    Alternatives considered

    • Broaden an existing runtime fault to cover output failure. The diagnostic would not distinguish a host write from the other operation.

    Why

    The fault identifies both the operation and the failed call.

    Changed rules Host write failures →

    Partly answered pending items Host-write fault identity →

    Collection length, keys and values are properties

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Reading the same information can require parentheses for one collection and property access for another. That complicates moving the lookup.

    Decision

    Use properties for length, keys and values on collections.

    Examples

    Read the same properties on core collections

    main.tpzRead the same properties on core collectionsOpen in Playground →
    1. import std.io
    2. let array = [2, 3]
    3. let entries = map { "name": "Topaz" }
    4. let values = set { 2, 3 }
    5. io.writeLine("{array.length}:{entries.length}:{values.length}")
    6. io.writeLine(entries.keys[0])
    7. io.writeLine(entries.values[0])
    Expected outputExit code 0
    2:1:2
    name
    Topaz
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2:1:2
    2. name
    3. Topaz

    Read a byte sequence size

    main.tpzRead a byte sequence size
    1. import std.bytes { Bytes }
    2. import std.io
    3. let bytes = Bytes.empty()
    4. let size: int = bytes.length
    5. io.writeLine("{size}")
    Expected outputExit code 0
    0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0

    Read JSON object keys

    main.tpzRead JSON object keys
    1. import std.json
    2. import std.test
    3. import std.io
    4. let object = test.assertOk(json.parse("\{\"name\":\"Topaz\"\}"))
    5. let array = test.assertOk(json.parse("[]"))
    6. let scalar = test.assertOk(json.parse("42"))
    7. let names: Option<Array<string>> = object.keys
    8. test.assertEq(test.assertSome(names)[0], "name")
    9. test.assertNone(array.keys)
    10. test.assertNone(scalar.keys)
    11. io.writeLine("JSON keys read")
    Expected outputExit code 0
    JSON keys read
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. JSON keys read

    Alternatives considered

    • Keep a mixture of methods and properties. The same observation would use different syntax across collections.

    Why

    Collection information has a consistent access style.

    Changed rules Read collection sizes, keys, and values as properties →

    An empty collection has length zero

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Reading the length and using an emptiness accessor could express the same state twice. The condition can be written directly.

    Decision

    Test emptiness with length == 0. Remove isEmpty from Bytes, Map and Set.

    Examples

    Length zero identifies empty bytes, maps, and sets

    main.tpzLength zero identifies empty bytes, maps, and sets
    1. import std.io
    2. let values: Map<string, int> = map {}
    3. let names: Set<string> = set {}
    4. io.writeLine("{("".encodeUtf8()).length == 0}")
    5. io.writeLine("{values.length == 0}")
    6. io.writeLine("{names.length == 0}")
    7. io.writeLine("{("ink".encodeUtf8()).length == 0}")
    Expected outputExit code 0
    true
    true
    true
    false
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true
    2. true
    3. true
    4. false

    Alternatives considered

    • Keep isEmpty. There would remain two ways to test whether length is zero.

    Why

    The code states its emptiness condition directly in terms of length.

    Changed rules Read collection sizes, keys, and values as properties →

    An out-of-bounds byte slice fails at runtime

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A boundary past the end can return a shorter slice that looks valid. The caller then cannot see the indexing mistake.

    Decision

    A byte slice excludes its end and requires 0 <= start <= end <= length. Invalid bounds produce TPZ4001 at runtime.

    Examples

    Select empty and nonempty intervals

    main.tpzSelect empty and nonempty intervalsOpen in Playground →
    1. import std.io
    2. let value = "abcd".encodeUtf8()
    3. io.writeLine(value.slice(0, 0).toHex())
    4. io.writeLine(value.slice(1, 3).toHex())
    5. io.writeLine(value.slice(4, 4).toHex())
    6. io.writeLine(value.toHex())
    Expected outputExit code 0
    
    6263
    
    61626364
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 6263
    2. 61626364

    Reject a negative slice start

    main.tpzReject a negative slice startOpen in Playground →
    1. import std.bytes { Bytes }
    2. let value = "abcd".encodeUtf8()
    3. value.slice(-1, 2)
    Expected outputNonzero exit
    No stdout.
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    Reject an inverted byte interval

    main.tpzReject an inverted byte intervalOpen in Playground →
    1. import std.bytes { Bytes }
    2. let value = "abcd".encodeUtf8()
    3. value.slice(3, 2)
    Expected outputNonzero exit
    No stdout.
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    Reject an endpoint beyond the sequence

    main.tpzReject an endpoint beyond the sequenceOpen in Playground →
    1. import std.bytes { Bytes }
    2. let value = "abcd".encodeUtf8()
    3. value.slice(0, 5)
    Expected outputNonzero exit
    No stdout.
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    Alternatives considered

    • Clamp the requested bounds to the input. An index error would silently select a different valid range.

    Why

    Either the requested slice is returned or its bad bounds are reported.

    Changed rules Select explicit byte intervals →

    Hex byte input uses lowercase pairs

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Multiple spellings of a byte make it harder to check input follows its expected format. Prefixes and spaces also need a clear rule.

    Decision

    Read each byte as two lowercase hexadecimal digits. Reject uppercase, prefixes, separators and whitespace.

    Examples

    Decode byte pairs and emit lowercase text

    main.tpzDecode byte pairs and emit lowercase textOpen in Playground →
    1. import std.bytes { Bytes }
    2. import std.io
    3. import std.test
    4. io.writeLine(test.assertOk(Bytes.fromHex("")).toHex())
    5. io.writeLine(test.assertOk(Bytes.fromHex("000f80ff")).toHex())
    Expected outputExit code 0
    
    000f80ff
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 000f80ff

    Reject malformed hexadecimal strings

    main.tpzReject malformed hexadecimal stringsOpen in Playground →
    1. import std.bytes { Bytes }
    2. import std.io
    3. for text in (["0", "gg", "0x00", "00 11", "00"]) {
    4. match (Bytes.fromHex(text)) {
    5. case Err(_) => io.writeLine("invalid hex")
    6. case Ok(_) => io.writeLine("accepted")
    7. }
    8. }
    Expected outputExit code 0
    invalid hex
    invalid hex
    invalid hex
    invalid hex
    invalid hex
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. invalid hex
    2. invalid hex
    3. invalid hex
    4. invalid hex
    5. invalid hex

    Reject uppercase hexadecimal input

    main.tpzReject uppercase hexadecimal inputOpen in Playground →
    1. import std.bytes { Bytes }
    2. import std.io
    3. match (Bytes.fromHex("CAfe")) {
    4. case Err(_) => io.writeLine("uppercase rejected")
    5. case Ok(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    uppercase rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. uppercase rejected

    Alternatives considered

    • Accept either letter case. The same byte would have more than one spelling.

    Why

    Input can be checked against the same format used for hex output.

    Changed rules Use a canonical hexadecimal spelling →

    Decompression consumes one complete stream

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Valid compressed data can be followed by another frame or by stray bytes. A successful partial decode would leave the caller unaware of the rest.

    Decision

    • Consume a single complete stream, frame, or member as defined by the format.
    • Reject additional frames and trailing bytes.

    Examples

    Reject truncated streams and trailing bytes

    main.tpzReject truncated streams and trailing bytesOpen in Playground →
    1. import std.bytes { Bytes }
    2. import std.io
    3. import std.test
    4. for hex in (["", "010100feff", "010000ffff00", "070000"]) {
    5. match (test.assertOk(Bytes.fromHex(hex)).deflateDecompress()) {
    6. case Err(_) => io.writeLine("invalid DEFLATE")
    7. case Ok(_) => io.writeLine("accepted")
    8. }
    9. }
    Expected outputExit code 0
    invalid DEFLATE
    invalid DEFLATE
    invalid DEFLATE
    invalid DEFLATE
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. invalid DEFLATE
    2. invalid DEFLATE
    3. invalid DEFLATE
    4. invalid DEFLATE

    Reject a truncated member and an invalid checksum

    main.tpzReject a truncated member and an invalid checksumOpen in Playground →
    1. import std.bytes { Bytes }
    2. import std.io
    3. import std.test
    4. for hex in (["1f8b0800", "1f8b08000000000000ff010500faff68656c6c6f87a6103605000000"]) {
    5. match (test.assertOk(Bytes.fromHex(hex)).gzipDecompress()) {
    6. case Err(_) => io.writeLine("invalid gzip")
    7. case Ok(_) => io.writeLine("accepted")
    8. }
    9. }
    Expected outputExit code 0
    invalid gzip
    invalid gzip
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. invalid gzip
    2. invalid gzip

    Reject missing block data and trailing bytes

    main.tpzReject missing block data and trailing bytesOpen in Playground →
    1. import std.bytes { Bytes }
    2. import std.io
    3. import std.test
    4. for hex in (["", "28b52ffd20052900006869", "28b52ffd200001000000"]) {
    5. match (test.assertOk(Bytes.fromHex(hex)).zstdDecompress()) {
    6. case Err(_) => io.writeLine("invalid Zstandard")
    7. case Ok(_) => io.writeLine("accepted")
    8. }
    9. }
    Expected outputExit code 0
    invalid Zstandard
    invalid Zstandard
    invalid Zstandard
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. invalid Zstandard
    2. invalid Zstandard
    3. invalid Zstandard

    Alternatives considered

    • Chain multiple frames or ignore trailing bytes. One call would either accept a different input boundary or leave part of the input unchecked.

    Why

    Successful decompression confirms that the whole input was one compressed unit.

    Changed rules Distinguish raw DEFLATE from zlib framing →Read and write complete gzip members →Use Zstandard frames and explicit effort levels →

    Decompression accepts an output byte limit

    Adopted November 16, 2026 · 6.0.0 · Being verified

    Problem

    Even a small compressed input can expand into a large output. The amount a caller can handle depends on the program.

    Decision

    • Decompression functions accept an optional maxBytes argument and return Err if the decoded size exceeds it.
    • Omitting the argument leaves the output size unlimited.

    Examples

    Gzip decoding honors a caller-specified output limit

    main.tpzGzip decoding honors a caller-specified output limit
    1. import std.io
    2. import std.test
    3. let encoded = test.assertOk("hello".encodeUtf8().gzipCompress())
    4. io.writeLine(test.assertOk(encoded.gzipDecompress(5)).toHex())
    5. match (encoded.gzipDecompress(4)) {
    6. case Err(_) => io.writeLine("limit exceeded")
    7. case Ok(_) => io.writeLine("accepted")
    8. }
    9. io.writeLine(test.assertOk(encoded.gzipDecompress()).toHex())
    Expected outputExit code 0
    68656c6c6f
    limit exceeded
    68656c6c6f
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 68656c6c6f
    2. limit exceeded
    3. 68656c6c6f

    Deflate and Zstandard honor an output byte limit

    main.tpzDeflate and Zstandard honor an output byte limit
    1. import std.io
    2. import std.test
    3. let data = "hello".encodeUtf8()
    4. let raw = test.assertOk(data.deflateCompress())
    5. let zstd = test.assertOk(data.zstdCompress())
    6. for outcome in ([raw.deflateDecompress(4), zstd.zstdDecompress(4)]) {
    7. let failed = match (outcome) {
    8. case Err(_) => true
    9. case Ok(_) => false
    10. }
    11. io.writeLine("{failed}")
    12. }
    Expected outputExit code 0
    true
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true
    2. true

    Alternatives considered

    • Apply one fixed limit everywhere. It could reject valid large inputs or be too high to stop hazardous ones.

    Why

    Callers can set a limit appropriate to their input and available capacity.

    Changed rules Read and write complete gzip members →Distinguish raw DEFLATE from zlib framing →Use Zstandard frames and explicit effort levels →

    Path operations use normalized lexical components

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A caller can ask for the parent of a single name or change an extension on a name ending in a dot. Joining also needs a rule for what counts as a child component.

    Decision

    • Operate on normalized lexical components. The parent of a single component is ..
    • A trailing dot gives an empty extension. A replacement extension starting with a dot is rejected.
    • Validate a child before joining it to a path.

    Examples

    Reject invalid child text before joining

    main.tpzReject invalid child text before joiningOpen in Playground →
    1. import std.path { Path }
    2. import std.test
    3. import std.io
    4. let base = test.assertOk(Path.from("chapters"))
    5. for child in (["", "/outside", "C:/outside", "../../outside"]) {
    6. match (base.join(child)) {
    7. case Err(_) => io.writeLine("rejected")
    8. case Ok(_) => io.writeLine("accepted")
    9. }
    10. }
    11. io.writeLine(base.toString())
    Expected outputExit code 0
    rejected
    rejected
    rejected
    rejected
    chapters
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. rejected
    2. rejected
    3. rejected
    4. rejected
    5. chapters

    Inspect the final component and the relative root

    main.tpzInspect the final component and the relative rootOpen in Playground →
    1. import std.path { Path }
    2. import std.test
    3. import std.io
    4. let file = test.assertOk(Path.from("chapters/main.tpz"))
    5. io.writeLine(test.assertSome(file.parent()).toString())
    6. io.writeLine(test.assertSome(file.fileName()))
    7. io.writeLine(test.assertSome(file.extension()))
    8. let root = test.assertOk(Path.from("."))
    9. test.assertNone(root.parent())
    10. test.assertNone(root.fileName())
    11. test.assertNone(root.extension())
    12. io.writeLine(root.toString())
    Expected outputExit code 0
    chapters
    main.tpz
    tpz
    .
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. chapters
    2. main.tpz
    3. tpz
    4. .

    Keep the relative root as the parent of one component

    main.tpzKeep the relative root as the parent of one componentOpen in Playground →
    1. import std.path { Path }
    2. import std.test
    3. import std.io
    4. let file = test.assertOk(Path.from("main.tpz"))
    5. match (file.parent()) {
    6. case Some(parent) => io.writeLine(parent.toString())
    7. case None() => io.writeLine("missing")
    8. }
    Expected outputExit code 0
    .
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. .

    Distinguish an absent extension from an empty extension

    main.tpzDistinguish an absent extension from an empty extensionOpen in Playground →
    1. import std.path { Path }
    2. import std.test
    3. import std.io
    4. for name in (["README", ".env", ".env.local", "archive.tar.gz", "trailing."]) {
    5. let file = test.assertOk(Path.from(name))
    6. match (file.extension()) {
    7. case Some(extension) => io.writeLine("present [{extension}]")
    8. case None() => io.writeLine("absent")
    9. }
    10. }
    Expected outputExit code 0
    absent
    absent
    present [local]
    present [gz]
    present []
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. absent
    2. absent
    3. present [local]
    4. present [gz]
    5. present []

    Reject a second suffix spelling and a path without a file name

    main.tpzReject a second suffix spelling and a path without a file nameOpen in Playground →
    1. import std.path { Path }
    2. import std.test
    3. import std.io
    4. let file = test.assertOk(Path.from("chapter.txt"))
    5. for extension in ([".pdf", "pdf/extra", "pdf\\extra"]) {
    6. match (file.withExtension(extension)) {
    7. case Err(_) => io.writeLine("rejected")
    8. case Ok(_) => io.writeLine("accepted")
    9. }
    10. }
    11. let root = test.assertOk(Path.from("."))
    12. match (root.withExtension("pdf")) {
    13. case Err(_) => io.writeLine("root rejected")
    14. case Ok(_) => io.writeLine("root accepted")
    15. }
    Expected outputExit code 0
    rejected
    rejected
    rejected
    root rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. rejected
    2. rejected
    3. rejected
    4. root rejected

    Why

    Path components have consistent behavior before any filesystem access.

    Changed rules Inspect and transform normalized paths →

    Regex escape names reserve ASCII letters and digits

    Adopted November 16, 2026 · 6.0.0 · In progress

    Problem

    If Unicode categories govern what follows a backslash, a Unicode update can change pattern syntax. Literal punctuation and other characters also need a rule.

    Decision

    • Reserve ASCII letters and digits after a backslash for escape names. Reject undefined names when compiling the regex.
    • Read any other scalar after a backslash as that literal character.

    Examples

    ASCII escape names and a literal Korean character

    main.tpzASCII escape names and a literal Korean characterOpen in Playground →
    1. import std.io
    2. import std.regex { Regex }
    3. match (Regex.compile("\\가")) {
    4. case Ok(pattern) => io.writeLine("{pattern.isMatch("가")}")
    5. case Err(_) => io.writeLine("compile failed")
    6. }
    7. match (Regex.compile("\\q")) {
    8. case Ok(_) => io.writeLine("accepted undefined escape")
    9. case Err(_) => io.writeLine("undefined escape")
    10. }
    Expected outputExit code 0
    true
    undefined escape
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true
    2. undefined escape

    Alternatives considered

    • Reserve letters and numbers across all of Unicode. A changed Unicode category could change the grammar of the same pattern.
    • Reject every non-ASCII escape. It avoids the Unicode version, but gains nothing beyond blocking a second spelling of the same letter.

    Why

    The escape namespace has a fixed boundary.

    Changed rules Compile the Unicode regular expression language →

    Named regex captures have one spelling

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A developer needs to know which group syntax creates a named capture. Case-insensitive matching also needs a consistent Unicode rule.

    Decision

    • Use Unicode 16.0 regex syntax with simple case folding.
    • Write a named capture as (?<name>pattern).

    Examples

    Use one named capture spelling

    main.tpzUse one named capture spellingOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. for text in (["(?<word>a)", "(?P<word>a)"]) {
    4. match (Regex.compile(text)) {
    5. case Ok(_) => io.writeLine("accepted")
    6. case Err(_) => io.writeLine("invalid pattern")
    7. }
    8. }
    Expected outputExit code 0
    accepted
    invalid pattern
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. accepted
    2. invalid pattern

    Apply scoped case, line, and dot flags

    main.tpzApply scoped case, line, and dot flagsOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. function show(patternText: string, text: string) -> () {
    4. match (Regex.compile(patternText)) {
    5. case Ok(pattern) => io.writeLine("{pattern.isMatch(text)}")
    6. case Err(_) => io.writeLine("compile failed")
    7. }
    8. }
    9. show("(?i:ab)", "AB")
    10. show("(?m:^b$)", "a\nb\nc")
    11. show("(?s:a.b)", "a\nb")
    12. show("(?i:σ)", "ς")
    13. show("(?i:ss)", "ß")
    Expected outputExit code 0
    true
    true
    true
    true
    false
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true
    2. true
    3. true
    4. true
    5. false

    Use Unicode digit, word, and whitespace classes

    main.tpzUse Unicode digit, word, and whitespace classesOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. function show(patternText: string, text: string) -> () {
    4. match (Regex.compile(patternText)) {
    5. case Ok(pattern) => io.writeLine("{pattern.isMatch(text)}")
    6. case Err(_) => io.writeLine("compile failed")
    7. }
    8. }
    9. show("^\\d+$", "١٢")
    10. show("^\\w+$", "한")
    11. show("^\\s$", " ")
    Expected outputExit code 0
    true
    true
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true
    2. true
    3. true

    Alternatives considered

    • Accept several named capture spellings. The same named group could be written and recognized in several ways.

    Why

    The capture name always appears in the same place.

    Changed rules Compile the Unicode regular expression language →

    Oversized regex patterns fail at compilation

    Adopted November 16, 2026 · 6.0.0 · Being verified

    Problem

    Two patterns with equal instruction counts can need different storage for captures. Deep group nesting presents a separate limit.

    Decision

    Compilation caps instructions at 65536, program size times capture slots at 2^22 and group nesting at 128. Exceeding any cap returns Err.

    Examples

    A regex compiler rejects a group nesting depth of 129

    main.tpzA regex compiler rejects a group nesting depth of 129
    1. import std.io
    2. import std.regex { Regex }
    3. let mut left = ""
    4. let mut right = ""
    5. for i in (0 ..< 129) {
    6. left = left + "(?:"
    7. right = right + ")"
    8. }
    9. match (Regex.compile(left + "a" + right)) {
    10. case Ok(_) => io.writeLine("accepted")
    11. case Err(_) => io.writeLine("nesting rejected")
    12. }
    Expected outputExit code 0
    nesting rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. nesting rejected

    Alternatives considered

    • Count instructions alone. That count neither limits capture storage nor controls deep nesting.
    • Stop a search after a number of steps. The same pattern would succeed or stop depending on the input, so results would depend on input size.

    Why

    The pattern alone determines whether it fits before there is any search input.

    Changed rules Compile the Unicode regular expression language →

    A regex repetition does not add another empty iteration

    Adopted November 16, 2026 · 6.0.0 · Being verified

    Problem

    The body of a repetition can match without consuming anything. Allowing one more empty iteration changes both the range and the capture result.

    Decision

    Do not add an empty iteration that makes no progress. (|a)* matches byte range 0 to 1 in ab. Capture one of (a|)* on b is None.

    Examples

    An empty repetition makes no extra capture

    main.tpzAn empty repetition makes no extra captureOpen in Playground →
    1. import std.io
    2. import std.regex { Regex }
    3. match (Regex.compile("(|a)*")) {
    4. case Ok(pattern) => {
    5. match (pattern.find("ab")) {
    6. case Some(found) => io.writeLine("{found.start}:{found.end}")
    7. case None() => io.writeLine("no match")
    8. }
    9. }
    10. case Err(_) => io.writeLine("compile failed")
    11. }
    12. match (Regex.compile("(a|)*")) {
    13. case Ok(pattern) => {
    14. match (pattern.find("b")) {
    15. case Some(found) => {
    16. match (found.groups[1]) {
    17. case Some(group) => io.writeLine("captured={group}")
    18. case None() => io.writeLine("none")
    19. }
    20. }
    21. case None() => io.writeLine("no match")
    22. }
    23. }
    24. case Err(_) => io.writeLine("compile failed")
    25. }
    Expected outputExit code 0
    0:1
    none
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0:1
    2. none

    Alternatives considered

    • Add a final empty iteration. Empty matching and empty captures would need a separate case.

    Why

    The range and the captures reflect what the repetition actually consumed.

    Changed rules Search from the left and advance through nonoverlapping matches →

    Search, split and replace share one match sequence

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Different match ranges in search and replace make one pattern hard to reuse. Empty matches also need a way to make progress.

    Decision

    Choose leftmost-first, nonoverlapping matches and apply the empty-match progress rule. Search, split and replace use that same sequence.

    Examples

    Choose the first successful alternative at the leftmost position

    main.tpzChoose the first successful alternative at the leftmost positionOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("a|ab")) {
    4. case Ok(pattern) => {
    5. match (pattern.find("zab")) {
    6. case Some(found) => io.writeLine("{found.start}:{found.end}:{found.text}")
    7. case None() => io.writeLine("no match")
    8. }
    9. let present = pattern.isMatch("zab")
    10. let absent = pattern.isMatch("zzz")
    11. io.writeLine("{present}:{absent}")
    12. match (pattern.find("zzz")) {
    13. case None() => io.writeLine("none")
    14. case Some(_) => io.writeLine("present")
    15. }
    16. let matches = pattern.findAll("zzz")
    17. io.writeLine("{matches.length}")
    18. }
    19. case Err(_) => io.writeLine("compile failed")
    20. }
    Expected outputExit code 0
    1:2:a
    true:false
    none
    0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1:2:a
    2. true:false
    3. none
    4. 0

    Return nonoverlapping matches in input order

    main.tpzReturn nonoverlapping matches in input orderOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("aa")) {
    4. case Ok(pattern) => {
    5. for found in (pattern.findAll("aaaaa")) {
    6. io.writeLine("{found.start}:{found.end}:{found.text}")
    7. }
    8. }
    9. case Err(_) => io.writeLine("compile failed")
    10. }
    Expected outputExit code 0
    0:2:aa
    2:4:aa
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0:2:aa
    2. 2:4:aa

    Visit each boundary for an empty pattern and the empty input

    main.tpzVisit each boundary for an empty pattern and the empty inputOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("")) {
    4. case Ok(pattern) => {
    5. for found in (pattern.findAll("ab")) {
    6. io.writeLine("{found.start}:{found.end}")
    7. }
    8. io.writeLine("empty input")
    9. for found in (pattern.findAll("")) {
    10. io.writeLine("{found.start}:{found.end}")
    11. }
    12. }
    13. case Err(_) => io.writeLine("compile failed")
    14. }
    Expected outputExit code 0
    0:0
    1:1
    2:2
    empty input
    0:0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0:0
    2. 1:1
    3. 2:2
    4. empty input
    5. 0:0

    Retain empty split fields without inserting captures

    main.tpzRetain empty split fields without inserting capturesOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("(,)")) {
    4. case Ok(pattern) => {
    5. for field in (pattern.split(",a,,b,")) {
    6. io.writeLine("[{field}]")
    7. }
    8. for field in (pattern.split("plain")) {
    9. io.writeLine("[{field}]")
    10. }
    11. }
    12. case Err(_) => io.writeLine("compile failed")
    13. }
    Expected outputExit code 0
    []
    [a]
    []
    [b]
    []
    [plain]
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. []
    2. [a]
    3. []
    4. [b]
    5. []
    6. [plain]

    Share the adjacent-empty-match rule across transformations

    main.tpzShare the adjacent-empty-match rule across transformationsOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("a*")) {
    4. case Ok(pattern) => {
    5. for field in (pattern.split("ab")) {
    6. io.writeLine("[{field}]")
    7. }
    8. io.writeLine(pattern.replaceAll("ab", "-"))
    9. }
    10. case Err(_) => io.writeLine("compile failed")
    11. }
    Expected outputExit code 0
    []
    [b]
    []
    -b-
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. []
    2. [b]
    3. []
    4. -b-

    Alternatives considered

    • Choose different matching rules for each API. Search could report a range that replacement would not select.

    Why

    The same pattern selects predictable ranges across operations.

    Changed rules Search from the left and advance through nonoverlapping matches →Split and replace using the shared match sequence →

    Regex matches report UTF-8 byte offsets

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A multibyte character makes scalar indices and byte offsets diverge. Extracting a match requires knowing which unit the positions use.

    Decision

    Match.start and Match.end are UTF-8 byte offsets. Start is inclusive and end is exclusive.

    Examples

    Report UTF-8 byte offsets for non-ASCII matches

    main.tpzReport UTF-8 byte offsets for non-ASCII matchesOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. function show(patternText: string, text: string) -> () {
    4. match (Regex.compile(patternText)) {
    5. case Ok(pattern) => {
    6. match (pattern.find(text)) {
    7. case Some(found) => io.writeLine("{found.start}:{found.end}:{found.text}")
    8. case None() => io.writeLine("no match")
    9. }
    10. }
    11. case Err(_) => io.writeLine("compile failed")
    12. }
    13. }
    14. show("한", "é한🙂")
    15. show("́", "éx")
    Expected outputExit code 0
    2:5:한
    1:3:́
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2:5:한
    2. 1:3:́

    Recover a match through the byte slice identified by its offsets

    main.tpzRecover a match through the byte slice identified by its offsetsOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. let text = "한x"
    4. match (Regex.compile("한")) {
    5. case Ok(pattern) => {
    6. match (pattern.find(text)) {
    7. case Some(found) => {
    8. let bytes = text.encodeUtf8().slice(found.start, found.end)
    9. match (bytes.decodeUtf8()) {
    10. case Ok(decoded) => io.writeLine(decoded)
    11. case Err(_) => io.writeLine("invalid UTF-8 slice")
    12. }
    13. }
    14. case None() => io.writeLine("no match")
    15. }
    16. }
    17. case Err(_) => io.writeLine("compile failed")
    18. }
    Expected outputExit code 0
    한
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 한

    Alternatives considered

    • Return Unicode scalar indices. Getting the encoded byte range would require a separate position conversion.

    Why

    The same offsets identify the matched range in the encoded input.

    Changed rules Read match boundaries and capture snapshots →

    Regex replacements use braces for capture references

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A replacement may combine matched fragments with literal dollar signs. Its syntax needs to show where a capture name or number ends.

    Decision

    • Capture zero is the entire match.
    • Use braces for capture references and $$ for a literal dollar sign in a replacement.

    Examples

    Keep capture zero and distinguish missing and empty captures

    main.tpzKeep capture zero and distinguish missing and empty capturesOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("(?<word>a)(b)?()")) {
    4. case Ok(pattern) => {
    5. match (pattern.find("a")) {
    6. case Some(found) => {
    7. io.writeLine("{found.groups.length}")
    8. for group in (found.groups) {
    9. match (group) {
    10. case Some(text) => io.writeLine("some={text}")
    11. case None() => io.writeLine("none")
    12. }
    13. }
    14. }
    15. case None() => io.writeLine("no match")
    16. }
    17. }
    18. case Err(_) => io.writeLine("compile failed")
    19. }
    Expected outputExit code 0
    4
    some=a
    some=a
    none
    some=
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 4
    2. some=a
    3. some=a
    4. none
    5. some=

    Expand braced capture references and a literal dollar

    main.tpzExpand braced capture references and a literal dollarOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("(?<word>[a-z]+)([0-9]+)?")) {
    4. case Ok(pattern) => {
    5. let replacement = "$\{word\}/$\{0\}/$\{2\}/$\{missing\}/$$"
    6. io.writeLine(pattern.replaceAll("a1 b", replacement))
    7. io.writeLine(pattern.replaceAll("123", replacement))
    8. }
    9. case Err(_) => io.writeLine("compile failed")
    10. }
    Expected outputExit code 0
    a/a1/1//$ b/b///$
    123
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. a/a1/1//$ b/b///$
    2. 123

    Preserve text that is not a braced reference

    main.tpzPreserve text that is not a braced referenceOpen in Playground →
    1. import std.regex { Regex }
    2. import std.io
    3. match (Regex.compile("a")) {
    4. case Ok(pattern) => io.writeLine(pattern.replaceAll("a", "$word $1 $ $\{\} $\{bad-name\}"))
    5. case Err(_) => io.writeLine("compile failed")
    6. }
    Expected outputExit code 0
    $word $1 $ ${} ${bad-name}
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. $word $1 $ ${} ${bad-name}

    Alternatives considered

    • Also accept bare $1. That would give the same reference two spellings.

    Why

    The replacement shows which text is a capture and which dollar signs are literal.

    Changed rules Read match boundaries and capture snapshots →Split and replace using the shared match sequence →

    URL operations follow WHATWG

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Parsers can normalize the same URL differently depending on their standard. Query strings encoded as form data also need a decoding rule.

    Decision

    • Parse and serialize absolute URLs under WHATWG without a base URL.
    • Decode query fields using form-urlencoding rules.

    Examples

    Normalize the scheme, host, port, and path

    main.tpzNormalize the scheme, host, port, and pathOpen in Playground →
    1. import std.url { URL }
    2. import std.io
    3. match (URL.parse("HTTPS://Example.COM:443/a/./b/../c?x=1#part")) {
    4. case Ok(value) => io.writeLine(value.toString())
    5. case Err(_) => io.writeLine("parse failed")
    6. }
    Expected outputExit code 0
    https://example.com/a/c?x=1#part
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. https://example.com/a/c?x=1#part

    Handle invalid absolute URL text as data

    main.tpzHandle invalid absolute URL text as dataOpen in Playground →
    1. import std.url { URL }
    2. import std.io
    3. for text in (["", "../guide", "1bad:x", "https://", "https://example.com:wrong"]) {
    4. match (URL.parse(text)) {
    5. case Err(message) => io.writeLine("{message != ""}")
    6. case Ok(_) => io.writeLine("accepted")
    7. }
    8. }
    Expected outputExit code 0
    true
    true
    true
    true
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true
    2. true
    3. true
    4. true
    5. true

    Preserve serialized escapes and empty components through parsing

    main.tpzPreserve serialized escapes and empty components through parsingOpen in Playground →
    1. import std.url { URL }
    2. import std.io
    3. for text in (["https://example.com/a%2fb?x=%2b#p%2fq", "https://example.com/?#"]) {
    4. match (URL.parse(text)) {
    5. case Ok(value) => {
    6. io.writeLine(value.toString())
    7. match (URL.parse(value.toString())) {
    8. case Ok(again) => io.writeLine(again.toString())
    9. case Err(_) => io.writeLine("second parse failed")
    10. }
    11. }
    12. case Err(_) => io.writeLine("first parse failed")
    13. }
    14. }
    Expected outputExit code 0
    https://example.com/a%2fb?x=%2b#p%2fq
    https://example.com/a%2fb?x=%2b#p%2fq
    https://example.com/?#
    https://example.com/?#
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. https://example.com/a%2fb?x=%2b#p%2fq
    2. https://example.com/a%2fb?x=%2b#p%2fq
    3. https://example.com/?#
    4. https://example.com/?#

    Decode repeated query fields and preserve their value order

    main.tpzDecode repeated query fields and preserve their value orderOpen in Playground →
    1. import std.url { URL }
    2. import std.io
    3. match (URL.parse("https://example.com/?q=a+b&q=%ED%95%9C&empty&x=a=b&=blank")) {
    4. case Ok(value) => {
    5. let fields = value.query()
    6. for name in (["q", "empty", "x", ""]) {
    7. match (fields.get(name)) {
    8. case Some(values) => {
    9. for item in (values) {
    10. io.writeLine("{name}={item}")
    11. }
    12. }
    13. case None() => io.writeLine("missing")
    14. }
    15. }
    16. }
    17. case Err(_) => io.writeLine("parse failed")
    18. }
    Expected outputExit code 0
    q=a b
    q=한
    empty=
    x=a=b
    =blank
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. q=a b
    2. q=한
    3. empty=
    4. x=a=b
    5. =blank

    Keep malformed percent escapes as query data

    main.tpzKeep malformed percent escapes as query dataOpen in Playground →
    1. import std.url { URL }
    2. import std.io
    3. for text in (["https://example.com/?x=%", "https://example.com/?x=%GG"]) {
    4. match (URL.parse(text)) {
    5. case Ok(value) => {
    6. match (value.query().get("x")) {
    7. case Some(values) => io.writeLine(values[0])
    8. case None() => io.writeLine("missing")
    9. }
    10. }
    11. case Err(_) => io.writeLine("parse failed")
    12. }
    13. }
    Expected outputExit code 0
    %
    %GG
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. %
    2. %GG

    Alternatives considered

    • Implement RFC 3986 directly. That would give URL and form query behavior different from the chosen WHATWG contract.

    Why

    A single contract covers absolute URLs and form query fields.

    Changed rules Parse and serialize absolute URLs →Decode query fields into an independent map →

    Internationalized domains use Unicode 16.0.0

    Adopted November 16, 2026 · 6.0.0 · Being verified

    Problem

    Installed Unicode versions can differ by environment. Depending on host tables could classify the same domain differently.

    Decision

    • UTS 46 processing uses the Unicode 16.0.0 tables.
    • Lexing, normalization, and regular expression properties use the same 16.0.0 source data.

    Examples

    URL parsing folds the Cyrillic letter introduced in Unicode 16

    main.tpzURL parsing folds the Cyrillic letter introduced in Unicode 16Open in Playground →
    1. import std.io
    2. import std.test
    3. import std.url { URL }
    4. for input in (["https://Ᲊ.example", "https://ᲊ.example"]) {
    5. let url = test.assertOk(URL.parse(input))
    6. io.writeLine(test.assertSome(url.host()))
    7. }
    Expected outputExit code 0
    xn--d4f.example
    xn--d4f.example
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. xn--d4f.example
    2. xn--d4f.example

    Alternatives considered

    • Use the host’s newest tables or give domain processing its own Unicode version. Results could vary by environment, or a character could be classified differently in URLs and names.

    Why

    Internationalized domains use the same Unicode version across environments.

    Changed rules Read serialized URL components and their absence →

    Civil dates range from year 1 through year 9999

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Accepting year zero changes what dates can be stored and exchanged. Date arithmetic can also cross the supported limits.

    Decision

    • Use the proleptic Gregorian range 0001-01-01 through 9999-12-31. Reject year zero.
    • Day arithmetic beyond this range produces TPZ4004 at runtime.

    Examples

    Reject year zero during component construction

    main.tpzReject year zero during component constructionOpen in Playground →
    1. import std.date { Date }
    2. import std.io
    3. match (Date.fromYmd(0, 1, 1)) {
    4. case Err(_) => io.writeLine("year zero rejected")
    5. case Ok(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    year zero rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. year zero rejected

    Reject year zero in ISO text

    main.tpzReject year zero in ISO textOpen in Playground →
    1. import std.date { Date }
    2. import std.io
    3. match (Date.parseIso("0000-01-01")) {
    4. case Err(_) => io.writeLine("year zero rejected")
    5. case Ok(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    year zero rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. year zero rejected

    Cross leap days, years, and the full supported interval

    main.tpzCross leap days, years, and the full supported intervalOpen in Playground →
    1. import std.date { Date }
    2. import std.test
    3. import std.io
    4. let leap = test.assertOk(Date.fromYmd(2000, 2, 28))
    5. io.writeLine(leap.addDays(1).toIso())
    6. io.writeLine(leap.addDays(2).toIso())
    7. io.writeLine(leap.toIso())
    8. io.writeLine(test.assertOk(Date.fromYmd(1900, 2, 28)).addDays(1).toIso())
    9. io.writeLine(test.assertOk(Date.fromYmd(1582, 10, 4)).addDays(1).toIso())
    10. io.writeLine(test.assertOk(Date.fromYmd(2000, 1, 1)).addDays(-1).toIso())
    11. io.writeLine(leap.addDays(0).toIso())
    12. io.writeLine(test.assertOk(Date.fromYmd(1, 1, 1)).addDays(3652058).toIso())
    13. io.writeLine(test.assertOk(Date.fromYmd(9999, 12, 31)).addDays(-3652058).toIso())
    Expected outputExit code 0
    2000-02-29
    2000-03-01
    2000-02-28
    1900-03-01
    1582-10-05
    1999-12-31
    2000-02-28
    9999-12-31
    0001-01-01
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2000-02-29
    2. 2000-03-01
    3. 2000-02-28
    4. 1900-03-01
    5. 1582-10-05
    6. 1999-12-31
    7. 2000-02-28
    8. 9999-12-31
    9. 0001-01-01

    Reject the day after the final supported date

    main.tpzReject the day after the final supported dateOpen in Playground →
    1. import std.date { Date }
    2. import std.test
    3. import std.io
    4. let date = test.assertOk(Date.fromYmd(9999, 12, 31))
    5. date.addDays(1)
    6. io.writeLine("after")
    Expected outputNonzero exit
    No stdout.
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    Reject the day before the first supported date

    main.tpzReject the day before the first supported dateOpen in Playground →
    1. import std.date { Date }
    2. import std.test
    3. import std.io
    4. let date = test.assertOk(Date.fromYmd(1, 1, 1))
    5. date.addDays(-1)
    6. io.writeLine("after")
    Expected outputNonzero exit
    No stdout.
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    Alternatives considered

    • Continue accepting year zero. It would change the lower boundary of accepted dates.

    Why

    The range of representable dates is known before doing arithmetic.

    Changed rules Construct valid Gregorian civil dates →Add whole calendar days within the civil date range →

    Big integer text uses an explicit radix and lowercase digits

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Accepting spaces and capital letters makes it harder to tell whether text follows the intended format. A prefix could also change how the input is interpreted.

    Decision

    • Use radix 2 through 36 and lowercase ASCII digits. A single leading minus sign is allowed.
    • Keep whitespace significant and do not infer a radix from a prefix.

    Examples

    Parse and format exact integers in explicit radices

    main.tpzParse and format exact integers in explicit radicesOpen in Playground →
    1. import std.bigint { BigInt }
    2. import std.test
    3. import std.io
    4. let number = test.assertSome(BigInt.parse("ff", 16))
    5. io.writeLine(number.toString(2))
    6. io.writeLine(number.toString(10))
    7. io.writeLine(number.toString(16))
    8. io.writeLine(test.assertSome(BigInt.parse("z", 36)).toString(10))
    9. io.writeLine(test.assertSome(BigInt.parse("-00015", 10)).toString(16))
    10. io.writeLine(test.assertSome(BigInt.parse("-000", 10)).toString(36))
    11. io.writeLine(test.assertSome(BigInt.parse("123456789012345678901234567890", 10)).toString(10))
    Expected outputExit code 0
    11111111
    255
    ff
    35
    -f
    0
    123456789012345678901234567890
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 11111111
    2. 255
    3. ff
    4. 35
    5. -f
    6. 0
    7. 123456789012345678901234567890

    Reject surrounding whitespace in integer text

    main.tpzReject surrounding whitespace in integer textOpen in Playground →
    1. import std.bigint { BigInt }
    2. import std.io
    3. match (BigInt.parse(" 10 ", 10)) {
    4. case None() => io.writeLine("whitespace rejected")
    5. case Some(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    whitespace rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. whitespace rejected

    Reject a leading plus sign in integer text

    main.tpzReject a leading plus sign in integer textOpen in Playground →
    1. import std.bigint { BigInt }
    2. import std.io
    3. match (BigInt.parse("+10", 10)) {
    4. case None() => io.writeLine("plus rejected")
    5. case Some(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    plus rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. plus rejected

    Reject uppercase letters in integer text

    main.tpzReject uppercase letters in integer textOpen in Playground →
    1. import std.bigint { BigInt }
    2. import std.io
    3. match (BigInt.parse("FF", 16)) {
    4. case None() => io.writeLine("uppercase rejected")
    5. case Some(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    uppercase rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. uppercase rejected

    Alternatives considered

    • Accept whitespace, plus signs and uppercase letters. The same value would have additional noncanonical spellings.

    Why

    The requested radix and the literal digits determine the number.

    Changed rules Read and write integers in an explicit radix →

    Decimal multiplication checks the normalized result scale

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    Two values can have a large combined scale while their product fits after removing zeros. Checking the sum first would reject that product.

    Decision

    • Use an arbitrary-precision integer coefficient and normalized scale from 0 through 4294967295. Arithmetic is exact and decimal output has one canonical spelling.
    • Normalize a product before checking whether its scale fits.

    Examples

    Normalize signs and redundant decimal zeros

    main.tpzNormalize signs and redundant decimal zerosOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. for text in (["0", "-0.000", "+00012.3400", ".0050", "100.000"]) {
    10. let value: Decimal = read(text)
    11. io.writeLine("{value.toString()} {value.scale()}")
    12. let reparsed: Option<Decimal> = Decimal.parse(value.toString())
    13. let recovered: Decimal = test.assertSome(reparsed)
    14. test.assertEq(recovered, value)
    15. }
    Expected outputExit code 0
    0 0
    0 0
    12.34 2
    0.005 3
    100 0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0 0
    2. 0 0
    3. 12.34 2
    4. 0.005 3
    5. 100 0

    Keep every digit beyond machine integer precision

    main.tpzKeep every digit beyond machine integer precisionOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. let left: Decimal = read("1000000000000000000000000000000.25")
    10. let right: Decimal = read("0.75")
    11. let sum: Decimal = left + right
    12. let difference: Decimal = left - right
    13. let product: Decimal = left * right
    14. io.writeLine(sum.toString())
    15. io.writeLine(difference.toString())
    16. io.writeLine(product.toString())
    17. io.writeLine(left.toString())
    Expected outputExit code 0
    1000000000000000000000000000001
    999999999999999999999999999999.5
    750000000000000000000000000000.1875
    1000000000000000000000000000000.25
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1000000000000000000000000000001
    2. 999999999999999999999999999999.5
    3. 750000000000000000000000000000.1875
    4. 1000000000000000000000000000000.25

    Normalize a product before checking its final scale

    main.tpzNormalize a product before checking its final scaleOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. let parsedPlace: Option<Decimal> = Decimal.parse("0.1")
    5. let mut place: Decimal = test.assertSome(parsedPlace)
    6. let mut smallest: Decimal = (1).toDecimal()
    7. let mut step: int = 0
    8. while (step < 32) {
    9. smallest = smallest * place
    10. if (step < 31) {
    11. place = place * place
    12. }
    13. step = step + 1
    14. }
    15. let doubled: Decimal = smallest * (2).toDecimal()
    16. let parsedHalf: Option<Decimal> = Decimal.parse("0.5")
    17. let half: Decimal = test.assertSome(parsedHalf)
    18. let recovered: Decimal = doubled * half
    19. let equal = recovered == smallest
    20. io.writeLine("{recovered.scale()} {equal}")
    Expected outputExit code 0
    4294967295 true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 4294967295 true

    Alternatives considered

    • Limit the intermediate sum of scales first. A result can fit after normalization and still be rejected.

    Why

    Representability follows the result rather than a temporary calculation.

    Changed rules Preserve exact decimal values and canonical scale →

    Decimal parsing checks the entire ASCII input

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    Silently accepting whitespace or exponents can make it hard to tell which text became the value. Accepted spellings need a clear boundary.

    Decision

    Parse a complete ASCII decimal. Accept a sign and .5. Reject 1., whitespace, exponents, separators, radix prefixes and non-ASCII digits.

    Examples

    Accept explicit signs and fractional decimal text

    main.tpzAccept explicit signs and fractional decimal textOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. for text in (["7", "+7", "-7", "0007", ".5", "-.5", "+.5", "01.0200"]) {
    10. let value: Decimal = read(text)
    11. io.writeLine(value.toString())
    12. }
    Expected outputExit code 0
    7
    7
    -7
    7
    0.5
    -0.5
    0.5
    1.02
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 7
    2. 7
    3. -7
    4. 7
    5. 0.5
    6. -0.5
    7. 0.5
    8. 1.02

    Reject incomplete and nondecimal spellings

    main.tpzReject incomplete and nondecimal spellingsOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.io
    3. for text in (["", "+", "-", ".", "+.", "-.", "1.", "1.2.3", "1e2", "1E+2", "0x10", "1_000", "1,2", "NaN", "Infinity", " 1", "1 ", "1.2", "١.٢", "1\n2", "\t1"]) {
    4. match (Decimal.parse(text)) {
    5. case None() => io.writeLine("rejected")
    6. case Some(_) => io.writeLine("accepted")
    7. }
    8. }
    Expected outputExit code 0
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. rejected
    2. rejected
    3. rejected
    4. rejected
    5. rejected
    6. rejected
    7. rejected
    8. rejected
    9. rejected
    10. rejected
    11. rejected
    12. rejected
    13. rejected
    14. rejected
    15. rejected
    16. rejected
    17. rejected
    18. rejected
    19. rejected
    20. rejected
    21. rejected

    Alternatives considered

    • Use a permissive input grammar. Extra characters would require separate interpretations.

    Why

    The caller can tell from the spelling whether text is a decimal.

    Changed rules Parse complete finite decimal text →

    Decimal rounding names its direction and tie rule

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    Floor, ceiling and rounding toward zero can happen to agree on one number. The name should tell readers which intent survives different input.

    Decision

    Provide six rounding modes. Use HalfEven by default and define direction and ties for either sign.

    Examples

    Resolve positive and negative ties in every rounding mode

    main.tpzResolve positive and negative ties in every rounding modeOpen in Playground →
    1. import std.decimal { Decimal, RoundingMode }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. function rounded(text: string, mode: RoundingMode) -> string {
    10. let value: Decimal = read(text)
    11. return value.round(0, mode).toString()
    12. }
    13. let modes: Array<RoundingMode> = [RoundingMode.Down(), RoundingMode.Up(), RoundingMode.TowardZero(), RoundingMode.AwayFromZero(), RoundingMode.HalfUp(), RoundingMode.HalfEven()]
    14. for mode in (modes) {
    15. let a = rounded("2.5", mode)
    16. let b = rounded("3.5", mode)
    17. let c = rounded("-2.5", mode)
    18. let d = rounded("-3.5", mode)
    19. io.writeLine("{a} {b} {c} {d}")
    20. }
    Expected outputExit code 0
    2 3 -3 -4
    3 4 -2 -3
    2 3 -2 -3
    3 4 -3 -4
    3 4 -3 -4
    2 4 -2 -4
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2 3 -3 -4
    2. 3 4 -2 -3
    3. 2 3 -2 -3
    4. 3 4 -3 -4
    5. 3 4 -3 -4
    6. 2 4 -2 -4

    Distinguish directed rounding from nearest rounding

    main.tpzDistinguish directed rounding from nearest roundingOpen in Playground →
    1. import std.decimal { Decimal, RoundingMode }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. function rounded(text: string, mode: RoundingMode) -> string {
    10. let value: Decimal = read(text)
    11. return value.round(0, mode).toString()
    12. }
    13. let modes: Array<RoundingMode> = [RoundingMode.Down(), RoundingMode.Up(), RoundingMode.TowardZero(), RoundingMode.AwayFromZero(), RoundingMode.HalfUp(), RoundingMode.HalfEven()]
    14. for mode in (modes) {
    15. let a = rounded("2.1", mode)
    16. let b = rounded("2.9", mode)
    17. let c = rounded("-2.1", mode)
    18. let d = rounded("-2.9", mode)
    19. io.writeLine("{a} {b} {c} {d}")
    20. }
    Expected outputExit code 0
    2 2 -3 -3
    3 3 -2 -2
    2 2 -2 -2
    3 3 -3 -3
    2 3 -2 -3
    2 3 -2 -3
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2 2 -3 -3
    2. 3 3 -2 -2
    3. 2 2 -2 -2
    4. 3 3 -3 -3
    5. 2 3 -2 -3
    6. 2 3 -2 -3

    Apply the default mode and normalize a carry or zero

    main.tpzApply the default mode and normalize a carry or zeroOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. let value: Decimal = read("1.245")
    10. io.writeLine(value.round(2).toString())
    11. io.writeLine(read("1.255").round(2).toString())
    12. io.writeLine(value.round(5).toString())
    13. let carry: Decimal = read("9.995").round(2)
    14. let zero: Decimal = read("-0.004").round(2)
    15. io.writeLine("{carry.toString()} {carry.scale()}")
    16. io.writeLine("{zero.toString()} {zero.scale()}")
    17. io.writeLine(value.toString())
    Expected outputExit code 0
    1.24
    1.26
    1.245
    10 0
    0 0
    1.245
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1.24
    2. 1.26
    3. 1.245
    4. 10 0
    5. 0 0
    6. 1.245

    Alternatives considered

    • Merge modes that produce the same result in some cases. Floor, ceiling, toward zero and nearest express different intents.

    Why

    The rounding intent remains visible when inputs change.

    Changed rules Choose a decimal grid and a rounding direction →

    Decimal division rounds the exact quotient once

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    Intermediate rounding can move the final result at the requested precision. An internal scale sum could also reject an exact zero.

    Decision

    • Round the exact quotient once at the requested scale. Do not reject a zero quotient because of an intermediate scale sum.
    • Division by zero returns Err. An invalid scale produces TPZ5001 at runtime.

    Examples

    Distinguish exact and repeating quotients at the requested grid

    main.tpzDistinguish exact and repeating quotients at the requested gridOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function show(result: Result<Decimal, string>) -> () {
    5. let value: Decimal = test.assertOk(result)
    6. io.writeLine("{value.toString()} {value.scale()}")
    7. }
    8. let one: Decimal = (1).toDecimal()
    9. let third: Result<Decimal, string> = one.div((3).toDecimal(), 6)
    10. let eighth: Result<Decimal, string> = one.div((8).toDecimal(), 2)
    11. let negativeTie: Result<Decimal, string> = (-1).toDecimal().div((8).toDecimal(), 2)
    12. let exact: Result<Decimal, string> = (100).toDecimal().div((4).toDecimal(), 4)
    13. let integerGrid: Result<Decimal, string> = (2).toDecimal().div((3).toDecimal(), 0)
    14. show(third)
    15. show(eighth)
    16. show(negativeTie)
    17. show(exact)
    18. show(integerGrid)
    Expected outputExit code 0
    0.333333 6
    0.12 2
    -0.12 2
    25 0
    1 0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0.333333 6
    2. 0.12 2
    3. -0.12 2
    4. 25 0
    5. 1 0

    Apply every rounding mode to signed quotient ties

    main.tpzApply every rounding mode to signed quotient tiesOpen in Playground →
    1. import std.decimal { Decimal, RoundingMode }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. function quotient(text: string, mode: RoundingMode) -> string {
    10. let value: Decimal = read(text)
    11. let result: Result<Decimal, string> = value.div((2).toDecimal(), 0, mode)
    12. let rounded: Decimal = test.assertOk(result)
    13. return rounded.toString()
    14. }
    15. let modes: Array<RoundingMode> = [RoundingMode.Down(), RoundingMode.Up(), RoundingMode.TowardZero(), RoundingMode.AwayFromZero(), RoundingMode.HalfUp(), RoundingMode.HalfEven()]
    16. for mode in (modes) {
    17. let a = quotient("5", mode)
    18. let b = quotient("7", mode)
    19. let c = quotient("-5", mode)
    20. let d = quotient("-7", mode)
    21. io.writeLine("{a} {b} {c} {d}")
    22. }
    Expected outputExit code 0
    2 3 -3 -4
    3 4 -2 -3
    2 3 -2 -3
    3 4 -3 -4
    3 4 -3 -4
    2 4 -2 -4
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2 3 -3 -4
    2. 3 4 -2 -3
    3. 2 3 -2 -3
    4. 3 4 -3 -4
    5. 3 4 -3 -4
    6. 2 4 -2 -4

    Return a recoverable error for every zero divisor

    main.tpzReturn a recoverable error for every zero divisorOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. let divisor: Decimal = read("-0.000")
    10. let numerators: Array<Decimal> = [(0).toDecimal(), (1).toDecimal()]
    11. for numerator in (numerators) {
    12. let result: Result<Decimal, string> = numerator.div(divisor, 2)
    13. match (result) {
    14. case Err(message) => io.writeLine(message)
    15. case Ok(_) => io.writeLine("accepted")
    16. }
    17. }
    18. io.writeLine(divisor.toString())
    Expected outputExit code 0
    Decimal.div: division by zero
    Decimal.div: division by zero
    0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. Decimal.div: division by zero
    2. Decimal.div: division by zero
    3. 0

    Keep a zero quotient at the largest valid scale

    main.tpzKeep a zero quotient at the largest valid scaleOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. let divisor: Decimal = read("0.1")
    10. let result: Result<Decimal, string> = (0).toDecimal().div(divisor, 4294967295)
    11. match (result) {
    12. case Ok(value) => io.writeLine(value.toString())
    13. case Err(_) => io.writeLine("unexpected error")
    14. }
    Expected outputExit code 0
    0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0

    Reject an invalid scale before classifying a zero divisor

    main.tpzReject an invalid scale before classifying a zero divisorOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.io
    3. let value: Decimal = (1).toDecimal()
    4. value.div((0).toDecimal(), -1)
    5. io.writeLine("after")
    Expected outputNonzero exit
    No stdout.
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    Reject an invalid scale before classifying a zero divisor

    main.tpzReject an invalid scale before classifying a zero divisorOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.io
    3. let value: Decimal = (1).toDecimal()
    4. value.div((0).toDecimal(), 4294967296)
    5. io.writeLine("after")
    Expected outputNonzero exit
    No stdout.
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Rejection during run. Nonzero exit.

    Alternatives considered

    • Limit the sum of intermediate scales first. The operation could be rejected even when its result is representable zero.

    Why

    The requested scale and rounding mode determine the quotient.

    Changed rules Divide with an explicit result scale →

    Decimal to integer conversion succeeds only for an exact result

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    Converting a fraction to an integer can lose information. An integral value can also be too large for the destination.

    Decision

    • int.toDecimal is exact. toInt returns None() for a fractional value or overflow.
    • There is no implicit conversion. Exchange values with BigInt explicitly through the decimal text API.

    Examples

    Convert both int endpoints and reject fractions or overflow

    main.tpzConvert both int endpoints and reject fractions or overflowOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. for text in (["-9223372036854775808", "9223372036854775807", "-9223372036854775809", "9223372036854775808", "1.000", "1.001", "-1.001", "-0.000"]) {
    10. let value: Decimal = read(text)
    11. match (value.toInt()) {
    12. case Some(integer) => io.writeLine("{integer}")
    13. case None() => io.writeLine("not an int")
    14. }
    15. }
    16. let large: Decimal = read("1000000000000000000000000000000")
    17. let narrowed: Option<int> = large.toInt()
    18. test.assertNone(narrowed)
    19. io.writeLine(large.toString())
    Expected outputExit code 0
    -9223372036854775808
    9223372036854775807
    not an int
    not an int
    1
    not an int
    not an int
    0
    1000000000000000000000000000000
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. -9223372036854775808
    2. 9223372036854775807
    3. not an int
    4. not an int
    5. 1
    6. not an int
    7. not an int
    8. 0
    9. 1000000000000000000000000000000

    Convert int values to exact scale zero decimals

    main.tpzConvert int values to exact scale zero decimalsOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. let integers: Array<int> = [-9223372036854775807 - 1, -1, 0, 1, 9223372036854775807]
    5. for integer in (integers) {
    6. let value: Decimal = integer.toDecimal()
    7. let narrowed: Option<int> = value.toInt()
    8. let recovered: int = test.assertSome(narrowed)
    9. test.assertEq(recovered, integer)
    10. io.writeLine("{value.toString()} {value.scale()}")
    11. }
    Expected outputExit code 0
    -9223372036854775808 0
    -1 0
    0 0
    1 0
    9223372036854775807 0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. -9223372036854775808 0
    2. -1 0
    3. 0 0
    4. 1 0
    5. 9223372036854775807 0

    Exchange arbitrary precision integers through explicit decimal text

    main.tpzExchange arbitrary precision integers through explicit decimal textOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.bigint { BigInt }
    3. import std.test
    4. import std.io
    5. let parsedInteger: Option<BigInt> = BigInt.parse("123456789012345678901234567890", 10)
    6. let integer: BigInt = test.assertSome(parsedInteger)
    7. let parsedDecimal: Option<Decimal> = Decimal.parse(integer.toString(10))
    8. let value: Decimal = test.assertSome(parsedDecimal)
    9. io.writeLine(value.toString())
    10. let parsedAgain: Option<BigInt> = BigInt.parse(value.toString(), 10)
    11. let recovered: BigInt = test.assertSome(parsedAgain)
    12. let equal = recovered == integer
    13. io.writeLine("{equal}")
    14. let parsedFraction: Option<Decimal> = Decimal.parse("1.5")
    15. let fraction: Decimal = test.assertSome(parsedFraction)
    16. let integral: Option<BigInt> = BigInt.parse(fraction.toString(), 10)
    17. match (integral) {
    18. case None() => io.writeLine("fraction rejected")
    19. case Some(_) => io.writeLine("converted")
    20. }
    Expected outputExit code 0
    123456789012345678901234567890
    true
    fraction rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 123456789012345678901234567890
    2. true
    3. fraction rejected

    Alternatives considered

    • Convert mixed values implicitly and truncate fractions. A conversion could discard precision without showing it at the call site.

    Why

    Callers can handle fractions and overflow explicitly.

    Changed rules Convert numeric values explicitly and without truncation →

    Decimal comparisons use exact numerical values

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    1.0 and 1.00 have different spellings but the same value. Including scale would change how equality and sorting work.

    Decision

    Compare exact numerical values. Padding and signed zero do not matter, and comparison does not convert to binary floating point.

    Examples

    Treat values with different input padding as equal

    main.tpzTreat values with different input padding as equalOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. let left: Decimal = read("1.20")
    10. let right: Decimal = read("1.2000")
    11. let equal = left == right
    12. let unequal = left != right
    13. let less = left < right
    14. let lessOrEqual = left <= right
    15. let greater = left > right
    16. let greaterOrEqual = left >= right
    17. io.writeLine("{equal} {unequal} {less} {lessOrEqual} {greater} {greaterOrEqual}")
    18. io.writeLine("{left.scale()} {right.scale()}")
    Expected outputExit code 0
    true false false true false true
    1 1
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true false false true false true
    2. 1 1

    Order neighboring large values and signed zero exactly

    main.tpzOrder neighboring large values and signed zero exactlyOpen in Playground →
    1. import std.decimal { Decimal }
    2. import std.test
    3. import std.io
    4. function read(text: string) -> Decimal {
    5. let parsed: Option<Decimal> = Decimal.parse(text)
    6. let value: Decimal = test.assertSome(parsed)
    7. return value
    8. }
    9. let lower: Decimal = read("9007199254740992")
    10. let higher: Decimal = read("9007199254740993")
    11. let increasing = lower < higher
    12. let decreasing = higher > lower
    13. let distinct = lower != higher
    14. let negativeOrder = -higher < -lower
    15. io.writeLine("{increasing} {decreasing} {distinct} {negativeOrder}")
    16. let negativeZero: Decimal = read("-0.000")
    17. let zero: Decimal = (0).toDecimal()
    18. let sameZero = negativeZero == zero
    19. io.writeLine("{sameZero}")
    Expected outputExit code 0
    true true true true
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true true true true
    2. true

    Alternatives considered

    • Require equal scales for equality. The same number could compare differently depending on its input spelling.

    Why

    Equality and order are useful independently of the input format.

    Changed rules Compare exact decimal values independently of input scale →

    Filesystem functions preserve bytes and sort directory entries

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Programs read exact bytes or compare directory listings across systems. On failure, the caller also needs to identify the path involved.

    Decision

    • Byte operations preserve the bytes exactly. Text operations decode strict UTF-8.
    • Directory listings sort immediate entries and reject names that cannot be represented as Unicode.
    • Host errors include the operation and path.

    Examples

    Preserve a byte order mark and physical line endings

    main.tpzPreserve a byte order mark and physical line endings
    1. import std.fs
    2. import std.test
    3. import std.io
    4. io.writeLine(test.assertOk(fs.readText("source.txt")))
    Expected outputExit code 0
    alpha
    한글
    
    
    $ topaz run main.tpz --language-version 6.0
    source.txtPreserve a byte order mark and physical line endings
    1. alpha
    2. 한글
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. alpha
    2. 한글

    Preserve raw bytes and reject invalid UTF-8 text

    main.tpzPreserve raw bytes and reject invalid UTF-8 text
    1. import std.fs
    2. import std.bytes { Bytes }
    3. import std.test
    4. import std.io
    5. let bytes = test.assertOk(Bytes.fromArray([0, 65, 255]))
    6. test.assertOk(fs.writeBytes("data.bin", bytes))
    7. io.writeLine(test.assertOk(fs.readBytes("data.bin")).toHex())
    8. test.assertErr(fs.readText("data.bin"))
    9. io.writeLine("invalid text rejected")
    10. test.assertOk(fs.writeBytes("data.bin", Bytes.empty()))
    11. io.writeLine(test.assertOk(fs.readBytes("data.bin")).toHex())
    Expected outputExit code 0
    0041ff
    invalid text rejected
    
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0041ff
    2. invalid text rejected

    List immediate entries in exact name order

    main.tpzList immediate entries in exact name order
    1. import std.fs
    2. import std.test
    3. import std.io
    4. let entries = test.assertOk(fs.list("entries"))
    5. for entry in (entries) {
    6. let size = match (entry.sizeBytes) {
    7. case Some(value) => "{value}"
    8. case None() => "none"
    9. }
    10. io.writeLine("{entry.name} {entry.kind} {size}")
    11. }
    Expected outputExit code 0
    a.txt file 1
    nested directory none
    z.txt file 2
    
    $ topaz run main.tpz --language-version 6.0
    entries/z.txtList immediate entries in exact name order
    1. zz
    entries/a.txtList immediate entries in exact name order
    1. a
    entries/nested/inside.txtList immediate entries in exact name order
    1. inside
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. a.txt file 1
    2. nested directory none
    3. z.txt file 2

    Identify the operation and path in a readText error

    main.tpzIdentify the operation and path in a readText errorOpen in Playground →
    1. import std.fs
    2. import std.bytes { Bytes }
    3. import std.test
    4. import std.io
    5. let error = test.assertErr(fs.readText("missing/item.txt"))
    6. let operation = error.contains("readText")
    7. let path = error.contains("missing/item.txt")
    8. io.writeLine("{operation} {path}")
    Expected outputExit code 0
    true true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true true

    Identify the operation and path in a list error

    main.tpzIdentify the operation and path in a list errorOpen in Playground →
    1. import std.fs
    2. import std.bytes { Bytes }
    3. import std.test
    4. import std.io
    5. let error = test.assertErr(fs.list("missing/item.txt"))
    6. let operation = error.contains("list")
    7. let path = error.contains("missing/item.txt")
    8. io.writeLine("{operation} {path}")
    Expected outputExit code 0
    true true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true true

    Why

    Callers get a stable listing order and can identify the path of a failing operation.

    Changed rules Read and replace whole files and list directories →

    An explicit main consumes standard input once

    Adopted November 16, 2026 · 6.0.0 · Being verified

    Problem

    After standard input is passed to main, a read in its body needs a defined result. Returning the data through both paths would change what it means to consume a stream.

    Decision

    For main(args, stdin), read standard input to the end and pass it as stdin. A later io.readStdin in the body returns an empty string.

    Examples

    The main argument consumes standard input

    main.tpzThe main argument consumes standard input
    1. import std.io
    2. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    3. io.writeLine(stdin)
    4. let exhausted = io.readStdin() == ""
    5. io.writeLine("{exhausted}")
    6. Ok(0)
    7. }
    Expected outputExit code 0
    incoming
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. incoming
    2. true

    Alternatives considered

    • Return the same input through both paths. An already consumed stream would appear readable a second time.

    Why

    Input is consumed once regardless of the path that reads it.

    Changed rules Read standard input through its end →

    File streams preserve existing files and share cursor state

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A program can refer to an open file through more than one name. It needs to know whether opening preserves the contents and whether closing through one alias affects the others.

    Decision

    • Open an existing regular file for reading and writing without creating or truncating it.
    • Aliases of the same handle share its cursor and closed state.
    • Consume standard input through EOF. Use std.fs for whole-file replacement.
    • Standard input is consumed through EOF, and a file write advances the cursor past the written bytes.

    Examples

    Open and close an existing file without changing its bytes

    main.tpzOpen and close an existing file without changing its bytes
    1. import std.io
    2. import std.fs
    3. import std.test
    4. let file = test.assertOk(io.open("source.txt"))
    5. file.close()
    6. io.writeLine(test.assertOk(fs.readText("source.txt")))
    7. let missing = test.assertErr(io.open("missing.txt"))
    8. let named = missing.contains("missing.txt")
    9. io.writeLine("missing {named}")
    Expected outputExit code 0
    original
    missing true
    
    $ topaz run main.tpz --language-version 6.0
    source.txtOpen and close an existing file without changing its bytes
    1. original
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. original
    2. missing true

    Write at the cursor and retain the rest of the file

    main.tpzWrite at the cursor and retain the rest of the file
    1. import std.io
    2. import std.fs
    3. import std.test
    4. let file = test.assertOk(io.open("source.txt"))
    5. test.assertOk(file.write("XY"))
    6. let tail = test.assertOk(file.read())
    7. io.writeLine("tail {tail}")
    8. file.close()
    9. let whole = test.assertOk(fs.readText("source.txt"))
    10. io.writeLine("whole {whole}")
    Expected outputExit code 0
    tail cdef
    whole XYcdef
    
    $ topaz run main.tpz --language-version 6.0
    source.txtWrite at the cursor and retain the rest of the file
    1. abcdef
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. tail cdef
    2. whole XYcdef

    Close every alias and reject later access

    main.tpzClose every alias and reject later access
    1. import std.io
    2. import std.fs
    3. import std.test
    4. let file = test.assertOk(io.open("source.txt"))
    5. let alias = file
    6. file.close()
    7. alias.close()
    8. test.assertErr(alias.read())
    9. io.writeLine("read rejected")
    10. test.assertErr(alias.write("changed"))
    11. io.writeLine("write rejected")
    12. io.writeLine(test.assertOk(fs.readText("source.txt")))
    Expected outputExit code 0
    read rejected
    write rejected
    original
    
    $ topaz run main.tpz --language-version 6.0
    source.txtClose every alias and reject later access
    1. original
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. read rejected
    2. write rejected
    3. original

    Share the cursor across file aliases

    main.tpzShare the cursor across file aliases
    1. import std.io
    2. import std.test
    3. let file = test.assertOk(io.open("source.txt"))
    4. let alias = file
    5. io.writeLine(test.assertOk(file.read()))
    6. let tail = test.assertOk(alias.read())
    7. let atEnd = tail == ""
    8. io.writeLine("{atEnd}")
    9. alias.close()
    Expected outputExit code 0
    alpha
    true
    
    $ topaz run main.tpz --language-version 6.0
    source.txtShare the cursor across file aliases
    1. alpha
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. alpha
    2. true

    Why

    Operations through one alias pick up where operations through another left off.

    Changed rules Use a file handle with a shared cursor →

    JSON null uses the kind check

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Code may need to test whether a JSON value is null. The same form can be used for all six JSON kinds.

    Decision

    Use value.kind() == "null". The JSONValue.isNull() method is removed.

    Examples

    Distinguish null from every other JSON kind

    main.tpzDistinguish null from every other JSON kindOpen in Playground →
    1. import std.json
    2. import std.test
    3. import std.io
    4. for source in (["null", "false", "0", "\"\"", "[]", "\{\}"]) {
    5. let value = test.assertOk(json.parse(source))
    6. let kind = value.kind()
    7. let nullKind = kind == "null"
    8. io.writeLine("{kind}:{nullKind}")
    9. }
    Expected outputExit code 0
    null:true
    bool:false
    number:false
    string:false
    array:false
    object:false
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. null:true
    2. bool:false
    3. number:false
    4. string:false
    5. array:false
    6. object:false

    Keep present null values distinct from missing entries

    main.tpzKeep present null values distinct from missing entriesOpen in Playground →
    1. import std.json
    2. import std.test
    3. import std.io
    4. let array = test.assertOk(json.parse("[null]"))
    5. let object = test.assertOk(json.parse("\{\"present\":null\}"))
    6. let arrayValue = test.assertSome(array.at(0))
    7. let objectValue = test.assertSome(object.get("present"))
    8. test.assertNone(array.at(1))
    9. test.assertNone(object.get("absent"))
    10. io.writeLine("{arrayValue.kind()}:{objectValue.kind()}")
    Expected outputExit code 0
    null:null
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. null:null

    Use kind to test a JSON value for null

    main.tpzUse kind to test a JSON value for nullOpen in Playground →
    1. import std.json { JSONValue }
    2. function inspect(value: JSONValue) -> () {
    3. let result = value.kind() == "null"
    4. return ()
    5. }
    Expected outputExit code 0
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Reject the removed JSONValue.isNull member

    main.tpzReject the removed JSONValue.isNull member
    1. import std.json { JSONValue }
    2. function inspect(value: JSONValue) -> () {
    3. let result = value.isNull()
    4. return ()
    5. }
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    Alternatives considered

    • Keep isNull. Null would have two equivalent tests while the other kinds use kind().

    Why

    All six JSON kinds can be checked in the same way.

    Changed rules Inspect JSON kinds with kind →

    JSON numbers preserve their original spelling

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    JSON numbers 1 and 1e0 have the same mathematical value but different spellings. Direct projection from a tree and decoding to an integer have different requirements.

    Decision

    • Preserve the exact source spelling of each JSON number.
    • asInt accepts signed decimal integer spellings in the signed 64-bit range.
    • Typed integer decoding uses an exact mathematical conversion.

    Examples

    Keep integer projection within the declared spelling and range

    main.tpzKeep integer projection within the declared spelling and rangeOpen in Playground →
    1. import std.json
    2. import std.test
    3. import std.io
    4. for text in (["-9223372036854775808", "9223372036854775807", "9223372036854775808", "-0", "1.0", "1e0", "1.5"]) {
    5. let value = test.assertOk(json.parse(text))
    6. match (value.asInt()) {
    7. case Some(number) => io.writeLine("{text} = {number}")
    8. case None() => io.writeLine("{text} = none")
    9. }
    10. }
    Expected outputExit code 0
    -9223372036854775808 = -9223372036854775808
    9223372036854775807 = 9223372036854775807
    9223372036854775808 = none
    -0 = 0
    1.0 = none
    1e0 = none
    1.5 = none
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. -9223372036854775808 = -9223372036854775808
    2. 9223372036854775807 = 9223372036854775807
    3. 9223372036854775808 = none
    4. -0 = 0
    5. 1.0 = none
    6. 1e0 = none
    7. 1.5 = none

    Retain numbers beyond binary and integer precision

    main.tpzRetain numbers beyond binary and integer precisionOpen in Playground →
    1. import std.json
    2. import std.test
    3. import std.io
    4. for text in (["9007199254740993", "9223372036854775808", "-0", "1.2300e+03", "1e9999"]) {
    5. let value = test.assertOk(json.parse(text))
    6. io.writeLine(test.assertSome(value.numberText()))
    7. }
    Expected outputExit code 0
    9007199254740993
    9223372036854775808
    -0
    1.2300e+03
    1e9999
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 9007199254740993
    2. 9223372036854775808
    3. -0
    4. 1.2300e+03
    5. 1e9999

    Decode a record after parsing and report invalid data

    main.tpzDecode a record after parsing and report invalid dataOpen in Playground →
    1. import std.json
    2. import std.test
    3. import std.io
    4. record Item derives JSON { name: string, count: int = 7 }
    5. let item = test.assertOk(json.parseAs<Item>("\{\"name\":\"ink\",\"extra\":true\}"))
    6. io.writeLine("{item.name},{item.count}")
    7. for text in (["\{\}", "17", "[", "\{\"name\":\"ink\",\"count\":9223372036854775808\}"]) {
    8. match (json.parseAs<Item>(text)) {
    9. case Ok(_) => io.writeLine("accepted")
    10. case Err(_) => io.writeLine("invalid data")
    11. }
    12. }
    Expected outputExit code 0
    ink,7
    invalid data
    invalid data
    invalid data
    invalid data
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. ink,7
    2. invalid data
    3. invalid data
    4. invalid data
    5. invalid data

    Why

    A reader can keep the original spelling and still request an exact conversion to an integer type.

    Changed rules Project JSON values without coercion →Parse a complete JSON document →Parse text before typed JSON decoding →

    JSON parsing consumes the whole document and rejects duplicate keys

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    Trailing text can follow a valid value, and two escaped spellings can decode to the same key. Error locations need to make sense in text containing multibyte characters.

    Decision

    • Parse one complete document and reject duplicate decoded keys.
    • Limit nesting to 128 levels.
    • Report one-based Unicode scalar positions. Point to the offending scalar, the opening quote of the second key, or the end of input.
    • For the line number of an error position, CRLF is one line break, and a lone CR and a lone LF are each one line break.

    Examples

    Locate the first invalid scalar and end of input

    main.tpzLocate the first invalid scalar and end of inputOpen in Playground →
    1. import std.json
    2. import std.io
    3. for text in (["", "true false", "[1,]", "[1 x]", "[\rtrue,\r?]"]) {
    4. match (json.parse(text)) {
    5. case Ok(_) => io.writeLine("accepted")
    6. case Err(error) => io.writeLine("{error.line},{error.column}")
    7. }
    8. }
    Expected outputExit code 0
    1,1
    1,6
    1,4
    1,4
    3,1
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1,1
    2. 1,6
    3. 1,4
    4. 1,4
    5. 3,1

    Reject a repeated decoded key at its opening quote

    main.tpzReject a repeated decoded key at its opening quoteOpen in Playground →
    1. import std.json
    2. import std.io
    3. match (json.parse("\{\"a\":1,\"\\u0061\":2\}")) {
    4. case Ok(_) => io.writeLine("accepted")
    5. case Err(error) => io.writeLine("{error.line},{error.column}")
    6. }
    Expected outputExit code 0
    1,8
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1,8

    Decode surrogate pairs and reject malformed JSON spellings

    main.tpzDecode surrogate pairs and reject malformed JSON spellingsOpen in Playground →
    1. import std.json
    2. import std.test
    3. import std.io
    4. let value = test.assertOk(json.parse("\"\\uD83D\\uDE00\""))
    5. test.assertEq(test.assertSome(value.asString()), "😀")
    6. for text in (["01", "+1", "1.", "1e", "NaN", "\"\\uD800\"", "\"\\uDC00\""]) {
    7. match (json.parse(text)) {
    8. case Ok(_) => io.writeLine("accepted")
    9. case Err(_) => io.writeLine("invalid")
    10. }
    11. }
    Expected outputExit code 0
    invalid
    invalid
    invalid
    invalid
    invalid
    invalid
    invalid
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. invalid
    2. invalid
    3. invalid
    4. invalid
    5. invalid
    6. invalid
    7. invalid

    Accept depth 128 and reject the next child

    main.tpzAccept depth 128 and reject the next childOpen in Playground →
    1. import std.json
    2. import std.io
    3. let mut text = "0"
    4. for level in (0 ..< 128) {
    5. text = "[" + text + "]"
    6. }
    7. match (json.parse(text)) {
    8. case Ok(_) => io.writeLine("depth 128 accepted")
    9. case Err(_) => io.writeLine("depth 128 rejected")
    10. }
    11. match (json.parse("[" + text + "]")) {
    12. case Ok(_) => io.writeLine("depth 129 accepted")
    13. case Err(_) => io.writeLine("depth 129 rejected")
    14. }
    Expected outputExit code 0
    depth 128 accepted
    depth 129 rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. depth 128 accepted
    2. depth 129 rejected

    Why

    Invalid documents are rejected with a position the caller can locate directly in the input.

    Changed rules Parse a complete JSON document →

    JSON writing sorts object keys

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Different key orders make equivalent objects harder to compare as text. Typed parsing also needs to say when a custom decoder runs.

    Decision

    • Dispatch through the JSON protocol once.
    • Emit compact JSON with sorted object keys. Preserve array order and stored number spellings.
    • Finish parsing the document before invoking a typed decoder.
    • parseAs finishes parsing before it calls a decoder once. The effects of a user codec follow ordinary function evaluation.

    Examples

    Write sorted objects and preserve a parsed number lexeme

    main.tpzWrite sorted objects and preserve a parsed number lexemeOpen in Playground →
    1. import std.json
    2. import std.test
    3. import std.io
    4. io.writeLine(test.assertOk(json.stringify(map { "z": 1, "a": 2 })))
    5. io.writeLine(test.assertOk(json.stringify(["a,b", "x\"y", "\n", "é"])))
    6. let number = test.assertOk(json.parse("1.2300e+03"))
    7. io.writeLine(test.assertOk(json.stringify(number)))
    8. let empty: Array<int> = []
    9. io.writeLine(test.assertOk(json.stringify(empty)))
    Expected outputExit code 0
    {"a":2,"z":1}
    ["a,b","x\"y","\n","é"]
    1.2300e+03
    []
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. {"a":2,"z":1}
    2. ["a,b","x\"y","\n","é"]
    3. 1.2300e+03
    4. []

    Call a custom decoder once after complete parsing

    main.tpzCall a custom decoder once after complete parsing
    1. import std.json { JSONValue, parseAs }
    2. import std.io
    3. record Token { text: string }
    4. impl JSON<Token> {
    5. function encode(value: Token) -> Result<JSONValue, string> {
    6. JSON.encode(value.text)
    7. }
    8. function decode(value: JSONValue) -> Result<Token, string> {
    9. io.writeLine("decode")
    10. match (value.asString()) {
    11. case Some(text) => Ok(Token { text: text })
    12. case None() => Err("expected token string")
    13. }
    14. }
    15. }
    16. match (parseAs<Token>("\"ink\"")) {
    17. case Ok(value) => io.writeLine(value.text)
    18. case Err(message) => io.writeLine(message)
    19. }
    20. match (parseAs<Token>("\"ink\" false")) {
    21. case Ok(_) => io.writeLine("accepted")
    22. case Err(_) => io.writeLine("parse failed before decode")
    23. }
    Expected outputExit code 0
    decode
    ink
    parse failed before decode
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. decode
    2. ink
    3. parse failed before decode

    Why

    Output order is predictable, and incomplete input cannot invoke the decoder early.

    Changed rules Serialize JSON in a deterministic order →Parse text before typed JSON decoding →

    Named CSV reading rejects duplicate headers

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    If two columns have the same name, the name alone cannot identify one value. Reordering the columns could change which value a reader sees.

    Decision

    Name-based CSV reading returns an error when a header name is repeated.

    Examples

    Read unique named columns

    main.tpzRead unique named columnsOpen in Playground →
    1. import std.csv
    2. import std.test
    3. import std.io
    4. let rows = test.assertOk(csv.parseWithHeader("name,count\nTopaz,6"))
    5. let row = test.assertSome(rows.get(0))
    6. io.writeLine(test.assertSome(row.get("name")))
    7. io.writeLine(test.assertSome(row.get("count")))
    Expected outputExit code 0
    Topaz
    6
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. Topaz
    2. 6

    Reject duplicate names

    main.tpzReject duplicate namesOpen in Playground →
    1. import std.csv
    2. import std.io
    3. match (csv.parseWithHeader("name,name\nleft,right")) {
    4. case Err(_) => io.writeLine("duplicate headers rejected")
    5. case Ok(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    duplicate headers rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. duplicate headers rejected

    Reject duplicate names after reversing values

    main.tpzReject duplicate names after reversing valuesOpen in Playground →
    1. import std.csv
    2. import std.io
    3. match (csv.parseWithHeader("name,name\nright,left")) {
    4. case Err(_) => io.writeLine("duplicate headers rejected")
    5. case Ok(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    duplicate headers rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. duplicate headers rejected

    Reject duplicate names even when the values agree

    main.tpzReject duplicate names even when the values agreeOpen in Playground →
    1. import std.csv
    2. import std.io
    3. match (csv.parseWithHeader("name,name\nsame,same")) {
    4. case Err(_) => io.writeLine("duplicate headers rejected")
    5. case Ok(_) => io.writeLine("accepted")
    6. }
    Expected outputExit code 0
    duplicate headers rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. duplicate headers rejected

    Preserve repeated header text in positional rows

    main.tpzPreserve repeated header text in positional rowsOpen in Playground →
    1. import std.csv
    2. import std.test
    3. import std.io
    4. let rows = test.assertOk(csv.parse("name,name\nleft,right"))
    5. let row = test.assertSome(rows.get(1))
    6. io.writeLine("{row[0]}:{row[1]}")
    Expected outputExit code 0
    left:right
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. left:right

    Alternatives considered

    • Use the first or last column with that name. Swapping the columns would change the value returned under the same name.

    Why

    Callers can detect duplicate headers before relying on values read by name.

    Changed rules Require unique headers for named CSV rows →

    CSV writing with a supplied header rejects duplicate columns

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A caller can accidentally request the same output column twice. Rows can also omit a requested field or contain extra fields.

    Decision

    • stringifyWithHeader returns Result<string, string> and rejects repeated requested column names.
    • It preserves the requested order, writes an empty cell for each missing field, and ignores extra fields.
    • It ends each record with LF and quotes a sole empty cell.
    • Both writers end every record with LF and quote a sole empty field.

    Examples

    Choose output columns explicitly and fill absent cells

    main.tpzChoose output columns explicitly and fill absent cellsOpen in Playground →
    1. import std.csv
    2. import std.json
    3. import std.test
    4. import std.io
    5. let rows = [map { "name": "Topaz", "extra": "ignored", "count": "6" }, map { "name": "Ink" }]
    6. let text = test.assertOk(csv.stringifyWithHeader(rows, ["count", "name"]))
    7. io.writeLine(test.assertOk(json.stringify(text)))
    8. let noRows: Array<Map<string, string>> = []
    9. io.writeLine(test.assertOk(json.stringify(test.assertOk(csv.stringifyWithHeader(noRows, ["name"])))))
    Expected outputExit code 0
    "count,name\n6,Topaz\n,Ink\n"
    "name\n"
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. "count,name\n6,Topaz\n,Ink\n"
    2. "name\n"

    Reject duplicate columns before serializing a row

    main.tpzReject duplicate columns before serializing a rowOpen in Playground →
    1. import std.csv
    2. import std.io
    3. let rows: Array<Map<string, string>> = []
    4. match (csv.stringifyWithHeader(rows, ["name", "name"])) {
    5. case Ok(_) => io.writeLine("accepted")
    6. case Err(_) => io.writeLine("duplicate columns rejected")
    7. }
    Expected outputExit code 0
    duplicate columns rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. duplicate columns rejected

    Why

    The column list determines output order, and callers can handle a duplicate request as an error.

    Changed rules Serialize positional and named CSV rows →

    TOML accepts leap seconds and limits nesting to 128

    Adopted November 16, 2026 · 6.0.0 · Being verified

    Problem

    A TOML time can have a seconds field of 60. Very deep arrays and tables can also cause reading or writing to exhaust the stack.

    Decision

    • Accept a seconds value of 60 under RFC 3339.
    • Reading and writing both limit nesting to 128 levels and return Err beyond that limit.

    Examples

    A TOML leap second is accepted and excessive nesting is rejected

    main.tpzA TOML leap second is accepted and excessive nesting is rejected
    1. import std.io
    2. import std.toml
    3. match (toml.parse("date = 2016-12-31T23:59:60Z")) {
    4. case Ok(_) => io.writeLine("leap second accepted")
    5. case Err(_) => io.writeLine("leap second rejected")
    6. }
    7. let mut left = ""
    8. let mut right = ""
    9. for depth in (0 ..< 129) {
    10. left = left + "["
    11. right = right + "]"
    12. }
    13. match (toml.parse("value = " + left + "0" + right)) {
    14. case Ok(_) => io.writeLine("depth accepted")
    15. case Err(_) => io.writeLine("depth rejected")
    16. }
    Expected outputExit code 0
    leap second accepted
    depth rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. leap second accepted
    2. depth rejected

    Alternatives considered

    • Reject seconds values of 60. That conflicts with the date and time format TOML follows.
    • Leave nesting unlimited. A deeply nested array could exhaust the stack.

    Why

    Callers can read valid leap-second times and handle excessive nesting as an error.

    Changed rules Parse complete TOML 1.0 documents →Write deterministic TOML documents →

    TOML follows 1.0 and reports JSON conversion errors

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    TOML can express numbers that JSON cannot represent. Date kinds and integer ranges also need to remain distinct across conversions.

    Decision

    • Read TOML 1.0 forms and write the root table deterministically.
    • Preserve binary64 values and distinct date and time kinds.
    • toJson returns Result<JSONValue, string> and rejects nonfinite numbers. fromJson rejects out-of-range integers.
    • TOML keeps its date kinds, and converting a date to a JSON string drops its TOML kind.

    Examples

    Accept literal strings, multiline values, radix integers and dates

    main.tpzAccept literal strings, multiline values, radix integers and datesOpen in Playground →
    1. import std.toml
    2. import std.io
    3. for text in (["title = 'ink#paper'\n", "text = \"\"\"\nfirst\nsecond\"\"\"\n", "value = 0xff\n", "date = 1979-05-27T07:32:00Z\n", "value = inf\n", "value = nan\n"]) {
    4. match (toml.parse(text)) {
    5. case Ok(_) => io.writeLine("accepted")
    6. case Err(_) => io.writeLine("rejected")
    7. }
    8. }
    Expected outputExit code 0
    accepted
    accepted
    accepted
    accepted
    accepted
    accepted
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. accepted
    2. accepted
    3. accepted
    4. accepted
    5. accepted
    6. accepted

    Reject a scalar as a complete TOML document

    main.tpzReject a scalar as a complete TOML documentOpen in Playground →
    1. import std.json
    2. import std.toml
    3. import std.test
    4. import std.io
    5. let tree = test.assertOk(json.parse("7"))
    6. let value = test.assertOk(toml.fromJson(tree))
    7. match (toml.stringify(value)) {
    8. case Ok(_) => io.writeLine("accepted")
    9. case Err(_) => io.writeLine("root table required")
    10. }
    Expected outputExit code 0
    root table required
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. root table required

    Convert a TOML table through a recoverable JSON result

    main.tpzConvert a TOML table through a recoverable JSON result
    1. import std.json
    2. import std.toml
    3. import std.test
    4. import std.io
    5. let value = test.assertOk(toml.parse("name = \"Topaz\"\ncount = 6\n"))
    6. let tree = test.assertOk(value.toJson())
    7. io.writeLine(test.assertOk(json.stringify(tree)))
    8. let restored = test.assertOk(toml.fromJson(tree))
    9. io.writeLine(test.assertOk(toml.stringify(restored)))
    Expected outputExit code 0
    {"count":6,"name":"Topaz"}
    count = 6
    name = "Topaz"
    
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. {"count":6,"name":"Topaz"}
    2. count = 6
    3. name = "Topaz"

    Return an error for a TOML infinity during JSON conversion

    main.tpzReturn an error for a TOML infinity during JSON conversionOpen in Playground →
    1. import std.toml
    2. import std.test
    3. import std.io
    4. let value = test.assertOk(toml.parse("value = inf\n"))
    5. match (value.toJson()) {
    6. case Ok(_) => io.writeLine("accepted")
    7. case Err(_) => io.writeLine("nonfinite rejected")
    8. }
    Expected outputExit code 0
    nonfinite rejected
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. nonfinite rejected

    Reject null and out of range integer conversion

    main.tpzReject null and out of range integer conversionOpen in Playground →
    1. import std.json
    2. import std.toml
    3. import std.test
    4. import std.io
    5. for text in (["null", "9223372036854775808", "1e9999"]) {
    6. let value = test.assertOk(json.parse(text))
    7. match (toml.fromJson(value)) {
    8. case Ok(_) => io.writeLine("accepted")
    9. case Err(_) => io.writeLine("unrepresentable")
    10. }
    11. }
    Expected outputExit code 0
    unrepresentable
    unrepresentable
    unrepresentable
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. unrepresentable
    2. unrepresentable
    3. unrepresentable

    Why

    Callers can handle values the destination format cannot represent.

    Changed rules Parse complete TOML 1.0 documents →Write deterministic TOML documents →Convert TOML and JSON with explicit failures →

    Test loops use ordinary for

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A test can repeat over integer or boolean cases. The ordinary loop can run the same cases.

    Decision

    Use for in place of forAllInt and forAllBool, which are removed.

    Examples

    Use one loop for every element type

    main.tpzUse one loop for every element typeOpen in Playground →
    1. import std.test
    2. import std.io
    3. let mut sum = 0
    4. for value in ([2, 3, 5]) {
    5. sum += value
    6. }
    7. let mut trueCount = 0
    8. for value in ([true, false, true]) {
    9. if (value) { trueCount += 1 }
    10. }
    11. let mut labels = ""
    12. for value in (["A", "B", "C"]) {
    13. labels = labels + value
    14. }
    15. test.assertEq(sum, 10)
    16. test.assertEq(trueCount, 2)
    17. test.assertEq(labels, "ABC")
    18. io.writeLine("all values checked")
    Expected outputExit code 0
    all values checked
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. all values checked

    Reject the removed forAllInt helper

    main.tpzReject the removed forAllInt helperOpen in Playground →
    1. import std.test { forAllInt }
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during resolve. Nonzero exit.

    Reject the removed forAllBool helper

    main.tpzReject the removed forAllBool helperOpen in Playground →
    1. import std.test { forAllBool }
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during resolve. Nonzero exit.

    Alternatives considered

    • Keep the test-only loop functions. The same iteration would have two equivalent spellings.

    Why

    Tests use the same iteration rules as the rest of the program.

    Changed rules Repeat assertions with for →

    Parser scans use Unicode scalar positions

    Adopted November 7, 2026 · 6.0.0 · Being verified

    Problem

    A scan looking for ASCII can still receive Unicode text. Out-of-range starting positions and non-ASCII integers also need defined behavior.

    Decision

    • Integer ASCII predicates return a result for every integer input.
    • Scans clamp the starting position and return the exclusive scalar end of the longest matching span.
    • Indexed predicates and range scans use the same Unicode scalar position unit.

    Examples

    Include each ASCII endpoint and exclude its neighbors

    main.tpzInclude each ASCII endpoint and exclude its neighborsOpen in Playground →
    1. import std.parser
    2. import std.io
    3. for cp in ([47, 48, 57, 58, 64, 65, 90, 91, 96, 97, 122, 123, 8, 9, 10, 11, 12, 13, 14, 31, 32, 33]) {
    4. let digit = parser.isAsciiDigitCode(cp)
    5. let alpha = parser.isAsciiAlphaCode(cp)
    6. let alnum = parser.isAsciiAlnumCode(cp)
    7. let space = parser.isAsciiWhitespaceCode(cp)
    8. io.writeLine("{digit}/{alpha}/{alnum}/{space}")
    9. }
    Expected outputExit code 0
    false/false/false/false
    true/false/true/false
    true/false/true/false
    false/false/false/false
    false/false/false/false
    false/true/true/false
    false/true/true/false
    false/false/false/false
    false/false/false/false
    false/true/true/false
    false/true/true/false
    false/false/false/false
    false/false/false/false
    false/false/false/true
    false/false/false/true
    false/false/false/true
    false/false/false/true
    false/false/false/true
    false/false/false/false
    false/false/false/false
    false/false/false/true
    false/false/false/false
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. false/false/false/false
    2. true/false/true/false
    3. true/false/true/false
    4. false/false/false/false
    5. false/false/false/false
    6. false/true/true/false
    7. false/true/true/false
    8. false/false/false/false
    9. false/false/false/false
    10. false/true/true/false
    11. false/true/true/false
    12. false/false/false/false
    13. false/false/false/false
    14. false/false/false/true
    15. false/false/false/true
    16. false/false/false/true
    17. false/false/false/true
    18. false/false/false/true
    19. false/false/false/false
    20. false/false/false/false
    21. false/false/false/true
    22. false/false/false/false

    Return false for invalid code points and non ASCII values

    main.tpzReturn false for invalid code points and non ASCII valuesOpen in Playground →
    1. import std.parser
    2. import std.io
    3. for cp in ([-1, 128, 233, 55296, 1114112, 9223372036854775807]) {
    4. let digit = parser.isAsciiDigitCode(cp)
    5. let alpha = parser.isAsciiAlphaCode(cp)
    6. let alnum = parser.isAsciiAlnumCode(cp)
    7. let space = parser.isAsciiWhitespaceCode(cp)
    8. io.writeLine("{digit}/{alpha}/{alnum}/{space}")
    9. }
    Expected outputExit code 0
    false/false/false/false
    false/false/false/false
    false/false/false/false
    false/false/false/false
    false/false/false/false
    false/false/false/false
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. false/false/false/false
    2. false/false/false/false
    3. false/false/false/false
    4. false/false/false/false
    5. false/false/false/false
    6. false/false/false/false

    Stop at non ASCII scalars without changing position units

    main.tpzStop at non ASCII scalars without changing position unitsOpen in Playground →
    1. import std.parser
    2. import std.io
    3. let digit = parser.takeWhileAsciiDigit("é12x", 1)
    4. let combining = parser.takeWhileAsciiAlpha("éA", 0)
    5. let suffix = parser.takeWhileAsciiAlpha("éA", 2)
    6. let nonbreaking = parser.takeWhileAsciiWhitespace("  ", 0)
    7. let alnum = parser.takeWhileAsciiAlnum("Aé", 0)
    8. io.writeLine("{digit}/{combining}/{suffix}/{nonbreaking}/{alnum}")
    Expected outputExit code 0
    3/1/3/0/1
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 3/1/3/0/1

    Clamp starts and keep the first failing position

    main.tpzClamp starts and keep the first failing positionOpen in Playground →
    1. import std.parser
    2. import std.io
    3. let text = "12"
    4. for start in ([-3, 0, 1, 2, 99]) {
    5. let digit = parser.takeWhileAsciiDigit(text, start)
    6. let alpha = parser.takeWhileAsciiAlpha(text, start)
    7. let alnum = parser.takeWhileAsciiAlnum(text, start)
    8. let space = parser.takeWhileAsciiWhitespace(text, start)
    9. io.writeLine("{digit}/{alpha}/{alnum}/{space}")
    10. }
    11. let empty = ""
    12. let digit = parser.takeWhileAsciiDigit(empty, 99)
    13. let alpha = parser.takeWhileAsciiAlpha(empty, -1)
    14. let alnum = parser.takeWhileAsciiAlnum(empty, 0)
    15. let space = parser.takeWhileAsciiWhitespace(empty, 1)
    16. io.writeLine("{digit}/{alpha}/{alnum}/{space}")
    Expected outputExit code 0
    2/0/2/0
    2/0/2/0
    2/1/2/1
    2/2/2/2
    2/2/2/2
    0/0/0/0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2/0/2/0
    2. 2/0/2/0
    3. 2/1/2/1
    4. 2/2/2/2
    5. 2/2/2/2
    6. 0/0/0/0

    Why

    The returned end can serve as the start of the next scan.

    Changed rules Classify integer ASCII codes →Classify a scalar position →Scan a maximal ASCII span →

    Scaled-point conversion uses toScaledPoints

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Obtaining a grid integer from a length could look like a property read. The name can signal that it is a conversion.

    Decision

    Use toScaledPoints in place of scaledPoints.

    Examples

    Convert every physical length unit to scaled points

    main.tpzConvert every physical length unit to scaled points
    1. import std.io
    2. import std.typeset as ts
    3. let pt = (1pt).toScaledPoints()
    4. let mm = (25.4mm).toScaledPoints()
    5. let cm = (2.54cm).toScaledPoints()
    6. let inch = (1in).toScaledPoints()
    7. io.writeLine("{pt}|{mm}|{cm}|{inch}|{ts.fromScaledPoints(pt) == 1pt}")
    Expected outputExit code 0
    65536|4718592|4718592|4718592|true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 65536|4718592|4718592|4718592|true

    Keep the millipoint conversion boundary

    main.tpzKeep the millipoint conversion boundaryOpen in Playground →
    1. import std.io
    2. import std.typeset as ts
    3. let tie = ts.fromScaledPoints(4096).toMilliPoints()
    4. let rounded = ts.fromMilliPoints(1) == ts.fromScaledPoints(66)
    5. io.writeLine("{tie}|{rounded}")
    Expected outputExit code 0
    62|true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 62|true

    Alternatives considered

    • Preserve both names. The same conversion would remain available under two names.

    Why

    The prefix identifies the operation as a conversion, like other to methods.

    Changed rules Convert physical lengths with toScaledPoints →

    Public typesetting distances use Length of points

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    A raw integer for a line width or inset leaves callers guessing which grid it uses. Changing the grid should not change the stated physical distance.

    Decision

    Use Length<Pt> for public distances in std.typeset. Convert to grid units at the calculation boundary.

    Examples

    Use point lengths in Box

    main.tpzUse point lengths in Box
    1. import std.typeset as ts
    2. let value: ts.Box = ts.Box {
    3. unitIndex: 0,
    4. text: "A",
    5. width: 12pt,
    6. trackingAfter: 0pt
    7. }
    8. let distance: Length<Pt> = value.width
    Expected outputExit code 0
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Reject untyped physical distances in Box

    main.tpzReject untyped physical distances in Box
    1. import std.typeset as ts
    2. let value: ts.Box = ts.Box {
    3. unitIndex: 0,
    4. text: "A",
    5. width: 12,
    6. trackingAfter: 0
    7. }
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5001 →

      stdlib-physical-distance-requires-points at main.tpz:5:10

    Pass typed distances to the line-cost function

    main.tpzPass typed distances to the line-cost function
    1. import std.typeset as ts
    2. let value = ts.lineBadness(20pt, 20pt, 4, 1, ts.BreakKind.ForcedEnd(), false, 0, 0pt)
    Expected outputExit code 0
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Reject raw distances at the line-cost boundary

    main.tpzReject raw distances at the line-cost boundary
    1. import std.typeset as ts
    2. let value = ts.lineBadness(20, 20, 4, 1, ts.BreakKind.ForcedEnd(), false, 0, 0)
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5001 →

      stdlib-physical-distance-requires-points at main.tpz:2:28

    Use point lengths in BreakCluster

    main.tpzUse point lengths in BreakCluster
    1. import std.typeset as ts
    2. let value: ts.BreakCluster = ts.BreakCluster {
    3. text: "A",
    4. advance: 12pt,
    5. trackingAfter: 0pt
    6. }
    7. let distance: Length<Pt> = value.advance
    Expected outputExit code 0
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Reject untyped physical distances in BreakCluster

    main.tpzReject untyped physical distances in BreakCluster
    1. import std.typeset as ts
    2. let value: ts.BreakCluster = ts.BreakCluster {
    3. text: "A",
    4. advance: 12,
    5. trackingAfter: 0
    6. }
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5001 →

      stdlib-physical-distance-requires-points at main.tpz:4:12

    Alternatives considered

    • Expose raw grid integers in the API. Each caller would need to know the unit and when conversion occurs.

    Why

    The type carries the distance unit while calculations can select a grid.

    Changed rules Give public typesetting distances a point-length type →

    The CJK cluster classification is named CjkCluster

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    The former name suggested a Korean-only rule. The classification serves Chinese, Japanese and Korean text.

    Decision

    Rename KoreanCluster to CjkCluster to reflect its classification scope.

    Examples

    Use the CJK cluster variant

    main.tpzUse the CJK cluster variant
    1. import std.typeset as ts
    2. let kind: ts.BreakKind = ts.BreakKind.CjkCluster()
    Expected outputExit code 0
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Reject the former KoreanCluster name

    main.tpzReject the former KoreanCluster name
    1. import std.typeset as ts
    2. let kind = ts.BreakKind.KoreanCluster()
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5006 →

      stdlib-removed-korean-cluster at main.tpz:2:12

    Alternatives considered

    • Keep the old name. The name would continue to hide the broader scope.

    Why

    The classification's scope is visible in its name.

    Changed rules Name the CJK cluster break category →

    An empty final line follows the 52 percent threshold

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    A final line with no characters could use a different cost rule from other short final lines. Empty results need the same threshold.

    Decision

    Apply the below-52-percent rule even when the character count is zero. The empty final line costs 1185000000.

    Examples

    Apply the last-line width condition to zero characters

    main.tpzApply the last-line width condition to zero characters
    1. import std.typeset as ts
    2. import std.test
    3. import std.io
    4. function show(value: Result<int, ts.TypesetError>) -> () {
    5. let cost = test.assertOk(value)
    6. io.writeLine("{cost}")
    7. }
    8. show(ts.lineBadness(0pt, 100pt, 0, 0, ts.BreakKind.ForcedEnd(), true, 0, 0pt))
    Expected outputExit code 0
    1185000000
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1185000000

    Use a strict last-line width threshold

    main.tpzUse a strict last-line width threshold
    1. import std.typeset as ts
    2. import std.test
    3. import std.io
    4. function show(value: Result<int, ts.TypesetError>) -> () {
    5. let cost = test.assertOk(value)
    6. io.writeLine("{cost}")
    7. }
    8. show(ts.lineBadness(52pt, 100pt, 4, 0, ts.BreakKind.ForcedEnd(), true, 0, 0pt))
    9. show(ts.lineBadness(51pt, 100pt, 4, 0, ts.BreakKind.ForcedEnd(), true, 0, 0pt))
    Expected outputExit code 0
    102160000
    606040000
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 102160000
    2. 606040000

    Alternatives considered

    • Apply the threshold only to nonempty lines. An empty final line would remain a special case.

    Why

    The same final-line threshold applies to an empty result.

    Changed rules Compute fixed-point line badness from point lengths →

    The line cost function is named lineBadness

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    A name ending in millipoints suggests raw grid integers even when the function receives a length type. The type already states the unit.

    Decision

    Rename lineBadnessMpt to lineBadness.

    Examples

    Compute a line cost from point lengths

    main.tpzCompute a line cost from point lengths
    1. import std.io
    2. import std.typeset as ts
    3. let cost = ts.lineBadness(20pt, 20pt, 4, 1, ts.BreakKind.ForcedEnd(), false, 0, 0pt)
    4. match (cost) {
    5. case Ok(value) => io.writeLine("{value}")
    6. case Err(_) => io.writeLine("unexpected input error")
    7. }
    Expected outputExit code 0
    10000000
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 10000000

    Reject the former millipoint function name

    main.tpzReject the former millipoint function name
    1. import std.typeset { lineBadnessMpt }
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during resolve. Nonzero exit.

    Alternatives considered

    • Keep the millipoint suffix. The name would imply a different unit from the length type.

    Why

    Use the type to identify the unit.

    Changed rules Compute fixed-point line badness from point lengths →

    The letter-spacing cap is a font-relative length

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    A raw multiplier does not show whether the value represents a length or another ratio. The physical result depends on font size.

    Decision

    • maxLetterSpacingEm takes Length<Em>.
    • Resolve it against the font size of type Length<Pt> before converting to grid units. Millipoint ties round to the nearest even value.

    Examples

    Store a relative spacing length and an explicit point font size

    main.tpzStore a relative spacing length and an explicit point font size
    1. import std.typeset as ts
    2. let value = ts.LatinSpacing {
    3. minWordSpaceRatio: 0.8,
    4. maxWordSpaceRatio: 1.33,
    5. maxLetterSpacingEm: 0.01em,
    6. fontSizePt: 12pt
    7. }
    8. let relative: Length<Em> = value.maxLetterSpacingEm
    9. let physical: Length<Pt> = relative.resolve(value.fontSizePt)
    Expected outputExit code 0
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Resolve the stored spacing before converting to the computation grid

    main.tpzResolve the stored spacing before converting to the computation grid
    1. import std.typeset as ts
    2. import std.io
    3. let spacing = ts.LatinSpacing {
    4. minWordSpaceRatio: 0.8,
    5. maxWordSpaceRatio: 1.33,
    6. maxLetterSpacingEm: 0.01em,
    7. fontSizePt: 12pt
    8. }
    9. let limit = spacing.maxLetterSpacingEm.resolve(spacing.fontSizePt)
    10. let exact = limit == ts.fromScaledPoints(7860)
    11. let millipoints = limit.toMilliPoints()
    12. io.writeLine("{exact}|{millipoints}")
    Expected outputExit code 0
    true|120
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true|120

    Apply nearest-even rounding at each typed value boundary

    main.tpzApply nearest-even rounding at each typed value boundaryOpen in Playground →
    1. import std.typeset as ts
    2. import std.io
    3. let lowTie = (0.5em).resolve(ts.fromScaledPoints(3)) == ts.fromScaledPoints(2)
    4. let highTie = (0.5em).resolve(ts.fromScaledPoints(5)) == ts.fromScaledPoints(2)
    5. let literalGrid = (0.01em).resolve(12pt) == ts.fromScaledPoints(7860)
    6. let gridLow = (0.5em).resolve(0.125pt).toMilliPoints()
    7. let gridHigh = (0.5em).resolve(0.375pt).toMilliPoints()
    8. io.writeLine("{lowTie}|{highTie}|{literalGrid}|{gridLow}|{gridHigh}")
    Expected outputExit code 0
    true|true|true|62|188
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true|true|true|62|188

    Reject an untyped multiplier in the relative-length field

    main.tpzReject an untyped multiplier in the relative-length field
    1. import std.typeset as ts
    2. let spacing = ts.LatinSpacing {
    3. minWordSpaceRatio: 0.8,
    4. maxWordSpaceRatio: 1.33,
    5. maxLetterSpacingEm: 0.01,
    6. fontSizePt: 12pt
    7. }
    Expected outputNonzero exit
    No stdout.
    $ topaz check main.tpz --language-version 6.0 --format json
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5001 →

      stdlib-relative-distance-requires-em at main.tpz:5:23

    Alternatives considered

    • Keep relative spacing as a floating-point multiplier. The same type would represent both lengths and dimensionless ratios.

    Why

    The relative unit and the font size make the spacing calculation explicit.

    Changed rules Resolve relative letter spacing through Length →

    Typesetting picks the same breaks under the same conditions

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Two plans can have equal cost. If the choice varies between runs, identical manuscript input can produce different output.

    Decision

    • With the same input order, policy, calculation grid and release, line breaks, selected kinds, widths, costs and error variants match.
    • Define a selection rule for candidates with equal cost.

    Examples

    Retain a deterministic choice among equal cost candidates

    main.tpzRetain a deterministic choice among equal cost candidates
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. let items: Array<ts.Item> = [
    5. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "word", width: 10pt, trackingAfter: 0pt }),
    6. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Allowed(0), kind: ts.BreakKind.LatinSpace(), flagged: false }),
    7. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Allowed(0), kind: ts.BreakKind.ClosingPunctuation(), flagged: false })
    8. ]
    9. let input = ts.Paragraph {
    10. grid: ts.DistanceGrid.MilliPoint(),
    11. items: items,
    12. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt },
    13. justification: ts.JustificationPolicy {
    14. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    15. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    16. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    17. latinSpacing: None(), cjkStretchRatio: 0.0
    18. },
    19. costModel: ts.CostModel.FixedPoint(),
    20. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    21. }
    22. function category(kind: ts.BreakKind) -> string {
    23. match (kind) {
    24. case LatinSpace() => "space"
    25. case ClosingPunctuation() => "punctuation"
    26. case _ => "unexpected kind"
    27. }
    28. }
    29. for pass in ([0, 1]) {
    30. let result = test.assertOk(ts.breakParagraph(input))
    31. let optimized = result.optimized.lines[0]
    32. let greedy = result.greedy.lines[0]
    33. io.writeLine("{pass} {optimized.start} {optimized.endExclusive} {category(optimized.kind)} {category(greedy.kind)}")
    34. }
    Expected outputExit code 0
    0 0 1 space punctuation
    1 0 1 space punctuation
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0 0 1 space punctuation
    2. 1 0 1 space punctuation

    Report the same first failing stage for repeated invalid input

    main.tpzReport the same first failing stage for repeated invalid input
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 2, text: "a", width: 1pt, trackingAfter: 0pt })
    5. ]
    6. let input = ts.Paragraph {
    7. grid: ts.DistanceGrid.MilliPoint(),
    8. items: items,
    9. geometry: ts.LineGeometry { bodyTarget: 0pt, firstTarget: 0pt, dropCapSpan: 0, dropCapInset: 0pt },
    10. justification: ts.JustificationPolicy {
    11. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    12. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    13. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    14. latinSpacing: None(), cjkStretchRatio: 0.0
    15. },
    16. costModel: ts.CostModel.FixedPoint(),
    17. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    18. }
    19. for pass in ([0, 1]) {
    20. match (ts.breakParagraph(input)) {
    21. case Err(InvalidPolicy(_)) => io.writeLine("{pass} InvalidPolicy")
    22. case _ => io.writeLine("unexpected result")
    23. }
    24. }
    Expected outputExit code 0
    0 InvalidPolicy
    1 InvalidPolicy
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0 InvalidPolicy
    2. 1 InvalidPolicy

    Alternatives considered

    • Allow equal-cost plans to vary across runs. The same manuscript could get different line breaks or errors.

    Why

    A plan can be reproduced under the same conditions.

    Changed rules Repeat a paragraph plan deterministically →

    Break classification and paragraph planning have distinct boundaries

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Determining whether a character boundary permits a break differs from selecting a line ending. Using one grid for both can make classification depend on planning settings.

    Decision

    • classifyBreaks compares stored point ticks. Quantize to Paragraph.grid for paragraph planning.
    • BreakKind describes classification and BreakRule constrains planning. Non-tailorable Unicode decisions take priority. A shaping conflict is invalid input.

    Examples

    Keep exact point measurements at the classifier boundary

    main.tpzKeep exact point measurements at the classifier boundary
    1. import std.typeset as ts
    2. import std.test
    3. import std.io
    4. let clusters = [
    5. ts.BreakCluster { text: "a", advance: 0.5002pt, trackingAfter: 0pt },
    6. ts.BreakCluster { text: "b", advance: 0.5002pt, trackingAfter: 0pt }
    7. ]
    8. let policy = ts.BreakPolicy {
    9. mode: ts.BreakMode.Word(), rules: ts.KinsokuRules.AtlasDefault(),
    10. forbidBefore: [], forbidAfter: [], boundaryAllowed: [true, true],
    11. generatedHyphenEnds: [], protectFittingLatin: false, preserveShortWords: false,
    12. narrowestWordTarget: 0pt, bodyWordTarget: 1pt
    13. }
    14. let result = test.assertOk(ts.classifyBreaks(clusters, policy))
    15. for boundary in (result) {
    16. io.writeLine("{boundary.unitEnd}")
    17. }
    Expected outputExit code 0
    1
    2
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 1
    2. 2

    Reject a cluster that hides a mandatory Unicode break

    main.tpzReject a cluster that hides a mandatory Unicode break
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. function outcome(value: Result<Array<ts.BreakOpportunity>, ts.TypesetError>) -> string {
    5. match (value) {
    6. case Ok(_) => "Ok"
    7. case Err(InvalidInput(_)) => "InvalidInput"
    8. case Err(InvalidPolicy(_)) => "InvalidPolicy"
    9. case Err(_) => "unexpected error"
    10. }
    11. }
    12. let clusters = [ts.BreakCluster { text: "A\nB", advance: 1pt, trackingAfter: 0pt }]
    13. let selected = ts.BreakPolicy {
    14. mode: ts.BreakMode.Character(),
    15. rules: ts.KinsokuRules.Unicode16Ja(),
    16. forbidBefore: [],
    17. forbidAfter: [],
    18. boundaryAllowed: [true],
    19. generatedHyphenEnds: [],
    20. protectFittingLatin: false,
    21. preserveShortWords: false,
    22. narrowestWordTarget: 0pt,
    23. bodyWordTarget: 0pt
    24. }
    25. io.writeLine(outcome(ts.classifyBreaks(clusters, selected)))
    Expected outputExit code 0
    InvalidInput
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. InvalidInput

    Keep signed penalty preferences distinct from hard break rules

    main.tpzKeep signed penalty preferences distinct from hard break rulesOpen in Playground →
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. let rules = [ts.BreakRule.Allowed(-10000), ts.BreakRule.Allowed(0), ts.BreakRule.Allowed(10000)]
    5. for rule in (rules) {
    6. match (rule) {
    7. case Allowed(value) => io.writeLine("{value}")
    8. case _ => io.writeLine("unexpected rule")
    9. }
    10. }
    Expected outputExit code 0
    -10000
    0
    10000
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. -10000
    2. 0
    3. 10000

    Alternatives considered

    • Combine classification and planning constraints. A planning choice could obscure the original character boundary rule.

    Why

    Classification can be inspected separately from line costs and constraints.

    Changed rules Classify measured clusters into an ordered boundary sequence →Keep boundary policy separate from break category →Express preference, mandatory breaks, and forbidden breaks explicitly →

    Empty typesetting input succeeds with an empty result

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Filtering or editing can leave no clusters or no paragraph content. A rejection would make each caller synthesize its own result.

    Decision

    For otherwise valid input, an empty cluster array or paragraph succeeds with an empty result.

    Examples

    Classify an empty cluster sequence

    main.tpzClassify an empty cluster sequence
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. let clusters: Array<ts.BreakCluster> = []
    5. let selected = ts.BreakPolicy {
    6. mode: ts.BreakMode.Character(),
    7. rules: ts.KinsokuRules.AtlasDefault(),
    8. forbidBefore: [],
    9. forbidAfter: [],
    10. boundaryAllowed: [],
    11. generatedHyphenEnds: [],
    12. protectFittingLatin: false,
    13. preserveShortWords: false,
    14. narrowestWordTarget: 0pt,
    15. bodyWordTarget: 0pt
    16. }
    17. let breaks = test.assertOk(ts.classifyBreaks(clusters, selected))
    18. io.writeLine("{breaks.length}")
    Expected outputExit code 0
    0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0

    Plan a valid empty paragraph

    main.tpzPlan a valid empty paragraph
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ]
    5. let input = ts.Paragraph {
    6. grid: ts.DistanceGrid.MilliPoint(),
    7. items: items,
    8. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt },
    9. justification: ts.JustificationPolicy {
    10. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    11. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    12. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    13. latinSpacing: None(), cjkStretchRatio: 0.0
    14. },
    15. costModel: ts.CostModel.FixedPoint(),
    16. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    17. }
    18. match (ts.breakParagraph(input)) {
    19. case Ok(result) => {
    20. io.writeLine("{result.optimized.lines.length} {result.greedy.lines.length}")
    21. io.writeLine("{result.optimized.totalCost} {result.greedy.totalCost} {result.breakOpportunityCount}")
    22. }
    23. case Err(_) => io.writeLine("unexpected error")
    24. }
    Expected outputExit code 0
    0 0
    0 0 0
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0 0
    2. 0 0 0

    Alternatives considered

    • Reject empty input as an error. Callers would need to special-case empty input before using the operation.

    Why

    Empty content can follow the same result pipeline.

    Changed rules Classify measured clusters into an ordered boundary sequence →Choose deterministic paragraph plans →

    A nonempty paragraph needs a permitted final shaping boundary

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Shaping information can mark a boundary as unavailable for a break. If rulesets disagree about the last one, identical input can be valid in one path and invalid in another.

    Decision

    Every ruleset requires the final shaping boundary of nonempty input to permit a break. A violation returns InvalidInput.

    Examples

    Reject a masked paragraph end in every ruleset

    main.tpzReject a masked paragraph end in every ruleset
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. function outcome(value: Result<Array<ts.BreakOpportunity>, ts.TypesetError>) -> string {
    5. match (value) {
    6. case Ok(_) => "Ok"
    7. case Err(InvalidInput(_)) => "InvalidInput"
    8. case Err(InvalidPolicy(_)) => "InvalidPolicy"
    9. case Err(_) => "unexpected error"
    10. }
    11. }
    12. let clusters = [ts.BreakCluster { text: "a", advance: 1pt, trackingAfter: 0pt }]
    13. let atlas = ts.BreakPolicy {
    14. mode: ts.BreakMode.Character(),
    15. rules: ts.KinsokuRules.AtlasDefault(),
    16. forbidBefore: [],
    17. forbidAfter: [],
    18. boundaryAllowed: [false],
    19. generatedHyphenEnds: [],
    20. protectFittingLatin: false,
    21. preserveShortWords: false,
    22. narrowestWordTarget: 0pt,
    23. bodyWordTarget: 0pt
    24. }
    25. let unicode = ts.BreakPolicy {
    26. mode: ts.BreakMode.Character(),
    27. rules: ts.KinsokuRules.Unicode16Ja(),
    28. forbidBefore: [],
    29. forbidAfter: [],
    30. boundaryAllowed: [false],
    31. generatedHyphenEnds: [],
    32. protectFittingLatin: false,
    33. preserveShortWords: false,
    34. narrowestWordTarget: 0pt,
    35. bodyWordTarget: 0pt
    36. }
    37. io.writeLine(outcome(ts.classifyBreaks(clusters, atlas)))
    38. io.writeLine(outcome(ts.classifyBreaks(clusters, unicode)))
    Expected outputExit code 0
    InvalidInput
    InvalidInput
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. InvalidInput
    2. InvalidInput

    Alternatives considered

    • Treat the final boundary differently in different rulesets. Identical shaping data could be accepted on one path and rejected on another.

    Why

    There is one condition for reaching the end of the paragraph.

    Changed rules Classify measured clusters into an ordered boundary sequence →

    Paragraph planning states its search and returns two results

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Calling a plan good does not say which candidates were compared. A fast choice and a broader search can take different paths through one paragraph.

    Decision

    • FixedPoint starts with 80 preceding candidates and expands the search. KnuthPlass visits all predecessors. Each uses its own admission and cost rules.
    • One call returns both an optimized result and a greedy result.

    Examples

    Plan a paragraph through its supplied boundaries

    main.tpzPlan a paragraph through its supplied boundaries
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 1pt, trackingAfter: 0pt }),
    5. ts.Item.BoxItem(ts.Box { unitIndex: 1, text: "a", width: 1pt, trackingAfter: 0pt }),
    6. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 2, width: 0pt, rule: ts.BreakRule.Allowed(0), kind: ts.BreakKind.LatinSpace(), flagged: false }),
    7. ts.Item.BoxItem(ts.Box { unitIndex: 2, text: "a", width: 1pt, trackingAfter: 0pt }),
    8. ts.Item.BoxItem(ts.Box { unitIndex: 3, text: "a", width: 1pt, trackingAfter: 0pt }),
    9. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 4, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    10. ]
    11. let input = ts.Paragraph {
    12. grid: ts.DistanceGrid.MilliPoint(),
    13. items: items,
    14. geometry: ts.LineGeometry { bodyTarget: 2pt, firstTarget: 2pt, dropCapSpan: 0, dropCapInset: 0pt },
    15. justification: ts.JustificationPolicy {
    16. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    17. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    18. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    19. latinSpacing: None(), cjkStretchRatio: 0.0
    20. },
    21. costModel: ts.CostModel.FixedPoint(),
    22. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    23. }
    24. match (ts.breakParagraph(input)) {
    25. case Ok(result) => {
    26. for line in (result.optimized.lines) {
    27. io.writeLine("{line.start} {line.endExclusive}")
    28. }
    29. io.writeLine("{result.greedy.lines.length} {result.breakOpportunityCount}")
    30. }
    31. case Err(_) => io.writeLine("unexpected error")
    32. }
    Expected outputExit code 0
    0 2
    2 4
    2 2
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0 2
    2. 2 4
    3. 2 2

    Report a missing greedy completion

    main.tpzReport a missing greedy completion
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 1pt, trackingAfter: 0pt }),
    5. ts.Item.BoxItem(ts.Box { unitIndex: 1, text: "a", width: 1pt, trackingAfter: 0pt }),
    6. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Allowed(0), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    7. ]
    8. let input = ts.Paragraph {
    9. grid: ts.DistanceGrid.MilliPoint(),
    10. items: items,
    11. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt },
    12. justification: ts.JustificationPolicy {
    13. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    14. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    15. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    16. latinSpacing: None(), cjkStretchRatio: 0.0
    17. },
    18. costModel: ts.CostModel.FixedPoint(),
    19. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    20. }
    21. match (ts.breakParagraph(input)) {
    22. case Err(NoGreedyPlan()) => io.writeLine("NoGreedyPlan")
    23. case _ => io.writeLine("unexpected result")
    24. }
    Expected outputExit code 0
    NoGreedyPlan
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. NoGreedyPlan

    Report three forced soft hyphens in a row

    main.tpzReport three forced soft hyphens in a row
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 1pt, trackingAfter: 0pt }),
    5. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.LatinSoftHyphen(), flagged: false }),
    6. ts.Item.BoxItem(ts.Box { unitIndex: 1, text: "a", width: 1pt, trackingAfter: 0pt }),
    7. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 2, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.LatinSoftHyphen(), flagged: false }),
    8. ts.Item.BoxItem(ts.Box { unitIndex: 2, text: "a", width: 1pt, trackingAfter: 0pt }),
    9. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 3, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.LatinSoftHyphen(), flagged: false })
    10. ]
    11. let input = ts.Paragraph {
    12. grid: ts.DistanceGrid.MilliPoint(),
    13. items: items,
    14. geometry: ts.LineGeometry { bodyTarget: 1pt, firstTarget: 1pt, dropCapSpan: 0, dropCapInset: 0pt },
    15. justification: ts.JustificationPolicy {
    16. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    17. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    18. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    19. latinSpacing: None(), cjkStretchRatio: 0.0
    20. },
    21. costModel: ts.CostModel.FixedPoint(),
    22. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    23. }
    24. match (ts.breakParagraph(input)) {
    25. case Err(NoPlan()) => io.writeLine("NoPlan")
    26. case _ => io.writeLine("unexpected result")
    27. }
    Expected outputExit code 0
    NoPlan
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. NoPlan

    Alternatives considered

    • Promise optimality without a search scope. The reader could not tell which candidates the result had been compared against.

    Why

    A program can compare both results from the same call.

    Changed rules Choose deterministic paragraph plans →

    Typesetting rejects negative extents while permitting negative tracking

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Width and tracking are both distances, but a negative value means different things in each. Ignoring negative width hides how the line was measured.

    Decision

    Reject negative physical extents, penalty widths and drop-cap insets. Allow signed tracking.

    Examples

    Reject negative widths and negative extents before tracking

    main.tpzReject negative widths and negative extents before tracking
    1. import std.typeset as ts
    2. import std.io
    3. function report(items: Array<ts.Item>) -> () {
    4. let input = ts.Paragraph {
    5. grid: ts.DistanceGrid.MilliPoint(),
    6. items: items,
    7. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt },
    8. justification: ts.JustificationPolicy {
    9. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    10. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    11. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    12. latinSpacing: None(), cjkStretchRatio: 0.0
    13. },
    14. costModel: ts.CostModel.FixedPoint(),
    15. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    16. }
    17. match (ts.breakParagraph(input)) {
    18. case Err(InvalidInput(_)) => io.writeLine("InvalidInput")
    19. case _ => io.writeLine("unexpected result")
    20. }
    21. }
    22. report([ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: -1pt, trackingAfter: 0pt }), ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })])
    23. report([ts.Item.GlueItem(ts.Glue { unitIndex: 0, text: " ", width: -1pt, trackingAfter: 0pt, stretch: 0pt, shrink: 0pt }), ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })])
    24. report([ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 1pt, trackingAfter: 2pt }), ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })])
    25. report([ts.Item.GlueItem(ts.Glue { unitIndex: 0, text: " ", width: 1pt, trackingAfter: 2pt, stretch: 0pt, shrink: 0pt }), ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })])
    Expected outputExit code 0
    InvalidInput
    InvalidInput
    InvalidInput
    InvalidInput
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. InvalidInput
    2. InvalidInput
    3. InvalidInput
    4. InvalidInput

    Keep measured units and signed tracking in source order

    main.tpzKeep measured units and signed tracking in source order
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 3, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false }),
    5. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "AB", width: 3pt, trackingAfter: 1pt }),
    6. ts.Item.GlueItem(ts.Glue { unitIndex: 1, text: " ", width: 2pt, trackingAfter: 0.5pt, stretch: 1pt, shrink: 1pt }),
    7. ts.Item.BoxItem(ts.Box { unitIndex: 2, text: "C", width: 4pt, trackingAfter: -1pt })
    8. ]
    9. let input = ts.Paragraph {
    10. grid: ts.DistanceGrid.MilliPoint(),
    11. items: items,
    12. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt },
    13. justification: ts.JustificationPolicy {
    14. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    15. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    16. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    17. latinSpacing: None(), cjkStretchRatio: 0.0
    18. },
    19. costModel: ts.CostModel.FixedPoint(),
    20. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    21. }
    22. match (ts.breakParagraph(input)) {
    23. case Ok(result) => {
    24. let line = result.optimized.lines[0]
    25. io.writeLine("{line.start}:{line.endExclusive}:{line.displayTextScalarLength}")
    26. io.writeLine("{line.rawTextWidth == 10pt}:{line.trimmedTextWidth == 10pt}")
    27. io.writeLine("{items.length}")
    28. match (items[0]) {
    29. case PenaltyItem(_) => io.writeLine("penalty first")
    30. case _ => io.writeLine("changed input")
    31. }
    32. }
    33. case Err(_) => io.writeLine("unexpected error")
    34. }
    Expected outputExit code 0
    0:3:4
    true:true
    4
    penalty first
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0:3:4
    2. true:true
    3. 4
    4. penalty first

    Reject a negative boundary width

    main.tpzReject a negative boundary width
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 1pt, trackingAfter: 0pt }),
    5. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: -1pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    6. ]
    7. let input = ts.Paragraph {
    8. grid: ts.DistanceGrid.MilliPoint(),
    9. items: items,
    10. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt },
    11. justification: ts.JustificationPolicy {
    12. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    13. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    14. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    15. latinSpacing: None(), cjkStretchRatio: 0.0
    16. },
    17. costModel: ts.CostModel.FixedPoint(),
    18. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    19. }
    20. match (ts.breakParagraph(input)) {
    21. case Err(InvalidInput(_)) => io.writeLine("InvalidInput")
    22. case _ => io.writeLine("unexpected result")
    23. }
    Expected outputExit code 0
    InvalidInput
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. InvalidInput

    Reject a negative drop cap inset

    main.tpzReject a negative drop cap inset
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 1pt, trackingAfter: 0pt }),
    5. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    6. ]
    7. let input = ts.Paragraph {
    8. grid: ts.DistanceGrid.MilliPoint(),
    9. items: items,
    10. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 1, dropCapInset: -1pt },
    11. justification: ts.JustificationPolicy {
    12. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    13. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    14. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    15. latinSpacing: None(), cjkStretchRatio: 0.0
    16. },
    17. costModel: ts.CostModel.FixedPoint(),
    18. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    19. }
    20. match (ts.breakParagraph(input)) {
    21. case Err(InvalidPolicy(_)) => io.writeLine("InvalidPolicy")
    22. case _ => io.writeLine("unexpected result")
    23. }
    Expected outputExit code 0
    InvalidPolicy
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. InvalidPolicy

    Alternatives considered

    • Allow or ignore negative physical widths. An invalid measurement could pass unnoticed.

    Why

    Readers can distinguish intentional tightening from an invalid physical extent.

    Changed rules Preserve measured units and validate their physical extents →Apply penalties at measured unit boundaries →Compute each line target from one geometry →

    Selected penalty width contributes to line width

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    A line break can add visible material with a width. Different cost methods could measure the same line differently if they count that material differently.

    Decision

    Include a selected penalty's width for every kind in both cost methods and in the natural width used for justification.

    Examples

    Include a selected nonsoft penalty width with fixed costs

    main.tpzInclude a selected nonsoft penalty width with fixed costs
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 4pt, trackingAfter: 0pt }),
    5. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 1pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.LatinHyphen(), flagged: false })
    6. ]
    7. let input = ts.Paragraph {
    8. grid: ts.DistanceGrid.MilliPoint(),
    9. items: items,
    10. geometry: ts.LineGeometry { bodyTarget: 5pt, firstTarget: 5pt, dropCapSpan: 0, dropCapInset: 0pt },
    11. justification: ts.JustificationPolicy {
    12. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    13. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    14. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    15. latinSpacing: None(), cjkStretchRatio: 0.0
    16. },
    17. costModel: ts.CostModel.FixedPoint(),
    18. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    19. }
    20. match (ts.breakParagraph(input)) {
    21. case Ok(result) => {
    22. let line = result.optimized.lines[0]
    23. io.writeLine("{line.selectedPenaltyWidth == 1pt}:{line.costTextWidth == 4pt}:{line.cost}")
    24. }
    25. case Err(_) => io.writeLine("unexpected error")
    26. }
    Expected outputExit code 0
    true:true:350000000
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true:true:350000000

    Include a selected nonsoft penalty width with knuth costs

    main.tpzInclude a selected nonsoft penalty width with knuth costs
    1. import std.typeset as ts
    2. import std.io
    3. let items: Array<ts.Item> = [
    4. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: 4pt, trackingAfter: 0pt }),
    5. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 1pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.LatinHyphen(), flagged: false })
    6. ]
    7. let input = ts.Paragraph {
    8. grid: ts.DistanceGrid.MilliPoint(),
    9. items: items,
    10. geometry: ts.LineGeometry { bodyTarget: 5pt, firstTarget: 5pt, dropCapSpan: 0, dropCapInset: 0pt },
    11. justification: ts.JustificationPolicy {
    12. mode: ts.JustificationMode.Unjustified(), minGapCount: 0,
    13. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    14. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    15. latinSpacing: None(), cjkStretchRatio: 0.0
    16. },
    17. costModel: ts.CostModel.KnuthPlass(),
    18. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    19. }
    20. match (ts.breakParagraph(input)) {
    21. case Ok(result) => {
    22. let line = result.optimized.lines[0]
    23. io.writeLine("{line.selectedPenaltyWidth == 1pt}:{line.costTextWidth == 4pt}:{line.cost}")
    24. }
    25. case Err(_) => io.writeLine("unexpected error")
    26. }
    Expected outputExit code 0
    true:true:100
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true:true:100

    Include an inserted width in justification without adding gaps

    main.tpzInclude an inserted width in justification without adding gaps
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. function sample(textWidth: Length<Pt>, insertionWidth: Length<Pt>) -> ts.ParagraphResult {
    5. let items: Array<ts.Item> = [
    6. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "a", width: textWidth, trackingAfter: 0pt }),
    7. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: insertionWidth, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.LatinHyphen(), flagged: false }),
    8. ts.Item.BoxItem(ts.Box { unitIndex: 1, text: "tail", width: 5pt, trackingAfter: 0pt }),
    9. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 2, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    10. ]
    11. let input = ts.Paragraph {
    12. grid: ts.DistanceGrid.MilliPoint(),
    13. items: items,
    14. geometry: ts.LineGeometry { bodyTarget: 5pt, firstTarget: 5pt, dropCapSpan: 0, dropCapInset: 0pt },
    15. justification: ts.JustificationPolicy {
    16. mode: ts.JustificationMode.LatinWordSpace(), minGapCount: 0,
    17. minLineWidthRatioM: 1000, minFinalLineWidthRatioM: None(),
    18. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    19. latinSpacing: None(), cjkStretchRatio: 0.0
    20. },
    21. costModel: ts.CostModel.FixedPoint(),
    22. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    23. }
    24. test.assertOk(ts.breakParagraph(input))
    25. }
    26. let inserted = sample(4pt, 1pt)
    27. let measured = sample(5pt, 0pt)
    28. io.writeLine("{inserted.optimized.lines[0].cost == measured.optimized.lines[0].cost}")
    Expected outputExit code 0
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true

    Alternatives considered

    • Ignore width for some penalty kinds. The same inserted material would count in only some line calculations.

    Why

    Break selection and justification use the same physical width.

    Changed rules Apply penalties at measured unit boundaries →Score justification with explicit policy precedence →

    The final-line minimum applies only to the last FixedPoint line

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Adjusting the last line could change preceding lines if they read the same setting. Falling short of a width target should also leave the shortage nonnegative.

    Decision

    • Apply minFinalLineWidthRatioM only when calculating the final FixedPoint line.
    • Keep the shortage nonnegative even for a large minimum. Falling below the target does not lower the cost.

    Examples

    Apply the final line threshold to the final line

    main.tpzApply the final line threshold to the final line
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. function sample(justification: ts.JustificationPolicy) -> ts.ParagraphResult {
    5. let items: Array<ts.Item> = [
    6. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "word", width: 10pt, trackingAfter: 0pt }),
    7. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    8. ]
    9. let input = ts.Paragraph {
    10. grid: ts.DistanceGrid.MilliPoint(),
    11. items: items,
    12. geometry: ts.LineGeometry { bodyTarget: 20pt, firstTarget: 20pt, dropCapSpan: 0, dropCapInset: 0pt },
    13. justification: justification,
    14. costModel: ts.CostModel.FixedPoint(),
    15. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    16. }
    17. test.assertOk(ts.breakParagraph(input))
    18. }
    19. let unconstrained = sample(ts.JustificationPolicy {
    20. mode: ts.JustificationMode.LatinWordSpace(), minGapCount: 0,
    21. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    22. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    23. latinSpacing: None(), cjkStretchRatio: 0.0
    24. })
    25. let constrained = sample(ts.JustificationPolicy {
    26. mode: ts.JustificationMode.LatinWordSpace(), minGapCount: 0,
    27. minLineWidthRatioM: 0, minFinalLineWidthRatioM: Some(1000),
    28. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    29. latinSpacing: None(), cjkStretchRatio: 0.0
    30. })
    31. io.writeLine("{constrained.optimized.lines[0].cost > unconstrained.optimized.lines[0].cost}")
    Expected outputExit code 0
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true

    Keep the final line threshold out of nonfinal scoring

    main.tpzKeep the final line threshold out of nonfinal scoring
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. function sample(justification: ts.JustificationPolicy) -> ts.ParagraphResult {
    5. let items: Array<ts.Item> = [
    6. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "word", width: 4pt, trackingAfter: 0pt }),
    7. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false }),
    8. ts.Item.BoxItem(ts.Box { unitIndex: 1, text: "next", width: 4pt, trackingAfter: 0pt }),
    9. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 2, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    10. ]
    11. let input = ts.Paragraph {
    12. grid: ts.DistanceGrid.MilliPoint(),
    13. items: items,
    14. geometry: ts.LineGeometry { bodyTarget: 10pt, firstTarget: 10pt, dropCapSpan: 0, dropCapInset: 0pt },
    15. justification: justification,
    16. costModel: ts.CostModel.FixedPoint(),
    17. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    18. }
    19. test.assertOk(ts.breakParagraph(input))
    20. }
    21. let ordinary = sample(ts.JustificationPolicy {
    22. mode: ts.JustificationMode.LatinWordSpace(), minGapCount: 1,
    23. minLineWidthRatioM: 0, minFinalLineWidthRatioM: None(),
    24. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    25. latinSpacing: None(), cjkStretchRatio: 0.0
    26. })
    27. let finalZero = sample(ts.JustificationPolicy {
    28. mode: ts.JustificationMode.LatinWordSpace(), minGapCount: 1,
    29. minLineWidthRatioM: 0, minFinalLineWidthRatioM: Some(0),
    30. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    31. latinSpacing: None(), cjkStretchRatio: 0.0
    32. })
    33. io.writeLine("{ordinary.optimized.lines[0].cost == finalZero.optimized.lines[0].cost}")
    Expected outputExit code 0
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true

    Raise the score when an overwide unit misses a larger minimum

    main.tpzRaise the score when an overwide unit misses a larger minimum
    1. import std.typeset as ts
    2. import std.io
    3. import std.test
    4. function sample(ratio: int) -> ts.ParagraphResult {
    5. let items: Array<ts.Item> = [
    6. ts.Item.BoxItem(ts.Box { unitIndex: 0, text: "wide", width: 1.5pt, trackingAfter: 0pt }),
    7. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 1, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false }),
    8. ts.Item.BoxItem(ts.Box { unitIndex: 1, text: "end", width: 1pt, trackingAfter: 0pt }),
    9. ts.Item.PenaltyItem(ts.Penalty { unitEnd: 2, width: 0pt, rule: ts.BreakRule.Forced(), kind: ts.BreakKind.ForcedEnd(), flagged: false })
    10. ]
    11. let input = ts.Paragraph {
    12. grid: ts.DistanceGrid.MilliPoint(),
    13. items: items,
    14. geometry: ts.LineGeometry { bodyTarget: 1pt, firstTarget: 1pt, dropCapSpan: 0, dropCapInset: 0pt },
    15. justification: ts.JustificationPolicy {
    16. mode: ts.JustificationMode.LatinWordSpace(), minGapCount: 0,
    17. minLineWidthRatioM: ratio, minFinalLineWidthRatioM: None(),
    18. maxAdjustment: 0pt, maxGapAdjustment: 0pt, maxGapRatioR: 0,
    19. latinSpacing: None(), cjkStretchRatio: 0.0
    20. },
    21. costModel: ts.CostModel.FixedPoint(),
    22. knuthPlass: ts.KnuthPlassPolicy { toleranceR: 100000000, linePenalty: 10, fitnessDemerit: 0, flaggedDemerit: 0, finalFlaggedDemerit: 0 }
    23. }
    24. test.assertOk(ts.breakParagraph(input))
    25. }
    26. let ordinary = sample(0)
    27. let thresholded = sample(2000)
    28. io.writeLine("{thresholded.optimized.lines[0].cost > ordinary.optimized.lines[0].cost}")
    Expected outputExit code 0
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. true

    Alternatives considered

    • Read the final-line setting for earlier lines as well. A setting meant for the last line would change the rest of the paragraph.

    Why

    The setting has a defined effect on the line it names.

    Changed rules Score justification with explicit policy precedence →

    Consumer artifacts use inspectConsumerArtifact

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    Two functions provided the same consumer artifact information. Their names gave callers two choices for the same action.

    Decision

    Keep inspectConsumerArtifact and remove the equivalent verifyConsumerArtifact.

    Alternatives considered

    • Keep both names. Callers would still have two names for a single operation.

    Why

    There is one public function for inspecting a consumer artifact.

    Changed rules Inspect and validate consumer artifacts in one call →

    Lispex evaluation is distinct from admission and evidence work

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    An evaluation can be surrounded by checks before execution and evidence checks afterward. Putting them in one call obscures where an outcome came from.

    Decision

    The 6.0 API distinguishes canonical evaluation, admission, host interruption and additional evidence work.

    Alternatives considered

    • Fold admission and evidence into the evaluation call. Callers could not tell as directly which step succeeded or failed.

    Why

    The caller can run the needed operations and handle evaluation separately.

    Changed rules Pass values through a bounded guest boundary →Read a completed evaluation and preserve its failure class →Keep portable receipts, profile work, and authentication distinct →

    A Lispex request is an immutable snapshot once identified

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    A host can change a value after using it to form a request. Reusing the same identity for different input would make that request unstable.

    Decision

    Canonical byte exchange and host Datum construction preserve exact values within explicit conversion budgets. An identified request is an immutable snapshot.

    Alternatives considered

    • Share the host value directly. A request identity could refer to a value that changed later.

    Why

    The same input can be checked when executing or replaying an identified request.

    Changed rules Exchange exact immutable Datum values →

    A Lispex package becomes usable after admission

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    A package has required components and resource contracts. Discovering a missing input on the first call delays failure until use.

    Decision

    Verify every supplied component and resource contract before returning a usable package handle.

    Alternatives considered

    • Discover components on every call. Each call would decide again whether the same package is complete and usable.

    Why

    Callers receive a checked package before starting follow-up work.

    Changed rules Admit complete packages without ambient authority →

    Transported Lispex code goes through admission again

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    A rule prepared in one environment can travel to another. Preparation alone does not establish what bytes arrived.

    Decision

    Preparation produces an immutable verified rule under its own finite budget. Transported code always goes through admission again.

    Alternatives considered

    • Trust transported code because it was prepared earlier. The receiver could not establish that it received the same validated input.

    Why

    Preparation and transport have explicit verification boundaries.

    Changed rules Prepare closed source and revalidate transported rules →

    Lispex distinguishes completed evaluation from a failed attempt

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    An evaluation can finish with a language error, or be prevented from finishing at all. A caller needs to tell those cases apart.

    Decision

    A completed evaluation returns the canonical settlement. Admission or execution that prevents completion returns a separate attempt error.

    Alternatives considered

    • Mix every report into the settlement. The result shape would not tell the caller whether evaluation completed.

    Why

    Callers can handle a completed evaluation differently from an unsuccessful attempt.

    Changed rules Read a completed evaluation and preserve its failure class →

    Lispex uses distinct identities for requests, sources and execution

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    The same request can come from a different source or run with different engine bytes. One combined identity hides which part changed.

    Decision

    Give semantic requests, source provenance, engine bytes and profile host work distinct typed identities.

    Alternatives considered

    • Combine all identity domains into one. A change in the request would be hard to distinguish from a change in its surroundings.

    Why

    Request equality and execution provenance can be checked separately.

    Changed rules Identify source, programs, requests, artifacts, and profile work →

    Lispex replay checks a new result against the recorded result

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    Replaying a stored evaluation requires checking that the request is the one intended. It answers a different question from artifact inspection or authentication.

    Decision

    freshReplay verifies the stored request before execution and succeeds when the new settlement matches the recorded one.

    Alternatives considered

    • Combine replay, artifact inspection and authentication. The outcome of rerunning the request would be mixed with the outcome of external checks.

    Why

    The replay establishes which request was run and whether its result matched.

    Changed rules Replay a complete request and compare the whole outcome →

    Lispex evaluation results survive follow-up verification

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    A caller can check a profile or artifact after evaluation. Failure of that check need not change the language outcome already obtained.

    Decision

    Keep the canonical evaluation result and report profile qualification, artifact verification and issuer authentication separately.

    Alternatives considered

    • Erase the language outcome when a follow-up check rejects. The caller could not distinguish evaluation from a separate verification decision.

    Why

    The result remains available with a clear report of the check that failed.

    Changed rules Keep portable receipts, profile work, and authentication distinct →

    Lispex phases use separate finite resource limits

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    Preparation, evaluation and host work can consume different resources. A single limit obscures which phase exceeded its budget first.

    Decision

    Use complete finite limit records for preparation, evaluation and host work. Preserve the first resource failure in the defined order.

    Alternatives considered

    • Share one limit across phases. The failing phase and its exhausted budget would be hard to identify.

    Why

    A resource failure can be traced to its stage and limits.

    Changed rules Apply finite budgets in the declared resource order →

    Lispex factories produce ordinary immutable rules

    Adopted November 8, 2026 · 6.0.0 · Being verified

    Problem

    A generated factory needs known inputs and bounds when it creates a rule. A caller also needs to run the result like a handwritten rule.

    Decision

    Use verified lock entries and explicit preparation limits to produce the standard immutable rule form.

    Alternatives considered

    • Give factory-produced rules separate evaluation semantics. The same rule would execute differently depending on how it was made.

    Why

    Prepared rules use the same evaluation path regardless of how they were created.

    Changed rules Resolve generated factories through the admitted lock →

    Strings can be split into grapheme clusters

    Adopted November 7, 2026 · 6.0.0 · In progress

    Problem

    One visible character can include more than one code point. Iterating over scalars can split it in the middle.

    Decision

    • string.graphemes() splits a string into an array using Unicode 16 grapheme boundaries.
    • Scalar operations remain available. Splitting does not normalize the underlying string data.

    Examples

    Segment combining text, Hangul, and emoji

    main.tpzSegment combining text, Hangul, and emoji
    1. import std.io
    2. let text = "é가👩‍💻🇰🇷"
    3. let clusters: Array<string> = text.graphemes()
    4. io.writeLine("{text.scalars().length}:{clusters.length}")
    5. io.writeLine(clusters.join("|"))
    6. io.writeLine("{clusters.join("") == text}")
    Expected outputExit code 0
    9:4
    é|가|👩‍💻|🇰🇷
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 9:4
    2. é|가|👩‍💻|🇰🇷
    3. true

    Keep empty text, CRLF, leading marks, and odd regional indicators distinct

    main.tpzKeep empty text, CRLF, leading marks, and odd regional indicators distinct
    1. import std.io
    2. for text in (["", "\r\n", "̈́A", "🇰🇷🇯"]) {
    3. let clusters = text.graphemes()
    4. io.writeLine("{clusters.length}:{clusters.join("") == text}")
    5. }
    Expected outputExit code 0
    0:true
    1:true
    2:true
    2:true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0:true
    2. 1:true
    3. 2:true
    4. 2:true

    Preserve decomposed and precomposed text exactly

    main.tpzPreserve decomposed and precomposed text exactly
    1. import std.io
    2. let decomposed = "é"
    3. let precomposed = "é"
    4. let text = decomposed + precomposed
    5. let clusters = text.graphemes()
    6. io.writeLine("{clusters.length}")
    7. io.writeLine("{clusters[0] == decomposed}")
    8. io.writeLine("{clusters[1] == precomposed}")
    9. io.writeLine("{clusters.join("") == text}")
    10. io.writeLine("{decomposed == precomposed}")
    Expected outputExit code 0
    2
    true
    true
    true
    false
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 2
    2. true
    3. true
    4. true
    5. false

    Check every published Unicode 16 grapheme test row

    main.tpzCheck every published Unicode 16 grapheme test row
    1. import std.io
    2. import graphemecases0
    3. import graphemecases1
    4. import graphemecases2
    5. import graphemecases3
    6. import graphemecases4
    7. import graphemecases5
    8. import graphemecases6
    9. import graphemecases7
    10. import graphemecases8
    11. import graphemecases9
    12. import graphemecases10
    13. import graphemecases11
    14. import graphemecases12
    15. import graphemecases13
    16. import graphemecases14
    17. import graphemecases15
    18. import graphemecases16
    19. import graphemecases17
    20. let mut failures = 0
    21. failures += graphemecases0.run()
    22. failures += graphemecases1.run()
    23. failures += graphemecases2.run()
    24. failures += graphemecases3.run()
    25. failures += graphemecases4.run()
    26. failures += graphemecases5.run()
    27. failures += graphemecases6.run()
    28. failures += graphemecases7.run()
    29. failures += graphemecases8.run()
    30. failures += graphemecases9.run()
    31. failures += graphemecases10.run()
    32. failures += graphemecases11.run()
    33. failures += graphemecases12.run()
    34. failures += graphemecases13.run()
    35. failures += graphemecases14.run()
    36. failures += graphemecases15.run()
    37. failures += graphemecases16.run()
    38. failures += graphemecases17.run()
    39. if (failures == 0) { io.writeLine("Unicode 16.0.0 grapheme corpus passed") }
    Expected outputExit code 0
    Unicode 16.0.0 grapheme corpus passed
    
    $ topaz run main.tpz --language-version 6.0
    graphemesupport.tpzCheck every published Unicode 16 grapheme test row
    1. import std.io
    2. function agrees(input: string, expected: Array<string>) -> bool {
    3. let actual: Array<string> = input.graphemes()
    4. if (actual.length != expected.length) { return false }
    5. if (actual.join("") != input) { return false }
    6. for index in (0..<expected.length) {
    7. if (actual[index] != expected[index]) { return false }
    8. }
    9. true
    10. }
    11. export function checkCase(line: int, input: string, expected: Array<string>) -> int {
    12. if (agrees(input, expected)) { return 0 }
    13. io.writeLine("GraphemeBreakTest line {line} failed")
    14. 1
    15. }
    graphemecases0.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(25, " ", [" ", " "])
    5. failures += checkCase(26, " ̈ ", [" ̈", " "])
    6. failures += checkCase(27, " \r", [" ", "\r"])
    7. failures += checkCase(28, " ̈\r", [" ̈", "\r"])
    8. failures += checkCase(29, " \n", [" ", "\n"])
    9. failures += checkCase(30, " ̈\n", [" ̈", "\n"])
    10. failures += checkCase(31, " ", [" ", ""])
    11. failures += checkCase(32, " ̈", [" ̈", ""])
    12. failures += checkCase(33, " ‌", [" ‌"])
    13. failures += checkCase(34, " ̈‌", [" ̈‌"])
    14. failures += checkCase(35, " 🇦", [" ", "🇦"])
    15. failures += checkCase(36, " ̈🇦", [" ̈", "🇦"])
    16. failures += checkCase(37, " ؀", [" ", "؀"])
    17. failures += checkCase(38, " ̈؀", [" ̈", "؀"])
    18. failures += checkCase(39, " ਃ", [" ਃ"])
    19. failures += checkCase(40, " ̈ਃ", [" ̈ਃ"])
    20. failures += checkCase(41, " ᄀ", [" ", "ᄀ"])
    21. failures += checkCase(42, " ̈ᄀ", [" ̈", "ᄀ"])
    22. failures += checkCase(43, " ᅠ", [" ", "ᅠ"])
    23. failures += checkCase(44, " ̈ᅠ", [" ̈", "ᅠ"])
    24. failures += checkCase(45, " ᆨ", [" ", "ᆨ"])
    25. failures += checkCase(46, " ̈ᆨ", [" ̈", "ᆨ"])
    26. failures += checkCase(47, " 가", [" ", "가"])
    27. failures += checkCase(48, " ̈가", [" ̈", "가"])
    28. failures += checkCase(49, " 각", [" ", "각"])
    29. failures += checkCase(50, " ̈각", [" ̈", "각"])
    30. failures += checkCase(51, " ः", [" ः"])
    31. failures += checkCase(52, " ̈ः", [" ̈ः"])
    32. failures += checkCase(53, " ऄ", [" ", "ऄ"])
    33. failures += checkCase(54, " ̈ऄ", [" ̈", "ऄ"])
    34. failures += checkCase(55, " ൎ", [" ", "ൎ"])
    35. failures += checkCase(56, " ̈ൎ", [" ̈", "ൎ"])
    36. failures += checkCase(57, " क", [" ", "क"])
    37. failures += checkCase(58, " ̈क", [" ̈", "क"])
    38. failures += checkCase(59, " ⌚", [" ", "⌚"])
    39. failures += checkCase(60, " ̈⌚", [" ̈", "⌚"])
    40. failures += checkCase(61, " ̀", [" ̀"])
    41. failures += checkCase(62, " ̈̀", [" ̈̀"])
    42. failures += checkCase(63, " ऀ", [" ऀ"])
    43. failures += checkCase(64, " ̈ऀ", [" ̈ऀ"])
    44. failures += checkCase(65, " ्", [" ्"])
    45. failures += checkCase(66, " ्̈", [" ्̈"])
    46. failures += checkCase(67, " ‍", [" ‍"])
    47. failures += checkCase(68, " ̈‍", [" ̈‍"])
    48. failures += checkCase(69, " ͸", [" ", "͸"])
    49. failures += checkCase(70, " ̈͸", [" ̈", "͸"])
    50. failures += checkCase(71, "\r ", ["\r", " "])
    51. failures += checkCase(72, "\r̈ ", ["\r", "̈", " "])
    52. failures += checkCase(73, "\r\r", ["\r", "\r"])
    53. failures += checkCase(74, "\r̈\r", ["\r", "̈", "\r"])
    54. failures += checkCase(75, "\r\n", ["\r\n"])
    55. failures += checkCase(76, "\r̈\n", ["\r", "̈", "\n"])
    56. failures += checkCase(77, "\r", ["\r", ""])
    57. failures += checkCase(78, "\r̈", ["\r", "̈", ""])
    58. failures += checkCase(79, "\r‌", ["\r", "‌"])
    59. failures += checkCase(80, "\r̈‌", ["\r", "̈‌"])
    60. failures += checkCase(81, "\r🇦", ["\r", "🇦"])
    61. failures += checkCase(82, "\r̈🇦", ["\r", "̈", "🇦"])
    62. failures += checkCase(83, "\r؀", ["\r", "؀"])
    63. failures += checkCase(84, "\r̈؀", ["\r", "̈", "؀"])
    64. failures += checkCase(85, "\rਃ", ["\r", "ਃ"])
    65. failures += checkCase(86, "\r̈ਃ", ["\r", "̈ਃ"])
    66. failures += checkCase(87, "\rᄀ", ["\r", "ᄀ"])
    67. failures += checkCase(88, "\r̈ᄀ", ["\r", "̈", "ᄀ"])
    68. failures
    69. }
    graphemecases1.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(89, "\rᅠ", ["\r", "ᅠ"])
    5. failures += checkCase(90, "\r̈ᅠ", ["\r", "̈", "ᅠ"])
    6. failures += checkCase(91, "\rᆨ", ["\r", "ᆨ"])
    7. failures += checkCase(92, "\r̈ᆨ", ["\r", "̈", "ᆨ"])
    8. failures += checkCase(93, "\r가", ["\r", "가"])
    9. failures += checkCase(94, "\r̈가", ["\r", "̈", "가"])
    10. failures += checkCase(95, "\r각", ["\r", "각"])
    11. failures += checkCase(96, "\r̈각", ["\r", "̈", "각"])
    12. failures += checkCase(97, "\rः", ["\r", "ः"])
    13. failures += checkCase(98, "\r̈ः", ["\r", "̈ः"])
    14. failures += checkCase(99, "\rऄ", ["\r", "ऄ"])
    15. failures += checkCase(100, "\r̈ऄ", ["\r", "̈", "ऄ"])
    16. failures += checkCase(101, "\rൎ", ["\r", "ൎ"])
    17. failures += checkCase(102, "\r̈ൎ", ["\r", "̈", "ൎ"])
    18. failures += checkCase(103, "\rक", ["\r", "क"])
    19. failures += checkCase(104, "\r̈क", ["\r", "̈", "क"])
    20. failures += checkCase(105, "\r⌚", ["\r", "⌚"])
    21. failures += checkCase(106, "\r̈⌚", ["\r", "̈", "⌚"])
    22. failures += checkCase(107, "\r̀", ["\r", "̀"])
    23. failures += checkCase(108, "\r̈̀", ["\r", "̈̀"])
    24. failures += checkCase(109, "\rऀ", ["\r", "ऀ"])
    25. failures += checkCase(110, "\r̈ऀ", ["\r", "̈ऀ"])
    26. failures += checkCase(111, "\r्", ["\r", "्"])
    27. failures += checkCase(112, "\r्̈", ["\r", "्̈"])
    28. failures += checkCase(113, "\r‍", ["\r", "‍"])
    29. failures += checkCase(114, "\r̈‍", ["\r", "̈‍"])
    30. failures += checkCase(115, "\r͸", ["\r", "͸"])
    31. failures += checkCase(116, "\r̈͸", ["\r", "̈", "͸"])
    32. failures += checkCase(117, "\n ", ["\n", " "])
    33. failures += checkCase(118, "\n̈ ", ["\n", "̈", " "])
    34. failures += checkCase(119, "\n\r", ["\n", "\r"])
    35. failures += checkCase(120, "\n̈\r", ["\n", "̈", "\r"])
    36. failures += checkCase(121, "\n\n", ["\n", "\n"])
    37. failures += checkCase(122, "\n̈\n", ["\n", "̈", "\n"])
    38. failures += checkCase(123, "\n", ["\n", ""])
    39. failures += checkCase(124, "\n̈", ["\n", "̈", ""])
    40. failures += checkCase(125, "\n‌", ["\n", "‌"])
    41. failures += checkCase(126, "\n̈‌", ["\n", "̈‌"])
    42. failures += checkCase(127, "\n🇦", ["\n", "🇦"])
    43. failures += checkCase(128, "\n̈🇦", ["\n", "̈", "🇦"])
    44. failures += checkCase(129, "\n؀", ["\n", "؀"])
    45. failures += checkCase(130, "\n̈؀", ["\n", "̈", "؀"])
    46. failures += checkCase(131, "\nਃ", ["\n", "ਃ"])
    47. failures += checkCase(132, "\n̈ਃ", ["\n", "̈ਃ"])
    48. failures += checkCase(133, "\nᄀ", ["\n", "ᄀ"])
    49. failures += checkCase(134, "\n̈ᄀ", ["\n", "̈", "ᄀ"])
    50. failures += checkCase(135, "\nᅠ", ["\n", "ᅠ"])
    51. failures += checkCase(136, "\n̈ᅠ", ["\n", "̈", "ᅠ"])
    52. failures += checkCase(137, "\nᆨ", ["\n", "ᆨ"])
    53. failures += checkCase(138, "\n̈ᆨ", ["\n", "̈", "ᆨ"])
    54. failures += checkCase(139, "\n가", ["\n", "가"])
    55. failures += checkCase(140, "\n̈가", ["\n", "̈", "가"])
    56. failures += checkCase(141, "\n각", ["\n", "각"])
    57. failures += checkCase(142, "\n̈각", ["\n", "̈", "각"])
    58. failures += checkCase(143, "\nः", ["\n", "ः"])
    59. failures += checkCase(144, "\n̈ः", ["\n", "̈ः"])
    60. failures += checkCase(145, "\nऄ", ["\n", "ऄ"])
    61. failures += checkCase(146, "\n̈ऄ", ["\n", "̈", "ऄ"])
    62. failures += checkCase(147, "\nൎ", ["\n", "ൎ"])
    63. failures += checkCase(148, "\n̈ൎ", ["\n", "̈", "ൎ"])
    64. failures += checkCase(149, "\nक", ["\n", "क"])
    65. failures += checkCase(150, "\n̈क", ["\n", "̈", "क"])
    66. failures += checkCase(151, "\n⌚", ["\n", "⌚"])
    67. failures += checkCase(152, "\n̈⌚", ["\n", "̈", "⌚"])
    68. failures
    69. }
    graphemecases2.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(153, "\ǹ", ["\n", "̀"])
    5. failures += checkCase(154, "\n̈̀", ["\n", "̈̀"])
    6. failures += checkCase(155, "\nऀ", ["\n", "ऀ"])
    7. failures += checkCase(156, "\n̈ऀ", ["\n", "̈ऀ"])
    8. failures += checkCase(157, "\n्", ["\n", "्"])
    9. failures += checkCase(158, "\n्̈", ["\n", "्̈"])
    10. failures += checkCase(159, "\n‍", ["\n", "‍"])
    11. failures += checkCase(160, "\n̈‍", ["\n", "̈‍"])
    12. failures += checkCase(161, "\n͸", ["\n", "͸"])
    13. failures += checkCase(162, "\n̈͸", ["\n", "̈", "͸"])
    14. failures += checkCase(163, " ", ["", " "])
    15. failures += checkCase(164, "̈ ", ["", "̈", " "])
    16. failures += checkCase(165, "\r", ["", "\r"])
    17. failures += checkCase(166, "̈\r", ["", "̈", "\r"])
    18. failures += checkCase(167, "\n", ["", "\n"])
    19. failures += checkCase(168, "̈\n", ["", "̈", "\n"])
    20. failures += checkCase(169, "", ["", ""])
    21. failures += checkCase(170, "̈", ["", "̈", ""])
    22. failures += checkCase(171, "‌", ["", "‌"])
    23. failures += checkCase(172, "̈‌", ["", "̈‌"])
    24. failures += checkCase(173, "🇦", ["", "🇦"])
    25. failures += checkCase(174, "̈🇦", ["", "̈", "🇦"])
    26. failures += checkCase(175, "؀", ["", "؀"])
    27. failures += checkCase(176, "̈؀", ["", "̈", "؀"])
    28. failures += checkCase(177, "ਃ", ["", "ਃ"])
    29. failures += checkCase(178, "̈ਃ", ["", "̈ਃ"])
    30. failures += checkCase(179, "ᄀ", ["", "ᄀ"])
    31. failures += checkCase(180, "̈ᄀ", ["", "̈", "ᄀ"])
    32. failures += checkCase(181, "ᅠ", ["", "ᅠ"])
    33. failures += checkCase(182, "̈ᅠ", ["", "̈", "ᅠ"])
    34. failures += checkCase(183, "ᆨ", ["", "ᆨ"])
    35. failures += checkCase(184, "̈ᆨ", ["", "̈", "ᆨ"])
    36. failures += checkCase(185, "가", ["", "가"])
    37. failures += checkCase(186, "̈가", ["", "̈", "가"])
    38. failures += checkCase(187, "각", ["", "각"])
    39. failures += checkCase(188, "̈각", ["", "̈", "각"])
    40. failures += checkCase(189, "ः", ["", "ः"])
    41. failures += checkCase(190, "̈ः", ["", "̈ः"])
    42. failures += checkCase(191, "ऄ", ["", "ऄ"])
    43. failures += checkCase(192, "̈ऄ", ["", "̈", "ऄ"])
    44. failures += checkCase(193, "ൎ", ["", "ൎ"])
    45. failures += checkCase(194, "̈ൎ", ["", "̈", "ൎ"])
    46. failures += checkCase(195, "क", ["", "क"])
    47. failures += checkCase(196, "̈क", ["", "̈", "क"])
    48. failures += checkCase(197, "⌚", ["", "⌚"])
    49. failures += checkCase(198, "̈⌚", ["", "̈", "⌚"])
    50. failures += checkCase(199, "̀", ["", "̀"])
    51. failures += checkCase(200, "̈̀", ["", "̈̀"])
    52. failures += checkCase(201, "ऀ", ["", "ऀ"])
    53. failures += checkCase(202, "̈ऀ", ["", "̈ऀ"])
    54. failures += checkCase(203, "्", ["", "्"])
    55. failures += checkCase(204, "्̈", ["", "्̈"])
    56. failures += checkCase(205, "‍", ["", "‍"])
    57. failures += checkCase(206, "̈‍", ["", "̈‍"])
    58. failures += checkCase(207, "͸", ["", "͸"])
    59. failures += checkCase(208, "̈͸", ["", "̈", "͸"])
    60. failures += checkCase(209, "‌ ", ["‌", " "])
    61. failures += checkCase(210, "‌̈ ", ["‌̈", " "])
    62. failures += checkCase(211, "‌\r", ["‌", "\r"])
    63. failures += checkCase(212, "‌̈\r", ["‌̈", "\r"])
    64. failures += checkCase(213, "‌\n", ["‌", "\n"])
    65. failures += checkCase(214, "‌̈\n", ["‌̈", "\n"])
    66. failures += checkCase(215, "‌", ["‌", ""])
    67. failures += checkCase(216, "‌̈", ["‌̈", ""])
    68. failures
    69. }
    graphemecases3.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(217, "‌‌", ["‌‌"])
    5. failures += checkCase(218, "‌̈‌", ["‌̈‌"])
    6. failures += checkCase(219, "‌🇦", ["‌", "🇦"])
    7. failures += checkCase(220, "‌̈🇦", ["‌̈", "🇦"])
    8. failures += checkCase(221, "‌؀", ["‌", "؀"])
    9. failures += checkCase(222, "‌̈؀", ["‌̈", "؀"])
    10. failures += checkCase(223, "‌ਃ", ["‌ਃ"])
    11. failures += checkCase(224, "‌̈ਃ", ["‌̈ਃ"])
    12. failures += checkCase(225, "‌ᄀ", ["‌", "ᄀ"])
    13. failures += checkCase(226, "‌̈ᄀ", ["‌̈", "ᄀ"])
    14. failures += checkCase(227, "‌ᅠ", ["‌", "ᅠ"])
    15. failures += checkCase(228, "‌̈ᅠ", ["‌̈", "ᅠ"])
    16. failures += checkCase(229, "‌ᆨ", ["‌", "ᆨ"])
    17. failures += checkCase(230, "‌̈ᆨ", ["‌̈", "ᆨ"])
    18. failures += checkCase(231, "‌가", ["‌", "가"])
    19. failures += checkCase(232, "‌̈가", ["‌̈", "가"])
    20. failures += checkCase(233, "‌각", ["‌", "각"])
    21. failures += checkCase(234, "‌̈각", ["‌̈", "각"])
    22. failures += checkCase(235, "‌ः", ["‌ः"])
    23. failures += checkCase(236, "‌̈ः", ["‌̈ः"])
    24. failures += checkCase(237, "‌ऄ", ["‌", "ऄ"])
    25. failures += checkCase(238, "‌̈ऄ", ["‌̈", "ऄ"])
    26. failures += checkCase(239, "‌ൎ", ["‌", "ൎ"])
    27. failures += checkCase(240, "‌̈ൎ", ["‌̈", "ൎ"])
    28. failures += checkCase(241, "‌क", ["‌", "क"])
    29. failures += checkCase(242, "‌̈क", ["‌̈", "क"])
    30. failures += checkCase(243, "‌⌚", ["‌", "⌚"])
    31. failures += checkCase(244, "‌̈⌚", ["‌̈", "⌚"])
    32. failures += checkCase(245, "‌̀", ["‌̀"])
    33. failures += checkCase(246, "‌̈̀", ["‌̈̀"])
    34. failures += checkCase(247, "‌ऀ", ["‌ऀ"])
    35. failures += checkCase(248, "‌̈ऀ", ["‌̈ऀ"])
    36. failures += checkCase(249, "‌्", ["‌्"])
    37. failures += checkCase(250, "‌्̈", ["‌्̈"])
    38. failures += checkCase(251, "‌‍", ["‌‍"])
    39. failures += checkCase(252, "‌̈‍", ["‌̈‍"])
    40. failures += checkCase(253, "‌͸", ["‌", "͸"])
    41. failures += checkCase(254, "‌̈͸", ["‌̈", "͸"])
    42. failures += checkCase(255, "🇦 ", ["🇦", " "])
    43. failures += checkCase(256, "🇦̈ ", ["🇦̈", " "])
    44. failures += checkCase(257, "🇦\r", ["🇦", "\r"])
    45. failures += checkCase(258, "🇦̈\r", ["🇦̈", "\r"])
    46. failures += checkCase(259, "🇦\n", ["🇦", "\n"])
    47. failures += checkCase(260, "🇦̈\n", ["🇦̈", "\n"])
    48. failures += checkCase(261, "🇦", ["🇦", ""])
    49. failures += checkCase(262, "🇦̈", ["🇦̈", ""])
    50. failures += checkCase(263, "🇦‌", ["🇦‌"])
    51. failures += checkCase(264, "🇦̈‌", ["🇦̈‌"])
    52. failures += checkCase(265, "🇦🇦", ["🇦🇦"])
    53. failures += checkCase(266, "🇦̈🇦", ["🇦̈", "🇦"])
    54. failures += checkCase(267, "🇦؀", ["🇦", "؀"])
    55. failures += checkCase(268, "🇦̈؀", ["🇦̈", "؀"])
    56. failures += checkCase(269, "🇦ਃ", ["🇦ਃ"])
    57. failures += checkCase(270, "🇦̈ਃ", ["🇦̈ਃ"])
    58. failures += checkCase(271, "🇦ᄀ", ["🇦", "ᄀ"])
    59. failures += checkCase(272, "🇦̈ᄀ", ["🇦̈", "ᄀ"])
    60. failures += checkCase(273, "🇦ᅠ", ["🇦", "ᅠ"])
    61. failures += checkCase(274, "🇦̈ᅠ", ["🇦̈", "ᅠ"])
    62. failures += checkCase(275, "🇦ᆨ", ["🇦", "ᆨ"])
    63. failures += checkCase(276, "🇦̈ᆨ", ["🇦̈", "ᆨ"])
    64. failures += checkCase(277, "🇦가", ["🇦", "가"])
    65. failures += checkCase(278, "🇦̈가", ["🇦̈", "가"])
    66. failures += checkCase(279, "🇦각", ["🇦", "각"])
    67. failures += checkCase(280, "🇦̈각", ["🇦̈", "각"])
    68. failures
    69. }
    graphemecases4.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(281, "🇦ः", ["🇦ः"])
    5. failures += checkCase(282, "🇦̈ः", ["🇦̈ः"])
    6. failures += checkCase(283, "🇦ऄ", ["🇦", "ऄ"])
    7. failures += checkCase(284, "🇦̈ऄ", ["🇦̈", "ऄ"])
    8. failures += checkCase(285, "🇦ൎ", ["🇦", "ൎ"])
    9. failures += checkCase(286, "🇦̈ൎ", ["🇦̈", "ൎ"])
    10. failures += checkCase(287, "🇦क", ["🇦", "क"])
    11. failures += checkCase(288, "🇦̈क", ["🇦̈", "क"])
    12. failures += checkCase(289, "🇦⌚", ["🇦", "⌚"])
    13. failures += checkCase(290, "🇦̈⌚", ["🇦̈", "⌚"])
    14. failures += checkCase(291, "🇦̀", ["🇦̀"])
    15. failures += checkCase(292, "🇦̈̀", ["🇦̈̀"])
    16. failures += checkCase(293, "🇦ऀ", ["🇦ऀ"])
    17. failures += checkCase(294, "🇦̈ऀ", ["🇦̈ऀ"])
    18. failures += checkCase(295, "🇦्", ["🇦्"])
    19. failures += checkCase(296, "🇦्̈", ["🇦्̈"])
    20. failures += checkCase(297, "🇦‍", ["🇦‍"])
    21. failures += checkCase(298, "🇦̈‍", ["🇦̈‍"])
    22. failures += checkCase(299, "🇦͸", ["🇦", "͸"])
    23. failures += checkCase(300, "🇦̈͸", ["🇦̈", "͸"])
    24. failures += checkCase(301, "؀ ", ["؀ "])
    25. failures += checkCase(302, "؀̈ ", ["؀̈", " "])
    26. failures += checkCase(303, "؀\r", ["؀", "\r"])
    27. failures += checkCase(304, "؀̈\r", ["؀̈", "\r"])
    28. failures += checkCase(305, "؀\n", ["؀", "\n"])
    29. failures += checkCase(306, "؀̈\n", ["؀̈", "\n"])
    30. failures += checkCase(307, "؀", ["؀", ""])
    31. failures += checkCase(308, "؀̈", ["؀̈", ""])
    32. failures += checkCase(309, "؀‌", ["؀‌"])
    33. failures += checkCase(310, "؀̈‌", ["؀̈‌"])
    34. failures += checkCase(311, "؀🇦", ["؀🇦"])
    35. failures += checkCase(312, "؀̈🇦", ["؀̈", "🇦"])
    36. failures += checkCase(313, "؀؀", ["؀؀"])
    37. failures += checkCase(314, "؀̈؀", ["؀̈", "؀"])
    38. failures += checkCase(315, "؀ਃ", ["؀ਃ"])
    39. failures += checkCase(316, "؀̈ਃ", ["؀̈ਃ"])
    40. failures += checkCase(317, "؀ᄀ", ["؀ᄀ"])
    41. failures += checkCase(318, "؀̈ᄀ", ["؀̈", "ᄀ"])
    42. failures += checkCase(319, "؀ᅠ", ["؀ᅠ"])
    43. failures += checkCase(320, "؀̈ᅠ", ["؀̈", "ᅠ"])
    44. failures += checkCase(321, "؀ᆨ", ["؀ᆨ"])
    45. failures += checkCase(322, "؀̈ᆨ", ["؀̈", "ᆨ"])
    46. failures += checkCase(323, "؀가", ["؀가"])
    47. failures += checkCase(324, "؀̈가", ["؀̈", "가"])
    48. failures += checkCase(325, "؀각", ["؀각"])
    49. failures += checkCase(326, "؀̈각", ["؀̈", "각"])
    50. failures += checkCase(327, "؀ः", ["؀ः"])
    51. failures += checkCase(328, "؀̈ः", ["؀̈ः"])
    52. failures += checkCase(329, "؀ऄ", ["؀ऄ"])
    53. failures += checkCase(330, "؀̈ऄ", ["؀̈", "ऄ"])
    54. failures += checkCase(331, "؀ൎ", ["؀ൎ"])
    55. failures += checkCase(332, "؀̈ൎ", ["؀̈", "ൎ"])
    56. failures += checkCase(333, "؀क", ["؀क"])
    57. failures += checkCase(334, "؀̈क", ["؀̈", "क"])
    58. failures += checkCase(335, "؀⌚", ["؀⌚"])
    59. failures += checkCase(336, "؀̈⌚", ["؀̈", "⌚"])
    60. failures += checkCase(337, "؀̀", ["؀̀"])
    61. failures += checkCase(338, "؀̈̀", ["؀̈̀"])
    62. failures += checkCase(339, "؀ऀ", ["؀ऀ"])
    63. failures += checkCase(340, "؀̈ऀ", ["؀̈ऀ"])
    64. failures += checkCase(341, "؀्", ["؀्"])
    65. failures += checkCase(342, "؀्̈", ["؀्̈"])
    66. failures += checkCase(343, "؀‍", ["؀‍"])
    67. failures += checkCase(344, "؀̈‍", ["؀̈‍"])
    68. failures
    69. }
    graphemecases5.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(345, "؀͸", ["؀͸"])
    5. failures += checkCase(346, "؀̈͸", ["؀̈", "͸"])
    6. failures += checkCase(347, "ਃ ", ["ਃ", " "])
    7. failures += checkCase(348, "ਃ̈ ", ["ਃ̈", " "])
    8. failures += checkCase(349, "ਃ\r", ["ਃ", "\r"])
    9. failures += checkCase(350, "ਃ̈\r", ["ਃ̈", "\r"])
    10. failures += checkCase(351, "ਃ\n", ["ਃ", "\n"])
    11. failures += checkCase(352, "ਃ̈\n", ["ਃ̈", "\n"])
    12. failures += checkCase(353, "ਃ", ["ਃ", ""])
    13. failures += checkCase(354, "ਃ̈", ["ਃ̈", ""])
    14. failures += checkCase(355, "ਃ‌", ["ਃ‌"])
    15. failures += checkCase(356, "ਃ̈‌", ["ਃ̈‌"])
    16. failures += checkCase(357, "ਃ🇦", ["ਃ", "🇦"])
    17. failures += checkCase(358, "ਃ̈🇦", ["ਃ̈", "🇦"])
    18. failures += checkCase(359, "ਃ؀", ["ਃ", "؀"])
    19. failures += checkCase(360, "ਃ̈؀", ["ਃ̈", "؀"])
    20. failures += checkCase(361, "ਃਃ", ["ਃਃ"])
    21. failures += checkCase(362, "ਃ̈ਃ", ["ਃ̈ਃ"])
    22. failures += checkCase(363, "ਃᄀ", ["ਃ", "ᄀ"])
    23. failures += checkCase(364, "ਃ̈ᄀ", ["ਃ̈", "ᄀ"])
    24. failures += checkCase(365, "ਃᅠ", ["ਃ", "ᅠ"])
    25. failures += checkCase(366, "ਃ̈ᅠ", ["ਃ̈", "ᅠ"])
    26. failures += checkCase(367, "ਃᆨ", ["ਃ", "ᆨ"])
    27. failures += checkCase(368, "ਃ̈ᆨ", ["ਃ̈", "ᆨ"])
    28. failures += checkCase(369, "ਃ가", ["ਃ", "가"])
    29. failures += checkCase(370, "ਃ̈가", ["ਃ̈", "가"])
    30. failures += checkCase(371, "ਃ각", ["ਃ", "각"])
    31. failures += checkCase(372, "ਃ̈각", ["ਃ̈", "각"])
    32. failures += checkCase(373, "ਃः", ["ਃः"])
    33. failures += checkCase(374, "ਃ̈ः", ["ਃ̈ः"])
    34. failures += checkCase(375, "ਃऄ", ["ਃ", "ऄ"])
    35. failures += checkCase(376, "ਃ̈ऄ", ["ਃ̈", "ऄ"])
    36. failures += checkCase(377, "ਃൎ", ["ਃ", "ൎ"])
    37. failures += checkCase(378, "ਃ̈ൎ", ["ਃ̈", "ൎ"])
    38. failures += checkCase(379, "ਃक", ["ਃ", "क"])
    39. failures += checkCase(380, "ਃ̈क", ["ਃ̈", "क"])
    40. failures += checkCase(381, "ਃ⌚", ["ਃ", "⌚"])
    41. failures += checkCase(382, "ਃ̈⌚", ["ਃ̈", "⌚"])
    42. failures += checkCase(383, "ਃ̀", ["ਃ̀"])
    43. failures += checkCase(384, "ਃ̈̀", ["ਃ̈̀"])
    44. failures += checkCase(385, "ਃऀ", ["ਃऀ"])
    45. failures += checkCase(386, "ਃ̈ऀ", ["ਃ̈ऀ"])
    46. failures += checkCase(387, "ਃ्", ["ਃ्"])
    47. failures += checkCase(388, "ਃ्̈", ["ਃ्̈"])
    48. failures += checkCase(389, "ਃ‍", ["ਃ‍"])
    49. failures += checkCase(390, "ਃ̈‍", ["ਃ̈‍"])
    50. failures += checkCase(391, "ਃ͸", ["ਃ", "͸"])
    51. failures += checkCase(392, "ਃ̈͸", ["ਃ̈", "͸"])
    52. failures += checkCase(393, "ᄀ ", ["ᄀ", " "])
    53. failures += checkCase(394, "ᄀ̈ ", ["ᄀ̈", " "])
    54. failures += checkCase(395, "ᄀ\r", ["ᄀ", "\r"])
    55. failures += checkCase(396, "ᄀ̈\r", ["ᄀ̈", "\r"])
    56. failures += checkCase(397, "ᄀ\n", ["ᄀ", "\n"])
    57. failures += checkCase(398, "ᄀ̈\n", ["ᄀ̈", "\n"])
    58. failures += checkCase(399, "ᄀ", ["ᄀ", ""])
    59. failures += checkCase(400, "ᄀ̈", ["ᄀ̈", ""])
    60. failures += checkCase(401, "ᄀ‌", ["ᄀ‌"])
    61. failures += checkCase(402, "ᄀ̈‌", ["ᄀ̈‌"])
    62. failures += checkCase(403, "ᄀ🇦", ["ᄀ", "🇦"])
    63. failures += checkCase(404, "ᄀ̈🇦", ["ᄀ̈", "🇦"])
    64. failures += checkCase(405, "ᄀ؀", ["ᄀ", "؀"])
    65. failures += checkCase(406, "ᄀ̈؀", ["ᄀ̈", "؀"])
    66. failures += checkCase(407, "ᄀਃ", ["ᄀਃ"])
    67. failures += checkCase(408, "ᄀ̈ਃ", ["ᄀ̈ਃ"])
    68. failures
    69. }
    graphemecases6.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(409, "ᄀᄀ", ["ᄀᄀ"])
    5. failures += checkCase(410, "ᄀ̈ᄀ", ["ᄀ̈", "ᄀ"])
    6. failures += checkCase(411, "ᄀᅠ", ["ᄀᅠ"])
    7. failures += checkCase(412, "ᄀ̈ᅠ", ["ᄀ̈", "ᅠ"])
    8. failures += checkCase(413, "ᄀᆨ", ["ᄀ", "ᆨ"])
    9. failures += checkCase(414, "ᄀ̈ᆨ", ["ᄀ̈", "ᆨ"])
    10. failures += checkCase(415, "ᄀ가", ["ᄀ가"])
    11. failures += checkCase(416, "ᄀ̈가", ["ᄀ̈", "가"])
    12. failures += checkCase(417, "ᄀ각", ["ᄀ각"])
    13. failures += checkCase(418, "ᄀ̈각", ["ᄀ̈", "각"])
    14. failures += checkCase(419, "ᄀः", ["ᄀः"])
    15. failures += checkCase(420, "ᄀ̈ः", ["ᄀ̈ः"])
    16. failures += checkCase(421, "ᄀऄ", ["ᄀ", "ऄ"])
    17. failures += checkCase(422, "ᄀ̈ऄ", ["ᄀ̈", "ऄ"])
    18. failures += checkCase(423, "ᄀൎ", ["ᄀ", "ൎ"])
    19. failures += checkCase(424, "ᄀ̈ൎ", ["ᄀ̈", "ൎ"])
    20. failures += checkCase(425, "ᄀक", ["ᄀ", "क"])
    21. failures += checkCase(426, "ᄀ̈क", ["ᄀ̈", "क"])
    22. failures += checkCase(427, "ᄀ⌚", ["ᄀ", "⌚"])
    23. failures += checkCase(428, "ᄀ̈⌚", ["ᄀ̈", "⌚"])
    24. failures += checkCase(429, "ᄀ̀", ["ᄀ̀"])
    25. failures += checkCase(430, "ᄀ̈̀", ["ᄀ̈̀"])
    26. failures += checkCase(431, "ᄀऀ", ["ᄀऀ"])
    27. failures += checkCase(432, "ᄀ̈ऀ", ["ᄀ̈ऀ"])
    28. failures += checkCase(433, "ᄀ्", ["ᄀ्"])
    29. failures += checkCase(434, "ᄀ्̈", ["ᄀ्̈"])
    30. failures += checkCase(435, "ᄀ‍", ["ᄀ‍"])
    31. failures += checkCase(436, "ᄀ̈‍", ["ᄀ̈‍"])
    32. failures += checkCase(437, "ᄀ͸", ["ᄀ", "͸"])
    33. failures += checkCase(438, "ᄀ̈͸", ["ᄀ̈", "͸"])
    34. failures += checkCase(439, "ᅠ ", ["ᅠ", " "])
    35. failures += checkCase(440, "ᅠ̈ ", ["ᅠ̈", " "])
    36. failures += checkCase(441, "ᅠ\r", ["ᅠ", "\r"])
    37. failures += checkCase(442, "ᅠ̈\r", ["ᅠ̈", "\r"])
    38. failures += checkCase(443, "ᅠ\n", ["ᅠ", "\n"])
    39. failures += checkCase(444, "ᅠ̈\n", ["ᅠ̈", "\n"])
    40. failures += checkCase(445, "ᅠ", ["ᅠ", ""])
    41. failures += checkCase(446, "ᅠ̈", ["ᅠ̈", ""])
    42. failures += checkCase(447, "ᅠ‌", ["ᅠ‌"])
    43. failures += checkCase(448, "ᅠ̈‌", ["ᅠ̈‌"])
    44. failures += checkCase(449, "ᅠ🇦", ["ᅠ", "🇦"])
    45. failures += checkCase(450, "ᅠ̈🇦", ["ᅠ̈", "🇦"])
    46. failures += checkCase(451, "ᅠ؀", ["ᅠ", "؀"])
    47. failures += checkCase(452, "ᅠ̈؀", ["ᅠ̈", "؀"])
    48. failures += checkCase(453, "ᅠਃ", ["ᅠਃ"])
    49. failures += checkCase(454, "ᅠ̈ਃ", ["ᅠ̈ਃ"])
    50. failures += checkCase(455, "ᅠᄀ", ["ᅠ", "ᄀ"])
    51. failures += checkCase(456, "ᅠ̈ᄀ", ["ᅠ̈", "ᄀ"])
    52. failures += checkCase(457, "ᅠᅠ", ["ᅠᅠ"])
    53. failures += checkCase(458, "ᅠ̈ᅠ", ["ᅠ̈", "ᅠ"])
    54. failures += checkCase(459, "ᅠᆨ", ["ᅠᆨ"])
    55. failures += checkCase(460, "ᅠ̈ᆨ", ["ᅠ̈", "ᆨ"])
    56. failures += checkCase(461, "ᅠ가", ["ᅠ", "가"])
    57. failures += checkCase(462, "ᅠ̈가", ["ᅠ̈", "가"])
    58. failures += checkCase(463, "ᅠ각", ["ᅠ", "각"])
    59. failures += checkCase(464, "ᅠ̈각", ["ᅠ̈", "각"])
    60. failures += checkCase(465, "ᅠः", ["ᅠः"])
    61. failures += checkCase(466, "ᅠ̈ः", ["ᅠ̈ः"])
    62. failures += checkCase(467, "ᅠऄ", ["ᅠ", "ऄ"])
    63. failures += checkCase(468, "ᅠ̈ऄ", ["ᅠ̈", "ऄ"])
    64. failures += checkCase(469, "ᅠൎ", ["ᅠ", "ൎ"])
    65. failures += checkCase(470, "ᅠ̈ൎ", ["ᅠ̈", "ൎ"])
    66. failures += checkCase(471, "ᅠक", ["ᅠ", "क"])
    67. failures += checkCase(472, "ᅠ̈क", ["ᅠ̈", "क"])
    68. failures
    69. }
    graphemecases7.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(473, "ᅠ⌚", ["ᅠ", "⌚"])
    5. failures += checkCase(474, "ᅠ̈⌚", ["ᅠ̈", "⌚"])
    6. failures += checkCase(475, "ᅠ̀", ["ᅠ̀"])
    7. failures += checkCase(476, "ᅠ̈̀", ["ᅠ̈̀"])
    8. failures += checkCase(477, "ᅠऀ", ["ᅠऀ"])
    9. failures += checkCase(478, "ᅠ̈ऀ", ["ᅠ̈ऀ"])
    10. failures += checkCase(479, "ᅠ्", ["ᅠ्"])
    11. failures += checkCase(480, "ᅠ्̈", ["ᅠ्̈"])
    12. failures += checkCase(481, "ᅠ‍", ["ᅠ‍"])
    13. failures += checkCase(482, "ᅠ̈‍", ["ᅠ̈‍"])
    14. failures += checkCase(483, "ᅠ͸", ["ᅠ", "͸"])
    15. failures += checkCase(484, "ᅠ̈͸", ["ᅠ̈", "͸"])
    16. failures += checkCase(485, "ᆨ ", ["ᆨ", " "])
    17. failures += checkCase(486, "ᆨ̈ ", ["ᆨ̈", " "])
    18. failures += checkCase(487, "ᆨ\r", ["ᆨ", "\r"])
    19. failures += checkCase(488, "ᆨ̈\r", ["ᆨ̈", "\r"])
    20. failures += checkCase(489, "ᆨ\n", ["ᆨ", "\n"])
    21. failures += checkCase(490, "ᆨ̈\n", ["ᆨ̈", "\n"])
    22. failures += checkCase(491, "ᆨ", ["ᆨ", ""])
    23. failures += checkCase(492, "ᆨ̈", ["ᆨ̈", ""])
    24. failures += checkCase(493, "ᆨ‌", ["ᆨ‌"])
    25. failures += checkCase(494, "ᆨ̈‌", ["ᆨ̈‌"])
    26. failures += checkCase(495, "ᆨ🇦", ["ᆨ", "🇦"])
    27. failures += checkCase(496, "ᆨ̈🇦", ["ᆨ̈", "🇦"])
    28. failures += checkCase(497, "ᆨ؀", ["ᆨ", "؀"])
    29. failures += checkCase(498, "ᆨ̈؀", ["ᆨ̈", "؀"])
    30. failures += checkCase(499, "ᆨਃ", ["ᆨਃ"])
    31. failures += checkCase(500, "ᆨ̈ਃ", ["ᆨ̈ਃ"])
    32. failures += checkCase(501, "ᆨᄀ", ["ᆨ", "ᄀ"])
    33. failures += checkCase(502, "ᆨ̈ᄀ", ["ᆨ̈", "ᄀ"])
    34. failures += checkCase(503, "ᆨᅠ", ["ᆨ", "ᅠ"])
    35. failures += checkCase(504, "ᆨ̈ᅠ", ["ᆨ̈", "ᅠ"])
    36. failures += checkCase(505, "ᆨᆨ", ["ᆨᆨ"])
    37. failures += checkCase(506, "ᆨ̈ᆨ", ["ᆨ̈", "ᆨ"])
    38. failures += checkCase(507, "ᆨ가", ["ᆨ", "가"])
    39. failures += checkCase(508, "ᆨ̈가", ["ᆨ̈", "가"])
    40. failures += checkCase(509, "ᆨ각", ["ᆨ", "각"])
    41. failures += checkCase(510, "ᆨ̈각", ["ᆨ̈", "각"])
    42. failures += checkCase(511, "ᆨः", ["ᆨः"])
    43. failures += checkCase(512, "ᆨ̈ः", ["ᆨ̈ः"])
    44. failures += checkCase(513, "ᆨऄ", ["ᆨ", "ऄ"])
    45. failures += checkCase(514, "ᆨ̈ऄ", ["ᆨ̈", "ऄ"])
    46. failures += checkCase(515, "ᆨൎ", ["ᆨ", "ൎ"])
    47. failures += checkCase(516, "ᆨ̈ൎ", ["ᆨ̈", "ൎ"])
    48. failures += checkCase(517, "ᆨक", ["ᆨ", "क"])
    49. failures += checkCase(518, "ᆨ̈क", ["ᆨ̈", "क"])
    50. failures += checkCase(519, "ᆨ⌚", ["ᆨ", "⌚"])
    51. failures += checkCase(520, "ᆨ̈⌚", ["ᆨ̈", "⌚"])
    52. failures += checkCase(521, "ᆨ̀", ["ᆨ̀"])
    53. failures += checkCase(522, "ᆨ̈̀", ["ᆨ̈̀"])
    54. failures += checkCase(523, "ᆨऀ", ["ᆨऀ"])
    55. failures += checkCase(524, "ᆨ̈ऀ", ["ᆨ̈ऀ"])
    56. failures += checkCase(525, "ᆨ्", ["ᆨ्"])
    57. failures += checkCase(526, "ᆨ्̈", ["ᆨ्̈"])
    58. failures += checkCase(527, "ᆨ‍", ["ᆨ‍"])
    59. failures += checkCase(528, "ᆨ̈‍", ["ᆨ̈‍"])
    60. failures += checkCase(529, "ᆨ͸", ["ᆨ", "͸"])
    61. failures += checkCase(530, "ᆨ̈͸", ["ᆨ̈", "͸"])
    62. failures += checkCase(531, "가 ", ["가", " "])
    63. failures += checkCase(532, "가̈ ", ["가̈", " "])
    64. failures += checkCase(533, "가\r", ["가", "\r"])
    65. failures += checkCase(534, "가̈\r", ["가̈", "\r"])
    66. failures += checkCase(535, "가\n", ["가", "\n"])
    67. failures += checkCase(536, "가̈\n", ["가̈", "\n"])
    68. failures
    69. }
    graphemecases8.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(537, "가", ["가", ""])
    5. failures += checkCase(538, "가̈", ["가̈", ""])
    6. failures += checkCase(539, "가‌", ["가‌"])
    7. failures += checkCase(540, "가̈‌", ["가̈‌"])
    8. failures += checkCase(541, "가🇦", ["가", "🇦"])
    9. failures += checkCase(542, "가̈🇦", ["가̈", "🇦"])
    10. failures += checkCase(543, "가؀", ["가", "؀"])
    11. failures += checkCase(544, "가̈؀", ["가̈", "؀"])
    12. failures += checkCase(545, "가ਃ", ["가ਃ"])
    13. failures += checkCase(546, "가̈ਃ", ["가̈ਃ"])
    14. failures += checkCase(547, "가ᄀ", ["가", "ᄀ"])
    15. failures += checkCase(548, "가̈ᄀ", ["가̈", "ᄀ"])
    16. failures += checkCase(549, "가ᅠ", ["가ᅠ"])
    17. failures += checkCase(550, "가̈ᅠ", ["가̈", "ᅠ"])
    18. failures += checkCase(551, "각", ["각"])
    19. failures += checkCase(552, "가̈ᆨ", ["가̈", "ᆨ"])
    20. failures += checkCase(553, "가가", ["가", "가"])
    21. failures += checkCase(554, "가̈가", ["가̈", "가"])
    22. failures += checkCase(555, "가각", ["가", "각"])
    23. failures += checkCase(556, "가̈각", ["가̈", "각"])
    24. failures += checkCase(557, "가ः", ["가ः"])
    25. failures += checkCase(558, "가̈ः", ["가̈ः"])
    26. failures += checkCase(559, "가ऄ", ["가", "ऄ"])
    27. failures += checkCase(560, "가̈ऄ", ["가̈", "ऄ"])
    28. failures += checkCase(561, "가ൎ", ["가", "ൎ"])
    29. failures += checkCase(562, "가̈ൎ", ["가̈", "ൎ"])
    30. failures += checkCase(563, "가क", ["가", "क"])
    31. failures += checkCase(564, "가̈क", ["가̈", "क"])
    32. failures += checkCase(565, "가⌚", ["가", "⌚"])
    33. failures += checkCase(566, "가̈⌚", ["가̈", "⌚"])
    34. failures += checkCase(567, "가̀", ["가̀"])
    35. failures += checkCase(568, "가̈̀", ["가̈̀"])
    36. failures += checkCase(569, "가ऀ", ["가ऀ"])
    37. failures += checkCase(570, "가̈ऀ", ["가̈ऀ"])
    38. failures += checkCase(571, "가्", ["가्"])
    39. failures += checkCase(572, "가्̈", ["가्̈"])
    40. failures += checkCase(573, "가‍", ["가‍"])
    41. failures += checkCase(574, "가̈‍", ["가̈‍"])
    42. failures += checkCase(575, "가͸", ["가", "͸"])
    43. failures += checkCase(576, "가̈͸", ["가̈", "͸"])
    44. failures += checkCase(577, "각 ", ["각", " "])
    45. failures += checkCase(578, "각̈ ", ["각̈", " "])
    46. failures += checkCase(579, "각\r", ["각", "\r"])
    47. failures += checkCase(580, "각̈\r", ["각̈", "\r"])
    48. failures += checkCase(581, "각\n", ["각", "\n"])
    49. failures += checkCase(582, "각̈\n", ["각̈", "\n"])
    50. failures += checkCase(583, "각", ["각", ""])
    51. failures += checkCase(584, "각̈", ["각̈", ""])
    52. failures += checkCase(585, "각‌", ["각‌"])
    53. failures += checkCase(586, "각̈‌", ["각̈‌"])
    54. failures += checkCase(587, "각🇦", ["각", "🇦"])
    55. failures += checkCase(588, "각̈🇦", ["각̈", "🇦"])
    56. failures += checkCase(589, "각؀", ["각", "؀"])
    57. failures += checkCase(590, "각̈؀", ["각̈", "؀"])
    58. failures += checkCase(591, "각ਃ", ["각ਃ"])
    59. failures += checkCase(592, "각̈ਃ", ["각̈ਃ"])
    60. failures += checkCase(593, "각ᄀ", ["각", "ᄀ"])
    61. failures += checkCase(594, "각̈ᄀ", ["각̈", "ᄀ"])
    62. failures += checkCase(595, "각ᅠ", ["각", "ᅠ"])
    63. failures += checkCase(596, "각̈ᅠ", ["각̈", "ᅠ"])
    64. failures += checkCase(597, "각ᆨ", ["각ᆨ"])
    65. failures += checkCase(598, "각̈ᆨ", ["각̈", "ᆨ"])
    66. failures += checkCase(599, "각가", ["각", "가"])
    67. failures += checkCase(600, "각̈가", ["각̈", "가"])
    68. failures
    69. }
    graphemecases9.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(601, "각각", ["각", "각"])
    5. failures += checkCase(602, "각̈각", ["각̈", "각"])
    6. failures += checkCase(603, "각ः", ["각ः"])
    7. failures += checkCase(604, "각̈ः", ["각̈ः"])
    8. failures += checkCase(605, "각ऄ", ["각", "ऄ"])
    9. failures += checkCase(606, "각̈ऄ", ["각̈", "ऄ"])
    10. failures += checkCase(607, "각ൎ", ["각", "ൎ"])
    11. failures += checkCase(608, "각̈ൎ", ["각̈", "ൎ"])
    12. failures += checkCase(609, "각क", ["각", "क"])
    13. failures += checkCase(610, "각̈क", ["각̈", "क"])
    14. failures += checkCase(611, "각⌚", ["각", "⌚"])
    15. failures += checkCase(612, "각̈⌚", ["각̈", "⌚"])
    16. failures += checkCase(613, "각̀", ["각̀"])
    17. failures += checkCase(614, "각̈̀", ["각̈̀"])
    18. failures += checkCase(615, "각ऀ", ["각ऀ"])
    19. failures += checkCase(616, "각̈ऀ", ["각̈ऀ"])
    20. failures += checkCase(617, "각्", ["각्"])
    21. failures += checkCase(618, "각्̈", ["각्̈"])
    22. failures += checkCase(619, "각‍", ["각‍"])
    23. failures += checkCase(620, "각̈‍", ["각̈‍"])
    24. failures += checkCase(621, "각͸", ["각", "͸"])
    25. failures += checkCase(622, "각̈͸", ["각̈", "͸"])
    26. failures += checkCase(623, "ः ", ["ः", " "])
    27. failures += checkCase(624, "ः̈ ", ["ः̈", " "])
    28. failures += checkCase(625, "ः\r", ["ः", "\r"])
    29. failures += checkCase(626, "ः̈\r", ["ः̈", "\r"])
    30. failures += checkCase(627, "ः\n", ["ः", "\n"])
    31. failures += checkCase(628, "ः̈\n", ["ः̈", "\n"])
    32. failures += checkCase(629, "ः", ["ः", ""])
    33. failures += checkCase(630, "ः̈", ["ः̈", ""])
    34. failures += checkCase(631, "ः‌", ["ः‌"])
    35. failures += checkCase(632, "ः̈‌", ["ः̈‌"])
    36. failures += checkCase(633, "ः🇦", ["ः", "🇦"])
    37. failures += checkCase(634, "ः̈🇦", ["ः̈", "🇦"])
    38. failures += checkCase(635, "ः؀", ["ः", "؀"])
    39. failures += checkCase(636, "ः̈؀", ["ः̈", "؀"])
    40. failures += checkCase(637, "ःਃ", ["ःਃ"])
    41. failures += checkCase(638, "ः̈ਃ", ["ः̈ਃ"])
    42. failures += checkCase(639, "ःᄀ", ["ः", "ᄀ"])
    43. failures += checkCase(640, "ः̈ᄀ", ["ः̈", "ᄀ"])
    44. failures += checkCase(641, "ःᅠ", ["ः", "ᅠ"])
    45. failures += checkCase(642, "ः̈ᅠ", ["ः̈", "ᅠ"])
    46. failures += checkCase(643, "ःᆨ", ["ः", "ᆨ"])
    47. failures += checkCase(644, "ः̈ᆨ", ["ः̈", "ᆨ"])
    48. failures += checkCase(645, "ः가", ["ः", "가"])
    49. failures += checkCase(646, "ः̈가", ["ः̈", "가"])
    50. failures += checkCase(647, "ः각", ["ः", "각"])
    51. failures += checkCase(648, "ः̈각", ["ः̈", "각"])
    52. failures += checkCase(649, "ःः", ["ःः"])
    53. failures += checkCase(650, "ः̈ः", ["ः̈ः"])
    54. failures += checkCase(651, "ःऄ", ["ः", "ऄ"])
    55. failures += checkCase(652, "ः̈ऄ", ["ः̈", "ऄ"])
    56. failures += checkCase(653, "ःൎ", ["ः", "ൎ"])
    57. failures += checkCase(654, "ः̈ൎ", ["ः̈", "ൎ"])
    58. failures += checkCase(655, "ःक", ["ः", "क"])
    59. failures += checkCase(656, "ः̈क", ["ः̈", "क"])
    60. failures += checkCase(657, "ः⌚", ["ः", "⌚"])
    61. failures += checkCase(658, "ः̈⌚", ["ः̈", "⌚"])
    62. failures += checkCase(659, "ः̀", ["ः̀"])
    63. failures += checkCase(660, "ः̈̀", ["ः̈̀"])
    64. failures += checkCase(661, "ःऀ", ["ःऀ"])
    65. failures += checkCase(662, "ः̈ऀ", ["ः̈ऀ"])
    66. failures += checkCase(663, "ः्", ["ः्"])
    67. failures += checkCase(664, "ः्̈", ["ः्̈"])
    68. failures
    69. }
    graphemecases10.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(665, "ः‍", ["ः‍"])
    5. failures += checkCase(666, "ः̈‍", ["ः̈‍"])
    6. failures += checkCase(667, "ः͸", ["ः", "͸"])
    7. failures += checkCase(668, "ः̈͸", ["ः̈", "͸"])
    8. failures += checkCase(669, "ऄ ", ["ऄ", " "])
    9. failures += checkCase(670, "ऄ̈ ", ["ऄ̈", " "])
    10. failures += checkCase(671, "ऄ\r", ["ऄ", "\r"])
    11. failures += checkCase(672, "ऄ̈\r", ["ऄ̈", "\r"])
    12. failures += checkCase(673, "ऄ\n", ["ऄ", "\n"])
    13. failures += checkCase(674, "ऄ̈\n", ["ऄ̈", "\n"])
    14. failures += checkCase(675, "ऄ", ["ऄ", ""])
    15. failures += checkCase(676, "ऄ̈", ["ऄ̈", ""])
    16. failures += checkCase(677, "ऄ‌", ["ऄ‌"])
    17. failures += checkCase(678, "ऄ̈‌", ["ऄ̈‌"])
    18. failures += checkCase(679, "ऄ🇦", ["ऄ", "🇦"])
    19. failures += checkCase(680, "ऄ̈🇦", ["ऄ̈", "🇦"])
    20. failures += checkCase(681, "ऄ؀", ["ऄ", "؀"])
    21. failures += checkCase(682, "ऄ̈؀", ["ऄ̈", "؀"])
    22. failures += checkCase(683, "ऄਃ", ["ऄਃ"])
    23. failures += checkCase(684, "ऄ̈ਃ", ["ऄ̈ਃ"])
    24. failures += checkCase(685, "ऄᄀ", ["ऄ", "ᄀ"])
    25. failures += checkCase(686, "ऄ̈ᄀ", ["ऄ̈", "ᄀ"])
    26. failures += checkCase(687, "ऄᅠ", ["ऄ", "ᅠ"])
    27. failures += checkCase(688, "ऄ̈ᅠ", ["ऄ̈", "ᅠ"])
    28. failures += checkCase(689, "ऄᆨ", ["ऄ", "ᆨ"])
    29. failures += checkCase(690, "ऄ̈ᆨ", ["ऄ̈", "ᆨ"])
    30. failures += checkCase(691, "ऄ가", ["ऄ", "가"])
    31. failures += checkCase(692, "ऄ̈가", ["ऄ̈", "가"])
    32. failures += checkCase(693, "ऄ각", ["ऄ", "각"])
    33. failures += checkCase(694, "ऄ̈각", ["ऄ̈", "각"])
    34. failures += checkCase(695, "ऄः", ["ऄः"])
    35. failures += checkCase(696, "ऄ̈ः", ["ऄ̈ः"])
    36. failures += checkCase(697, "ऄऄ", ["ऄ", "ऄ"])
    37. failures += checkCase(698, "ऄ̈ऄ", ["ऄ̈", "ऄ"])
    38. failures += checkCase(699, "ऄൎ", ["ऄ", "ൎ"])
    39. failures += checkCase(700, "ऄ̈ൎ", ["ऄ̈", "ൎ"])
    40. failures += checkCase(701, "ऄक", ["ऄ", "क"])
    41. failures += checkCase(702, "ऄ̈क", ["ऄ̈", "क"])
    42. failures += checkCase(703, "ऄ⌚", ["ऄ", "⌚"])
    43. failures += checkCase(704, "ऄ̈⌚", ["ऄ̈", "⌚"])
    44. failures += checkCase(705, "ऄ̀", ["ऄ̀"])
    45. failures += checkCase(706, "ऄ̈̀", ["ऄ̈̀"])
    46. failures += checkCase(707, "ऄऀ", ["ऄऀ"])
    47. failures += checkCase(708, "ऄ̈ऀ", ["ऄ̈ऀ"])
    48. failures += checkCase(709, "ऄ्", ["ऄ्"])
    49. failures += checkCase(710, "ऄ्̈", ["ऄ्̈"])
    50. failures += checkCase(711, "ऄ‍", ["ऄ‍"])
    51. failures += checkCase(712, "ऄ̈‍", ["ऄ̈‍"])
    52. failures += checkCase(713, "ऄ͸", ["ऄ", "͸"])
    53. failures += checkCase(714, "ऄ̈͸", ["ऄ̈", "͸"])
    54. failures += checkCase(715, "ൎ ", ["ൎ "])
    55. failures += checkCase(716, "ൎ̈ ", ["ൎ̈", " "])
    56. failures += checkCase(717, "ൎ\r", ["ൎ", "\r"])
    57. failures += checkCase(718, "ൎ̈\r", ["ൎ̈", "\r"])
    58. failures += checkCase(719, "ൎ\n", ["ൎ", "\n"])
    59. failures += checkCase(720, "ൎ̈\n", ["ൎ̈", "\n"])
    60. failures += checkCase(721, "ൎ", ["ൎ", ""])
    61. failures += checkCase(722, "ൎ̈", ["ൎ̈", ""])
    62. failures += checkCase(723, "ൎ‌", ["ൎ‌"])
    63. failures += checkCase(724, "ൎ̈‌", ["ൎ̈‌"])
    64. failures += checkCase(725, "ൎ🇦", ["ൎ🇦"])
    65. failures += checkCase(726, "ൎ̈🇦", ["ൎ̈", "🇦"])
    66. failures += checkCase(727, "ൎ؀", ["ൎ؀"])
    67. failures += checkCase(728, "ൎ̈؀", ["ൎ̈", "؀"])
    68. failures
    69. }
    graphemecases11.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(729, "ൎਃ", ["ൎਃ"])
    5. failures += checkCase(730, "ൎ̈ਃ", ["ൎ̈ਃ"])
    6. failures += checkCase(731, "ൎᄀ", ["ൎᄀ"])
    7. failures += checkCase(732, "ൎ̈ᄀ", ["ൎ̈", "ᄀ"])
    8. failures += checkCase(733, "ൎᅠ", ["ൎᅠ"])
    9. failures += checkCase(734, "ൎ̈ᅠ", ["ൎ̈", "ᅠ"])
    10. failures += checkCase(735, "ൎᆨ", ["ൎᆨ"])
    11. failures += checkCase(736, "ൎ̈ᆨ", ["ൎ̈", "ᆨ"])
    12. failures += checkCase(737, "ൎ가", ["ൎ가"])
    13. failures += checkCase(738, "ൎ̈가", ["ൎ̈", "가"])
    14. failures += checkCase(739, "ൎ각", ["ൎ각"])
    15. failures += checkCase(740, "ൎ̈각", ["ൎ̈", "각"])
    16. failures += checkCase(741, "ൎः", ["ൎः"])
    17. failures += checkCase(742, "ൎ̈ः", ["ൎ̈ः"])
    18. failures += checkCase(743, "ൎऄ", ["ൎऄ"])
    19. failures += checkCase(744, "ൎ̈ऄ", ["ൎ̈", "ऄ"])
    20. failures += checkCase(745, "ൎൎ", ["ൎൎ"])
    21. failures += checkCase(746, "ൎ̈ൎ", ["ൎ̈", "ൎ"])
    22. failures += checkCase(747, "ൎक", ["ൎक"])
    23. failures += checkCase(748, "ൎ̈क", ["ൎ̈", "क"])
    24. failures += checkCase(749, "ൎ⌚", ["ൎ⌚"])
    25. failures += checkCase(750, "ൎ̈⌚", ["ൎ̈", "⌚"])
    26. failures += checkCase(751, "ൎ̀", ["ൎ̀"])
    27. failures += checkCase(752, "ൎ̈̀", ["ൎ̈̀"])
    28. failures += checkCase(753, "ൎऀ", ["ൎऀ"])
    29. failures += checkCase(754, "ൎ̈ऀ", ["ൎ̈ऀ"])
    30. failures += checkCase(755, "ൎ्", ["ൎ्"])
    31. failures += checkCase(756, "ൎ्̈", ["ൎ्̈"])
    32. failures += checkCase(757, "ൎ‍", ["ൎ‍"])
    33. failures += checkCase(758, "ൎ̈‍", ["ൎ̈‍"])
    34. failures += checkCase(759, "ൎ͸", ["ൎ͸"])
    35. failures += checkCase(760, "ൎ̈͸", ["ൎ̈", "͸"])
    36. failures += checkCase(761, "क ", ["क", " "])
    37. failures += checkCase(762, "क̈ ", ["क̈", " "])
    38. failures += checkCase(763, "क\r", ["क", "\r"])
    39. failures += checkCase(764, "क̈\r", ["क̈", "\r"])
    40. failures += checkCase(765, "क\n", ["क", "\n"])
    41. failures += checkCase(766, "क̈\n", ["क̈", "\n"])
    42. failures += checkCase(767, "क", ["क", ""])
    43. failures += checkCase(768, "क̈", ["क̈", ""])
    44. failures += checkCase(769, "क‌", ["क‌"])
    45. failures += checkCase(770, "क̈‌", ["क̈‌"])
    46. failures += checkCase(771, "क🇦", ["क", "🇦"])
    47. failures += checkCase(772, "क̈🇦", ["क̈", "🇦"])
    48. failures += checkCase(773, "क؀", ["क", "؀"])
    49. failures += checkCase(774, "क̈؀", ["क̈", "؀"])
    50. failures += checkCase(775, "कਃ", ["कਃ"])
    51. failures += checkCase(776, "क̈ਃ", ["क̈ਃ"])
    52. failures += checkCase(777, "कᄀ", ["क", "ᄀ"])
    53. failures += checkCase(778, "क̈ᄀ", ["क̈", "ᄀ"])
    54. failures += checkCase(779, "कᅠ", ["क", "ᅠ"])
    55. failures += checkCase(780, "क̈ᅠ", ["क̈", "ᅠ"])
    56. failures += checkCase(781, "कᆨ", ["क", "ᆨ"])
    57. failures += checkCase(782, "क̈ᆨ", ["क̈", "ᆨ"])
    58. failures += checkCase(783, "क가", ["क", "가"])
    59. failures += checkCase(784, "क̈가", ["क̈", "가"])
    60. failures += checkCase(785, "क각", ["क", "각"])
    61. failures += checkCase(786, "क̈각", ["क̈", "각"])
    62. failures += checkCase(787, "कः", ["कः"])
    63. failures += checkCase(788, "क̈ः", ["क̈ः"])
    64. failures += checkCase(789, "कऄ", ["क", "ऄ"])
    65. failures += checkCase(790, "क̈ऄ", ["क̈", "ऄ"])
    66. failures += checkCase(791, "कൎ", ["क", "ൎ"])
    67. failures += checkCase(792, "क̈ൎ", ["क̈", "ൎ"])
    68. failures
    69. }
    graphemecases12.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(793, "कक", ["क", "क"])
    5. failures += checkCase(794, "क̈क", ["क̈", "क"])
    6. failures += checkCase(795, "क⌚", ["क", "⌚"])
    7. failures += checkCase(796, "क̈⌚", ["क̈", "⌚"])
    8. failures += checkCase(797, "क̀", ["क̀"])
    9. failures += checkCase(798, "क̈̀", ["क̈̀"])
    10. failures += checkCase(799, "कऀ", ["कऀ"])
    11. failures += checkCase(800, "क̈ऀ", ["क̈ऀ"])
    12. failures += checkCase(801, "क्", ["क्"])
    13. failures += checkCase(802, "क्̈", ["क्̈"])
    14. failures += checkCase(803, "क‍", ["क‍"])
    15. failures += checkCase(804, "क̈‍", ["क̈‍"])
    16. failures += checkCase(805, "क͸", ["क", "͸"])
    17. failures += checkCase(806, "क̈͸", ["क̈", "͸"])
    18. failures += checkCase(807, "⌚ ", ["⌚", " "])
    19. failures += checkCase(808, "⌚̈ ", ["⌚̈", " "])
    20. failures += checkCase(809, "⌚\r", ["⌚", "\r"])
    21. failures += checkCase(810, "⌚̈\r", ["⌚̈", "\r"])
    22. failures += checkCase(811, "⌚\n", ["⌚", "\n"])
    23. failures += checkCase(812, "⌚̈\n", ["⌚̈", "\n"])
    24. failures += checkCase(813, "⌚", ["⌚", ""])
    25. failures += checkCase(814, "⌚̈", ["⌚̈", ""])
    26. failures += checkCase(815, "⌚‌", ["⌚‌"])
    27. failures += checkCase(816, "⌚̈‌", ["⌚̈‌"])
    28. failures += checkCase(817, "⌚🇦", ["⌚", "🇦"])
    29. failures += checkCase(818, "⌚̈🇦", ["⌚̈", "🇦"])
    30. failures += checkCase(819, "⌚؀", ["⌚", "؀"])
    31. failures += checkCase(820, "⌚̈؀", ["⌚̈", "؀"])
    32. failures += checkCase(821, "⌚ਃ", ["⌚ਃ"])
    33. failures += checkCase(822, "⌚̈ਃ", ["⌚̈ਃ"])
    34. failures += checkCase(823, "⌚ᄀ", ["⌚", "ᄀ"])
    35. failures += checkCase(824, "⌚̈ᄀ", ["⌚̈", "ᄀ"])
    36. failures += checkCase(825, "⌚ᅠ", ["⌚", "ᅠ"])
    37. failures += checkCase(826, "⌚̈ᅠ", ["⌚̈", "ᅠ"])
    38. failures += checkCase(827, "⌚ᆨ", ["⌚", "ᆨ"])
    39. failures += checkCase(828, "⌚̈ᆨ", ["⌚̈", "ᆨ"])
    40. failures += checkCase(829, "⌚가", ["⌚", "가"])
    41. failures += checkCase(830, "⌚̈가", ["⌚̈", "가"])
    42. failures += checkCase(831, "⌚각", ["⌚", "각"])
    43. failures += checkCase(832, "⌚̈각", ["⌚̈", "각"])
    44. failures += checkCase(833, "⌚ः", ["⌚ः"])
    45. failures += checkCase(834, "⌚̈ः", ["⌚̈ः"])
    46. failures += checkCase(835, "⌚ऄ", ["⌚", "ऄ"])
    47. failures += checkCase(836, "⌚̈ऄ", ["⌚̈", "ऄ"])
    48. failures += checkCase(837, "⌚ൎ", ["⌚", "ൎ"])
    49. failures += checkCase(838, "⌚̈ൎ", ["⌚̈", "ൎ"])
    50. failures += checkCase(839, "⌚क", ["⌚", "क"])
    51. failures += checkCase(840, "⌚̈क", ["⌚̈", "क"])
    52. failures += checkCase(841, "⌚⌚", ["⌚", "⌚"])
    53. failures += checkCase(842, "⌚̈⌚", ["⌚̈", "⌚"])
    54. failures += checkCase(843, "⌚̀", ["⌚̀"])
    55. failures += checkCase(844, "⌚̈̀", ["⌚̈̀"])
    56. failures += checkCase(845, "⌚ऀ", ["⌚ऀ"])
    57. failures += checkCase(846, "⌚̈ऀ", ["⌚̈ऀ"])
    58. failures += checkCase(847, "⌚्", ["⌚्"])
    59. failures += checkCase(848, "⌚्̈", ["⌚्̈"])
    60. failures += checkCase(849, "⌚‍", ["⌚‍"])
    61. failures += checkCase(850, "⌚̈‍", ["⌚̈‍"])
    62. failures += checkCase(851, "⌚͸", ["⌚", "͸"])
    63. failures += checkCase(852, "⌚̈͸", ["⌚̈", "͸"])
    64. failures += checkCase(853, "̀ ", ["̀", " "])
    65. failures += checkCase(854, "̀̈ ", ["̀̈", " "])
    66. failures += checkCase(855, "̀\r", ["̀", "\r"])
    67. failures += checkCase(856, "̀̈\r", ["̀̈", "\r"])
    68. failures
    69. }
    graphemecases13.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(857, "̀\n", ["̀", "\n"])
    5. failures += checkCase(858, "̀̈\n", ["̀̈", "\n"])
    6. failures += checkCase(859, "̀", ["̀", ""])
    7. failures += checkCase(860, "̀̈", ["̀̈", ""])
    8. failures += checkCase(861, "̀‌", ["̀‌"])
    9. failures += checkCase(862, "̀̈‌", ["̀̈‌"])
    10. failures += checkCase(863, "̀🇦", ["̀", "🇦"])
    11. failures += checkCase(864, "̀̈🇦", ["̀̈", "🇦"])
    12. failures += checkCase(865, "̀؀", ["̀", "؀"])
    13. failures += checkCase(866, "̀̈؀", ["̀̈", "؀"])
    14. failures += checkCase(867, "̀ਃ", ["̀ਃ"])
    15. failures += checkCase(868, "̀̈ਃ", ["̀̈ਃ"])
    16. failures += checkCase(869, "̀ᄀ", ["̀", "ᄀ"])
    17. failures += checkCase(870, "̀̈ᄀ", ["̀̈", "ᄀ"])
    18. failures += checkCase(871, "̀ᅠ", ["̀", "ᅠ"])
    19. failures += checkCase(872, "̀̈ᅠ", ["̀̈", "ᅠ"])
    20. failures += checkCase(873, "̀ᆨ", ["̀", "ᆨ"])
    21. failures += checkCase(874, "̀̈ᆨ", ["̀̈", "ᆨ"])
    22. failures += checkCase(875, "̀가", ["̀", "가"])
    23. failures += checkCase(876, "̀̈가", ["̀̈", "가"])
    24. failures += checkCase(877, "̀각", ["̀", "각"])
    25. failures += checkCase(878, "̀̈각", ["̀̈", "각"])
    26. failures += checkCase(879, "̀ः", ["̀ः"])
    27. failures += checkCase(880, "̀̈ः", ["̀̈ः"])
    28. failures += checkCase(881, "̀ऄ", ["̀", "ऄ"])
    29. failures += checkCase(882, "̀̈ऄ", ["̀̈", "ऄ"])
    30. failures += checkCase(883, "̀ൎ", ["̀", "ൎ"])
    31. failures += checkCase(884, "̀̈ൎ", ["̀̈", "ൎ"])
    32. failures += checkCase(885, "̀क", ["̀", "क"])
    33. failures += checkCase(886, "̀̈क", ["̀̈", "क"])
    34. failures += checkCase(887, "̀⌚", ["̀", "⌚"])
    35. failures += checkCase(888, "̀̈⌚", ["̀̈", "⌚"])
    36. failures += checkCase(889, "̀̀", ["̀̀"])
    37. failures += checkCase(890, "̀̈̀", ["̀̈̀"])
    38. failures += checkCase(891, "̀ऀ", ["̀ऀ"])
    39. failures += checkCase(892, "̀̈ऀ", ["̀̈ऀ"])
    40. failures += checkCase(893, "्̀", ["्̀"])
    41. failures += checkCase(894, "्̀̈", ["्̀̈"])
    42. failures += checkCase(895, "̀‍", ["̀‍"])
    43. failures += checkCase(896, "̀̈‍", ["̀̈‍"])
    44. failures += checkCase(897, "̀͸", ["̀", "͸"])
    45. failures += checkCase(898, "̀̈͸", ["̀̈", "͸"])
    46. failures += checkCase(899, "ऀ ", ["ऀ", " "])
    47. failures += checkCase(900, "ऀ̈ ", ["ऀ̈", " "])
    48. failures += checkCase(901, "ऀ\r", ["ऀ", "\r"])
    49. failures += checkCase(902, "ऀ̈\r", ["ऀ̈", "\r"])
    50. failures += checkCase(903, "ऀ\n", ["ऀ", "\n"])
    51. failures += checkCase(904, "ऀ̈\n", ["ऀ̈", "\n"])
    52. failures += checkCase(905, "ऀ", ["ऀ", ""])
    53. failures += checkCase(906, "ऀ̈", ["ऀ̈", ""])
    54. failures += checkCase(907, "ऀ‌", ["ऀ‌"])
    55. failures += checkCase(908, "ऀ̈‌", ["ऀ̈‌"])
    56. failures += checkCase(909, "ऀ🇦", ["ऀ", "🇦"])
    57. failures += checkCase(910, "ऀ̈🇦", ["ऀ̈", "🇦"])
    58. failures += checkCase(911, "ऀ؀", ["ऀ", "؀"])
    59. failures += checkCase(912, "ऀ̈؀", ["ऀ̈", "؀"])
    60. failures += checkCase(913, "ऀਃ", ["ऀਃ"])
    61. failures += checkCase(914, "ऀ̈ਃ", ["ऀ̈ਃ"])
    62. failures += checkCase(915, "ऀᄀ", ["ऀ", "ᄀ"])
    63. failures += checkCase(916, "ऀ̈ᄀ", ["ऀ̈", "ᄀ"])
    64. failures += checkCase(917, "ऀᅠ", ["ऀ", "ᅠ"])
    65. failures += checkCase(918, "ऀ̈ᅠ", ["ऀ̈", "ᅠ"])
    66. failures += checkCase(919, "ऀᆨ", ["ऀ", "ᆨ"])
    67. failures += checkCase(920, "ऀ̈ᆨ", ["ऀ̈", "ᆨ"])
    68. failures
    69. }
    graphemecases14.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(921, "ऀ가", ["ऀ", "가"])
    5. failures += checkCase(922, "ऀ̈가", ["ऀ̈", "가"])
    6. failures += checkCase(923, "ऀ각", ["ऀ", "각"])
    7. failures += checkCase(924, "ऀ̈각", ["ऀ̈", "각"])
    8. failures += checkCase(925, "ऀः", ["ऀः"])
    9. failures += checkCase(926, "ऀ̈ः", ["ऀ̈ः"])
    10. failures += checkCase(927, "ऀऄ", ["ऀ", "ऄ"])
    11. failures += checkCase(928, "ऀ̈ऄ", ["ऀ̈", "ऄ"])
    12. failures += checkCase(929, "ऀൎ", ["ऀ", "ൎ"])
    13. failures += checkCase(930, "ऀ̈ൎ", ["ऀ̈", "ൎ"])
    14. failures += checkCase(931, "ऀक", ["ऀ", "क"])
    15. failures += checkCase(932, "ऀ̈क", ["ऀ̈", "क"])
    16. failures += checkCase(933, "ऀ⌚", ["ऀ", "⌚"])
    17. failures += checkCase(934, "ऀ̈⌚", ["ऀ̈", "⌚"])
    18. failures += checkCase(935, "ऀ̀", ["ऀ̀"])
    19. failures += checkCase(936, "ऀ̈̀", ["ऀ̈̀"])
    20. failures += checkCase(937, "ऀऀ", ["ऀऀ"])
    21. failures += checkCase(938, "ऀ̈ऀ", ["ऀ̈ऀ"])
    22. failures += checkCase(939, "ऀ्", ["ऀ्"])
    23. failures += checkCase(940, "ऀ्̈", ["ऀ्̈"])
    24. failures += checkCase(941, "ऀ‍", ["ऀ‍"])
    25. failures += checkCase(942, "ऀ̈‍", ["ऀ̈‍"])
    26. failures += checkCase(943, "ऀ͸", ["ऀ", "͸"])
    27. failures += checkCase(944, "ऀ̈͸", ["ऀ̈", "͸"])
    28. failures += checkCase(945, "् ", ["्", " "])
    29. failures += checkCase(946, "्̈ ", ["्̈", " "])
    30. failures += checkCase(947, "्\r", ["्", "\r"])
    31. failures += checkCase(948, "्̈\r", ["्̈", "\r"])
    32. failures += checkCase(949, "्\n", ["्", "\n"])
    33. failures += checkCase(950, "्̈\n", ["्̈", "\n"])
    34. failures += checkCase(951, "्", ["्", ""])
    35. failures += checkCase(952, "्̈", ["्̈", ""])
    36. failures += checkCase(953, "्‌", ["्‌"])
    37. failures += checkCase(954, "्̈‌", ["्̈‌"])
    38. failures += checkCase(955, "्🇦", ["्", "🇦"])
    39. failures += checkCase(956, "्̈🇦", ["्̈", "🇦"])
    40. failures += checkCase(957, "्؀", ["्", "؀"])
    41. failures += checkCase(958, "्̈؀", ["्̈", "؀"])
    42. failures += checkCase(959, "्ਃ", ["्ਃ"])
    43. failures += checkCase(960, "्̈ਃ", ["्̈ਃ"])
    44. failures += checkCase(961, "्ᄀ", ["्", "ᄀ"])
    45. failures += checkCase(962, "्̈ᄀ", ["्̈", "ᄀ"])
    46. failures += checkCase(963, "्ᅠ", ["्", "ᅠ"])
    47. failures += checkCase(964, "्̈ᅠ", ["्̈", "ᅠ"])
    48. failures += checkCase(965, "्ᆨ", ["्", "ᆨ"])
    49. failures += checkCase(966, "्̈ᆨ", ["्̈", "ᆨ"])
    50. failures += checkCase(967, "्가", ["्", "가"])
    51. failures += checkCase(968, "्̈가", ["्̈", "가"])
    52. failures += checkCase(969, "्각", ["्", "각"])
    53. failures += checkCase(970, "्̈각", ["्̈", "각"])
    54. failures += checkCase(971, "्ः", ["्ः"])
    55. failures += checkCase(972, "्̈ः", ["्̈ः"])
    56. failures += checkCase(973, "्ऄ", ["्", "ऄ"])
    57. failures += checkCase(974, "्̈ऄ", ["्̈", "ऄ"])
    58. failures += checkCase(975, "्ൎ", ["्", "ൎ"])
    59. failures += checkCase(976, "्̈ൎ", ["्̈", "ൎ"])
    60. failures += checkCase(977, "्क", ["्", "क"])
    61. failures += checkCase(978, "्̈क", ["्̈", "क"])
    62. failures += checkCase(979, "्⌚", ["्", "⌚"])
    63. failures += checkCase(980, "्̈⌚", ["्̈", "⌚"])
    64. failures += checkCase(981, "्̀", ["्̀"])
    65. failures += checkCase(982, "्̈̀", ["्̈̀"])
    66. failures += checkCase(983, "्ऀ", ["्ऀ"])
    67. failures += checkCase(984, "्̈ऀ", ["्̈ऀ"])
    68. failures
    69. }
    graphemecases15.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(985, "््", ["््"])
    5. failures += checkCase(986, "््̈", ["््̈"])
    6. failures += checkCase(987, "्‍", ["्‍"])
    7. failures += checkCase(988, "्̈‍", ["्̈‍"])
    8. failures += checkCase(989, "्͸", ["्", "͸"])
    9. failures += checkCase(990, "्̈͸", ["्̈", "͸"])
    10. failures += checkCase(991, "‍ ", ["‍", " "])
    11. failures += checkCase(992, "‍̈ ", ["‍̈", " "])
    12. failures += checkCase(993, "‍\r", ["‍", "\r"])
    13. failures += checkCase(994, "‍̈\r", ["‍̈", "\r"])
    14. failures += checkCase(995, "‍\n", ["‍", "\n"])
    15. failures += checkCase(996, "‍̈\n", ["‍̈", "\n"])
    16. failures += checkCase(997, "‍", ["‍", ""])
    17. failures += checkCase(998, "‍̈", ["‍̈", ""])
    18. failures += checkCase(999, "‍‌", ["‍‌"])
    19. failures += checkCase(1000, "‍̈‌", ["‍̈‌"])
    20. failures += checkCase(1001, "‍🇦", ["‍", "🇦"])
    21. failures += checkCase(1002, "‍̈🇦", ["‍̈", "🇦"])
    22. failures += checkCase(1003, "‍؀", ["‍", "؀"])
    23. failures += checkCase(1004, "‍̈؀", ["‍̈", "؀"])
    24. failures += checkCase(1005, "‍ਃ", ["‍ਃ"])
    25. failures += checkCase(1006, "‍̈ਃ", ["‍̈ਃ"])
    26. failures += checkCase(1007, "‍ᄀ", ["‍", "ᄀ"])
    27. failures += checkCase(1008, "‍̈ᄀ", ["‍̈", "ᄀ"])
    28. failures += checkCase(1009, "‍ᅠ", ["‍", "ᅠ"])
    29. failures += checkCase(1010, "‍̈ᅠ", ["‍̈", "ᅠ"])
    30. failures += checkCase(1011, "‍ᆨ", ["‍", "ᆨ"])
    31. failures += checkCase(1012, "‍̈ᆨ", ["‍̈", "ᆨ"])
    32. failures += checkCase(1013, "‍가", ["‍", "가"])
    33. failures += checkCase(1014, "‍̈가", ["‍̈", "가"])
    34. failures += checkCase(1015, "‍각", ["‍", "각"])
    35. failures += checkCase(1016, "‍̈각", ["‍̈", "각"])
    36. failures += checkCase(1017, "‍ः", ["‍ः"])
    37. failures += checkCase(1018, "‍̈ः", ["‍̈ः"])
    38. failures += checkCase(1019, "‍ऄ", ["‍", "ऄ"])
    39. failures += checkCase(1020, "‍̈ऄ", ["‍̈", "ऄ"])
    40. failures += checkCase(1021, "‍ൎ", ["‍", "ൎ"])
    41. failures += checkCase(1022, "‍̈ൎ", ["‍̈", "ൎ"])
    42. failures += checkCase(1023, "‍क", ["‍", "क"])
    43. failures += checkCase(1024, "‍̈क", ["‍̈", "क"])
    44. failures += checkCase(1025, "‍⌚", ["‍", "⌚"])
    45. failures += checkCase(1026, "‍̈⌚", ["‍̈", "⌚"])
    46. failures += checkCase(1027, "‍̀", ["‍̀"])
    47. failures += checkCase(1028, "‍̈̀", ["‍̈̀"])
    48. failures += checkCase(1029, "‍ऀ", ["‍ऀ"])
    49. failures += checkCase(1030, "‍̈ऀ", ["‍̈ऀ"])
    50. failures += checkCase(1031, "‍्", ["‍्"])
    51. failures += checkCase(1032, "‍्̈", ["‍्̈"])
    52. failures += checkCase(1033, "‍‍", ["‍‍"])
    53. failures += checkCase(1034, "‍̈‍", ["‍̈‍"])
    54. failures += checkCase(1035, "‍͸", ["‍", "͸"])
    55. failures += checkCase(1036, "‍̈͸", ["‍̈", "͸"])
    56. failures += checkCase(1037, "͸ ", ["͸", " "])
    57. failures += checkCase(1038, "͸̈ ", ["͸̈", " "])
    58. failures += checkCase(1039, "͸\r", ["͸", "\r"])
    59. failures += checkCase(1040, "͸̈\r", ["͸̈", "\r"])
    60. failures += checkCase(1041, "͸\n", ["͸", "\n"])
    61. failures += checkCase(1042, "͸̈\n", ["͸̈", "\n"])
    62. failures += checkCase(1043, "͸", ["͸", ""])
    63. failures += checkCase(1044, "͸̈", ["͸̈", ""])
    64. failures += checkCase(1045, "͸‌", ["͸‌"])
    65. failures += checkCase(1046, "͸̈‌", ["͸̈‌"])
    66. failures += checkCase(1047, "͸🇦", ["͸", "🇦"])
    67. failures += checkCase(1048, "͸̈🇦", ["͸̈", "🇦"])
    68. failures
    69. }
    graphemecases16.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(1049, "͸؀", ["͸", "؀"])
    5. failures += checkCase(1050, "͸̈؀", ["͸̈", "؀"])
    6. failures += checkCase(1051, "͸ਃ", ["͸ਃ"])
    7. failures += checkCase(1052, "͸̈ਃ", ["͸̈ਃ"])
    8. failures += checkCase(1053, "͸ᄀ", ["͸", "ᄀ"])
    9. failures += checkCase(1054, "͸̈ᄀ", ["͸̈", "ᄀ"])
    10. failures += checkCase(1055, "͸ᅠ", ["͸", "ᅠ"])
    11. failures += checkCase(1056, "͸̈ᅠ", ["͸̈", "ᅠ"])
    12. failures += checkCase(1057, "͸ᆨ", ["͸", "ᆨ"])
    13. failures += checkCase(1058, "͸̈ᆨ", ["͸̈", "ᆨ"])
    14. failures += checkCase(1059, "͸가", ["͸", "가"])
    15. failures += checkCase(1060, "͸̈가", ["͸̈", "가"])
    16. failures += checkCase(1061, "͸각", ["͸", "각"])
    17. failures += checkCase(1062, "͸̈각", ["͸̈", "각"])
    18. failures += checkCase(1063, "͸ः", ["͸ः"])
    19. failures += checkCase(1064, "͸̈ः", ["͸̈ः"])
    20. failures += checkCase(1065, "͸ऄ", ["͸", "ऄ"])
    21. failures += checkCase(1066, "͸̈ऄ", ["͸̈", "ऄ"])
    22. failures += checkCase(1067, "͸ൎ", ["͸", "ൎ"])
    23. failures += checkCase(1068, "͸̈ൎ", ["͸̈", "ൎ"])
    24. failures += checkCase(1069, "͸क", ["͸", "क"])
    25. failures += checkCase(1070, "͸̈क", ["͸̈", "क"])
    26. failures += checkCase(1071, "͸⌚", ["͸", "⌚"])
    27. failures += checkCase(1072, "͸̈⌚", ["͸̈", "⌚"])
    28. failures += checkCase(1073, "͸̀", ["͸̀"])
    29. failures += checkCase(1074, "͸̈̀", ["͸̈̀"])
    30. failures += checkCase(1075, "͸ऀ", ["͸ऀ"])
    31. failures += checkCase(1076, "͸̈ऀ", ["͸̈ऀ"])
    32. failures += checkCase(1077, "͸्", ["͸्"])
    33. failures += checkCase(1078, "͸्̈", ["͸्̈"])
    34. failures += checkCase(1079, "͸‍", ["͸‍"])
    35. failures += checkCase(1080, "͸̈‍", ["͸̈‍"])
    36. failures += checkCase(1081, "͸͸", ["͸", "͸"])
    37. failures += checkCase(1082, "͸̈͸", ["͸̈", "͸"])
    38. failures += checkCase(1083, "\r\na\n̈", ["\r\n", "a", "\n", "̈"])
    39. failures += checkCase(1084, "ä", ["ä"])
    40. failures += checkCase(1085, " ‍ن", [" ‍", "ن"])
    41. failures += checkCase(1086, "ن‍ ", ["ن‍", " "])
    42. failures += checkCase(1087, "ᄀᄀ", ["ᄀᄀ"])
    43. failures += checkCase(1088, "각ᄀ", ["각", "ᄀ"])
    44. failures += checkCase(1089, "각ᆨᄀ", ["각ᆨ", "ᄀ"])
    45. failures += checkCase(1090, "🇦🇧🇨b", ["🇦🇧", "🇨", "b"])
    46. failures += checkCase(1091, "a🇦🇧🇨b", ["a", "🇦🇧", "🇨", "b"])
    47. failures += checkCase(1092, "a🇦🇧‍🇨b", ["a", "🇦🇧‍", "🇨", "b"])
    48. failures += checkCase(1093, "a🇦‍🇧🇨b", ["a", "🇦‍", "🇧🇨", "b"])
    49. failures += checkCase(1094, "a🇦🇧🇨🇩b", ["a", "🇦🇧", "🇨🇩", "b"])
    50. failures += checkCase(1095, "a‍", ["a‍"])
    51. failures += checkCase(1096, "äb", ["ä", "b"])
    52. failures += checkCase(1097, "aःb", ["aः", "b"])
    53. failures += checkCase(1098, "a؀b", ["a", "؀b"])
    54. failures += checkCase(1099, "👶🏿👶", ["👶🏿", "👶"])
    55. failures += checkCase(1100, "a🏿👶", ["a🏿", "👶"])
    56. failures += checkCase(1101, "a🏿👶‍🛑", ["a🏿", "👶‍🛑"])
    57. failures += checkCase(1102, "👶🏿̈‍👶🏿", ["👶🏿̈‍👶🏿"])
    58. failures += checkCase(1103, "🛑‍🛑", ["🛑‍🛑"])
    59. failures += checkCase(1104, "a‍🛑", ["a‍", "🛑"])
    60. failures += checkCase(1105, "✁‍✁", ["✁‍✁"])
    61. failures += checkCase(1106, "a‍✁", ["a‍", "✁"])
    62. failures += checkCase(1107, "कत", ["क", "त"])
    63. failures += checkCase(1108, "क्त", ["क्त"])
    64. failures += checkCase(1109, "क््त", ["क््त"])
    65. failures += checkCase(1110, "क्‍त", ["क्‍त"])
    66. failures += checkCase(1111, "क़‍्त", ["क़‍्त"])
    67. failures += checkCase(1112, "क़्‍त", ["क़्‍त"])
    68. failures
    69. }
    graphemecases17.tpzCheck every published Unicode 16 grapheme test row
    1. import graphemesupport { checkCase }
    2. export function run() -> int {
    3. let mut failures = 0
    4. failures += checkCase(1113, "क्त्य", ["क्त्य"])
    5. failures += checkCase(1114, "क्a", ["क्", "a"])
    6. failures += checkCase(1115, "a्त", ["a्", "त"])
    7. failures += checkCase(1116, "?्त", ["?्", "त"])
    8. failures += checkCase(1117, "क््त", ["क््त"])
    9. failures
    10. }
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. Unicode 16.0.0 grapheme corpus passed

    Alternatives considered

    • Provide scalar iteration alone. Programs would need to implement their own grapheme boundaries to work with visible characters.

    Why

    Text can be processed by grapheme without changing its underlying data.

    Changed rules Choose Unicode grapheme clusters explicitly →

    Existing string and array members carry their signatures forward

    Adopted November 14, 2026 · 6.0.0 · Being verified

    Problem

    Programs moving to 6.0 need to know which built-in calls still work as written. Out-of-bounds array access is one common case.

    Decision

    • Keep the 5.21 signatures unless a separate decision removes or renames the member.
    • Specify codePointAt, split, and byteLength for strings, and get, push, map, filter, and reduce for arrays.
    • Array.get(i) returns Option<T>. A negative index or one at or beyond the length returns None().

    Examples

    Read scalar values by scalar index

    main.tpzRead scalar values by scalar indexOpen in Playground →
    1. import std.io
    2. function show(value: Option<int>) -> string {
    3. match (value) {
    4. case Some(point) => "{point}"
    5. case None() => "none"
    6. }
    7. }
    8. let text = "a가😀"
    9. for index in ([-1, 0, 1, 2, 3]) {
    10. io.writeLine("{index}: {show(text.codePointAt(index))}")
    11. }
    Expected outputExit code 0
    -1: none
    0: 97
    1: 44032
    2: 128512
    3: none
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. -1: none
    2. 0: 97
    3. 1: 44032
    4. 2: 128512
    5. 3: none

    Compare scalar counts with UTF-8 byte counts

    main.tpzCompare scalar counts with UTF-8 byte countsOpen in Playground →
    1. import std.io
    2. for text in (["", "a", "가", "😀", "a가😀"]) {
    3. io.writeLine("{text.scalars().length} {text.byteLength()}")
    4. }
    Expected outputExit code 0
    0 0
    1 1
    1 3
    1 4
    3 8
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0 0
    2. 1 1
    3. 1 3
    4. 1 4
    5. 3 8

    Keep empty pieces between separators

    main.tpzKeep empty pieces between separatorsOpen in Playground →
    1. import std.io
    2. function show(pieces: Array<string>) -> string {
    3. "{pieces.length} [{pieces.join("|")}]"
    4. }
    5. io.writeLine(show("a,b,,c,".split(",")))
    6. io.writeLine(show("a::b".split("::")))
    7. io.writeLine(show("aaa".split("aa")))
    8. io.writeLine(show("plain".split(",")))
    9. io.writeLine(show("".split(",")))
    10. let text = ",x,"
    11. io.writeLine("{text.split(",").join(",") == text}")
    Expected outputExit code 0
    5 [a|b||c|]
    2 [a|b]
    2 [|a]
    1 [plain]
    1 []
    true
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 5 [a|b||c|]
    2. 2 [a|b]
    3. 2 [|a]
    4. 1 [plain]
    5. 1 []
    6. true

    Read elements without faulting at the edges

    main.tpzRead elements without faulting at the edgesOpen in Playground →
    1. import std.io
    2. let names = ["a", "b", "c"]
    3. for index in ([-1, 0, 2, 3]) {
    4. match (names.get(index)) {
    5. case Some(name) => io.writeLine("{index}: {name}")
    6. case None() => io.writeLine("{index}: none")
    7. }
    8. }
    9. let empty: Array<string> = []
    10. io.writeLine("{empty.length}: {empty.get(0) ?? "none"}")
    Expected outputExit code 0
    -1: none
    0: a
    2: c
    3: none
    0: none
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. -1: none
    2. 0: a
    3. 2: c
    4. 3: none
    5. 0: none

    Append elements to a mutable array

    main.tpzAppend elements to a mutable arrayOpen in Playground →
    1. import std.io
    2. let mut names: Array<string> = []
    3. io.writeLine("{names.length}")
    4. names.push("a")
    5. names.push("b")
    6. io.writeLine("{names.length}: {names.join(",")}")
    Expected outputExit code 0
    0
    2: a,b
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. 0
    2. 2: a,b

    Alternatives considered

    • Merge get into indexing or string split into regular-expression split. Optional access and faulting access have different results, and a literal delimiter serves a different purpose from a pattern.
    • Redefine member names or signatures in 6.0. No change would leave fewer ways to say the same thing.

    Why

    Programs can keep their existing calls and choose an operation by the behavior they need.

    Changed rules Read code points, byte counts and separated pieces →Read, count and append array elements →

    String-to-integer conversion accepts ASCII digits and an optional minus

    Adopted November 14, 2026 · 6.0.0 · In progress

    Problem

    When reading an integer from external text, a program needs to know whether whitespace or a plus sign is accepted. Out-of-range values also need a defined result.

    Decision

    • string.toInt() accepts ASCII decimal digits with an optional leading -.
    • Whitespace, +, separators, prefixes, and out-of-range values produce None().

    Examples

    Parse a minus sign and decimal digits

    main.tpzParse a minus sign and decimal digitsOpen in Playground →
    1. import std.io
    2. function show(text: string) -> string {
    3. match (text.toInt()) {
    4. case Some(value) => "{value}"
    5. case None() => "none"
    6. }
    7. }
    8. for text in (["42", "-7", "007", "-0", "9223372036854775807", "-9223372036854775808"]) {
    9. io.writeLine("[{text}] {show(text)}")
    10. }
    Expected outputExit code 0
    [42] 42
    [-7] -7
    [007] 7
    [-0] 0
    [9223372036854775807] 9223372036854775807
    [-9223372036854775808] -9223372036854775808
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. [42] 42
    2. [-7] -7
    3. [007] 7
    4. [-0] 0
    5. [9223372036854775807] 9223372036854775807
    6. [-9223372036854775808] -9223372036854775808

    Return None() for other spellings and out-of-range values

    main.tpzReturn None() for other spellings and out-of-range valuesOpen in Playground →
    1. import std.io
    2. function show(text: string) -> string {
    3. match (text.toInt()) {
    4. case Some(value) => "{value}"
    5. case None() => "none"
    6. }
    7. }
    8. for text in (["", "-", "12a", "1_000", "0x10", "1e3", "١٢", "9223372036854775808", "-9223372036854775809"]) {
    9. io.writeLine("[{text}] {show(text)}")
    10. }
    Expected outputExit code 0
    [] none
    [-] none
    [12a] none
    [1_000] none
    [0x10] none
    [1e3] none
    [١٢] none
    [9223372036854775808] none
    [-9223372036854775809] none
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. [] none
    2. [-] none
    3. [12a] none
    4. [1_000] none
    5. [0x10] none
    6. [1e3] none
    7. [١٢] none
    8. [9223372036854775808] none
    9. [-9223372036854775809] none

    Return None() for surrounding whitespace and a plus sign

    main.tpzReturn None() for surrounding whitespace and a plus sign
    1. import std.io
    2. function show(text: string) -> string {
    3. match (text.toInt()) {
    4. case Some(value) => "{value}"
    5. case None() => "none"
    6. }
    7. }
    8. for text in ([" 12", "12 ", "+5"]) {
    9. io.writeLine("[{text}] {show(text)}")
    10. }
    Expected outputExit code 0
    [ 12] none
    [12 ] none
    [+5] none
    
    $ topaz run main.tpz --language-version 6.0
    Expected result

    Expected result

    Execution completes. Exit code 0.

    Expected stdout
    1. [ 12] none
    2. [12 ] none
    3. [+5] none

    Alternatives considered

    • Trim whitespace and accept a leading +. That permits additional spellings of the same value.

    Why

    Callers can rely on a defined input spelling and failure result.

    Changed rules Parse decimal integers with one spelling →