From 8b3b995b6aff5c15ba31692fd29113db3c42517f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 29 Sep 2026 14:09:17 -0400 Subject: format 2.1: .ocn_range is one of the properties Format 2.1 adds .ocn_range, the first and last ocn a container holds, emitted after .last_descendant: a poem, which now carries ocn 0 and comes before its verses, is cited as the range of them. Both readers now know it as the forty-third property, so --validate accepts a 2.1 file and --report-unknown does not list it. The validator's message counts the list rather than naming a number. Every document-language of the markup document samples written by spine at 2.1 validates; neither reader uses the property, which within a major version is conforming. (assisted by Claude-Code) --- dlang/src/validate.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dlang/src/validate.d') diff --git a/dlang/src/validate.d b/dlang/src/validate.d index bf8668b..b41edd8 100644 --- a/dlang/src/validate.d +++ b/dlang/src/validate.d @@ -25,7 +25,8 @@ struct SspFinding { /+ ↓ specification section 6.3: the properties, in the order they are emitted. A reader may rely on the order, so a validator can check it +/ private immutable string[] property_order = [ - "identifier", "part", "section", "parent", "last_descendant", "children", + "identifier", "part", "section", "parent", "last_descendant", "ocn_range", + "children", "ancestors", "ancestors_collapsed", "dom_status", "dom_status_collapsed", "heading_lev_collapsed", "parent_lev", "dummy", "ocn_off", "is_of_type", "attrib", "meta_lang", "meta_syntax", "sha256", "image", "indent", @@ -215,7 +216,7 @@ SspFinding[] validateSspFile(string filename, string major_known) { string name = line[1 .. colon]; int rank = propertyRank(name); if (rank < 0) { - found ~= SspFinding(no, "6.3", "." ~ name ~ " is not one of the 42 properties"); + found ~= SspFinding(no, "6.3", "." ~ name ~ " is not one of the " ~ property_order.length.to!string ~ " properties"); } else { /+ ↓ the four repeatable properties may recur at the same rank +/ if (rank < prev_rank) { -- cgit v1.2.3