1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-FileCopyrightText: 2026 Jandira Technologies, LLC
//
// SPDX-License-Identifier: Apache-2.0
//! The one native-key policy behind paired long IDs. Generation
//! (`read --for-edit`, `edit template`) and application (`edit apply`)
//! must agree on which raw OOXML attribute values count as native keys,
//! or a plan the generator freezes refuses at apply with
//! `TARGET_ID_MISMATCH`. Both sides call these predicates and count what
//! they return, nothing else.
/// A `w14:paraId` attribute value as a native long-ID key: exactly eight
/// ASCII hex digits that parse into Word's range `1..=0x7FFFFFFF`
/// ([MS-DOCX] requires paraIds below 0x80000000). Parsing folds letter
/// case, so `1234ABCD` and `1234abcd` are one key that occurs twice;
/// callers that count occurrences must count this `u32`, not the raw
/// string.
pub
/// A revision `w:id` attribute value as a native long-ID key: non-empty,
/// digits with an optional sign, parsing as the `i32` width Word writes.
/// Anything else (`5000000000`, `x9`, `1+2`) has no `w:id` long form and
/// must travel as its printed `j:short` pairing.
pub