ctb_formats_dcdata/syntax/role.generated.rs
1// SPDX-License-Identifier: AGPL-3.0-or-later
2/*
3This file is part of Collective Toolbox, a database and document workspace and utilities.
4Copyright (C) 2026 Collective Toolbox Developers
5Contact: info@collectivetoolbox.com
6
7This program is free software: you can redistribute it and/or modify it under
8the terms of the GNU Affero General Public License as published by the Free
9Software Foundation, either version 3 of the License, or (at your option) any
10later version.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License along
17with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
19
20//! Document Character (Dc) syntactic and semantic role classifications.
21//!
22//! @generated by ctb-build-support::dc_codegen from category data tables.
23//! Do not edit by hand.
24
25#[allow(
26 unused_imports,
27 clippy::wildcard_imports,
28 reason = "Standard workspace module prelude"
29)]
30use crate::utilities::*;
31
32use ctb_utilities::dc_char::{FORMAT_REGION_END, FORMAT_REGION_START};
33use serde::{Deserialize, Serialize};
34
35/// Classification of syntactic framing and semantic roles for Document
36/// Characters.
37#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
38pub enum DcRole {
39 /// The DCE range character. Used to represent ranges in DCE. See the wiki for more information. (`4`).
40 Range,
41 /// Begin a DCE number. (`6`).
42 BeginNumber,
43 /// End a DCE number. (`7`).
44 EndNumber,
45 /// Positive value (syntactical representation — This is not the + character) (`10`).
46 Positive,
47 /// Negative (syntactical representation — This is not the − character) (`11`).
48 Negative,
49 /// Base 64 encapsulation digit 0 (`127`).
50 Base64Start,
51 /// Base 64 encapsulation digit 63 (`190`).
52 Base64End,
53 /// Begin Base 64 encapsulated UTF-8 (`191`).
54 StartEncapsulationUtf8,
55 /// End Base 64 encapsulated UTF-8 (`192`).
56 EndEncapsulationUtf8,
57 /// Base 64 encapsulation padding character (`195`).
58 Base64Padding,
59 /// Arbitrary binary data (base64 encoded, no semantic significance assigned to it unless optional type is specified). Optional length counts decoded payload bytes; optional checksum covers those bytes. (`203`).
60 StartEncapsulationBinary,
61 /// See description for 203 (`204`).
62 EndEncapsulationBinary,
63 /// Used to replace an incoming character whose value is unknown or unrepresentable in Unicode (`206`).
64 ReplacementUnavailUnicode,
65 /// Used to replace an incoming character whose value is not mapped to a Dc (document component) (`207`).
66 ReplacementUnavailDc,
67 /// Beginning of a document (`235`).
68 BeginDocument,
69 /// Terminates a document begun by Dc 235. (`236`).
70 EndDocument,
71 /// Begins a comment that, when represented in EM (Ember Language source) format, should be displayed as a “#”-style comment. All characters except 248 and 255 will be ignored. Use 255 248 to represent 248 within the comment, and 255 255 to represent 255 within the comment. (`246`).
72 BeginSingleLineComment,
73 /// As with 247, but starting on a new line in the source form. (`247`).
74 BeginSingleLineCommentNewLine,
75 /// Terminates a comment region begun by 246 or 247. (`248`).
76 EndSingleLineComment,
77 /// As with 248, but creating a “/* */”-style block comment. (`249`).
78 BeginBlockComment,
79 /// As with 250, but starting on a new line in the source form. (`250`).
80 BeginBlockCommentNewLine,
81 /// Terminates a comment region begun by 249 or 250. (`251`).
82 EndBlockComment,
83 /// Indicates that the next character should be ignored. (`255`).
84 Escape,
85 /// Send the specified string to the current output context, adding a final line feed if one is not present (`256`).
86 LangSay,
87 /// Frames one value expression as a parameter. A literal parameter remains quoted data. (`258`).
88 BeginParameter,
89 /// Terminates the parameter begun by 258 after its complete value expression. (`259`).
90 EndParameter,
91 /// Begins a typed quoted character sequence. The payload may be empty. Dc 255 protects exactly the next Dc from syntactic interpretation: 255 261 is payload Dc 261 and 255 255 is payload Dc 255. Only an unescaped 261 terminates the literal. Decode escapes once after locating the boundary; payload characters are not implicitly evaluated or reparsed. (`260`).
92 BeginLiteral,
93 /// Terminates a literal begun by 260 unless protected by Dc 255 within its payload. (`261`).
94 EndLiteral,
95 /// Begin type definition (`262`).
96 BeginTypeDef,
97 /// End type definition (`263`).
98 EndTypeDef,
99 /// A specific case of “String” as a format (short-style format ID 80) (`264`).
100 TypeString,
101 /// void lang.assign([identifier] identifier, [value] value) (`268`).
102 LangAssign,
103 /// Assignment operator (`269`).
104 Assign,
105 /// Begins a nonempty name. Dc 255 protects exactly the following Dc from syntactic interpretation. Only an unescaped 271 terminates the name. The name is data; reference or invocation syntax determines how it is used. (`270`).
106 BeginIdentifier,
107 /// Terminates an identifier begun by 270 unless protected by Dc 255 within its payload. (`271`).
108 EndIdentifier,
109 /// Built-in type identifier: * (Object or any subtype) (`275`).
110 TypeAny,
111 /// References the named object with an optional explicit type. Both forms begin with 276 and end with the complete framed identifier. Resolve the reference only in an evaluation context; quoting it does not perform a lookup. (`276`).
112 ReferenceNamedObject,
113 /// Built-in type identifier: Number (`278`).
114 TypeNumber,
115 /// Invoke the specified routine (unlike lang.invoke, this form of invocation is not shown in the EM source form of the document FIXME: clarify this??) (`279`).
116 RoutineInvocation,
117 /// Built-in type identifier: Routine (`280`).
118 TypeRoutine,
119 /// Next number is a Dc-equivalent reference to a local node/document (`296`).
120 LocalNode,
121 /// Equivalent to an opening parenthesis in many languages or in arithmetic expressions. (`298`).
122 BeginAssociativityGroup,
123 /// Equivalent to a closing parenthesis in many languages or in arithmetic expressions. (`299`).
124 EndAssociativityGroup,
125 /// Indicates that one or more types are all applicable to the same data. This is a conjunction of constraints (a union of descriptions); it does not mean either type as an alternative. For that, see Dc 516 “Type intersection”. (`300`).
126 TypeUnion,
127 /// Describes a transformation operation as part of a type description. The first operand is the input type; the second identifies the transformation. Only transformation formats would make sense for the second operand. Describing an operation does not itself execute it. (`301`).
128 TypeTransformation,
129 /// Describes a conversion operation from the first operand's type to the second operand's type. Conversion may change the representation and may be lossy. Describing an operation does not itself execute it. (`302`).
130 TypeConversion,
131 /// Describes reinterpreting a representation of the first operand's type as the second operand's type without converting the representation. Describing an operation does not itself execute it. (`303`).
132 TypeTransmutation,
133 /// Subtype of string (`306`).
134 TypeRoutineName,
135 /// Used to embed Dcs with short numbers greater than 1,114,111 (the largest, in practice, that EITE would be able to support without needing changes to pack32, I think) into short Dc range. If encountered as a long Dc, it must be escaped with 255 before converting to short Dc, or else it would be lost (if followed by a Dc number) when converting back. (`308`).
136 LongDc,
137 /// Begins an ordered, contiguous, typed homogenous or heterogenous list. (`310`).
138 BeginList,
139 /// Terminates a typed list begun by 310. Optionally, a length can be specified, in which case it must have that many elements declared. (`311`).
140 EndList,
141 /// Separates elements within a list or sequence. (`312`).
142 ListElementSeparator,
143 /// Legacy ordered key-value associative map. Keys and values alternate with Dc 312 between every operand. The optional length counts pairs. Retained for reading existing documents; new documents should use Dc 559. (`313`).
144 BeginLegacyKvMap,
145 /// Terminates a legacy ordered key-value associative map begun by 313. (`314`).
146 EndLegacyKvMap,
147 /// Indicates an optional value is present. (`315`).
148 OptionalPresent,
149 /// Indicates an optional value is absent. (`316`).
150 OptionalAbsent,
151 /// Begins an execution environment snapshot. (`340`).
152 BeginEnvironmentDescription,
153 /// Terminates an execution environment snapshot. (`341`).
154 EndEnvironmentDescription,
155 /// Begins a collection of semantic file flags attached to a file. (`388`).
156 BeginFileFlagsDescription,
157 /// Terminates a collection of semantic file flags attached to a file. (`389`).
158 EndFileFlagsDescription,
159 /// Begins a time moment description. (`390`).
160 BeginTimeMoment,
161 /// Terminates a time moment description. (`391`).
162 EndTimeMoment,
163 /// A positive date duration (`393`).
164 BeginDateMagnitude,
165 /// End date magnitude description (`394`).
166 EndDateMagnitude,
167 /// Begin date duration description (`395`).
168 BeginDateDuration,
169 /// End date duration description (`396`).
170 EndDateDuration,
171 /// Indicates that all values within the list have the same underlying meaning. (`397`).
172 EquivalentRepresentations,
173 /// E.g. “Here’s a Dc representation of an IPv4 address using the syntax associated with that format Dc” (`511`).
174 BeginFormatRepresentation,
175 /// End Dc representation of format (`512`).
176 EndFormatRepresentation,
177 /// File path delimiter (`513`).
178 FilePathDelimiter,
179 /// Begins a key-value pair. Dc 312 separates the nonempty key and value regions; Dc 515 closes the pair. Nested framed data and escaped characters belong to their operand rather than delimiting the enclosing pair. Operand regions retain their historical syntax; this rule does not impose a narrower expression grammar. (`514`).
180 BeginKvPair,
181 /// Terminates the key-value pair begun by Dc 514. (`515`).
182 EndKvPair,
183 /// Indicates that any of multiple types satisfy the type description. See also Dc 300 “Type union”, which indicates that all of multiple types satisfy the type description. (`516`).
184 TypeIntersection,
185 /// Boolean true (`517`).
186 BooleanTrue,
187 /// Boolean false (`518`).
188 BooleanFalse,
189 /// Applies typed parameter bindings to a format in a format specification expression. (`535`).
190 FormatParamApplication,
191 /// Raw file flag bitmask with an unparsed-bits indicator. (`539`).
192 RawFileFlags,
193 /// References a value declared by Dc 269 in the current or nearest enclosing identifier scope. The identifier is name data; evaluating the reference resolves its value. Quoting the reference does not perform lookup. (`540`).
194 ReferenceBoundValue,
195 /// Enters a lexical identifier scope. Inner Dc 269 declarations shadow outer declarations of the same name and may produce warnings. Declarations last only until scope exit and never cross document boundaries by default. (`541`).
196 EnterIdentifierScope,
197 /// Exits the innermost identifier scope and discards its declarations. Outer declarations become visible again. All document-local declarations expire at the end of the document. (`542`).
198 ExitIdentifierScope,
199 /// Begins a delimited section of a document or stream verified by an end checksum. (`543`).
200 BeginChecksummedSection,
201 /// Terminates a checksummed section. (`544`).
202 EndChecksummedSection,
203 /// Cryptographic or cyclic redundancy checksum verifying the integrity of the preceding section. (`545`).
204 SectionDigest,
205 /// Monotonically increasing sequence or batch counter. (`546`).
206 SequenceIdentifier,
207 /// Begins a record describing the parameters source destination and execution of an operation task or session. (`547`).
208 BeginOperationSession,
209 /// Terminates an operation session record. (`548`).
210 EndOperationSession,
211 /// Path designating a source directory file or origin root of an operation. (`549`).
212 SourcePath,
213 /// Path designating a target or destination directory file or storage root. (`550`).
214 DestinationPath,
215 /// Indicates that an operation or session completed its primary intended task. (`551`).
216 OperationCompleted,
217 /// Begins a structured error incident record. (`552`).
218 BeginErrorRecord,
219 /// Terminates a structured error record. (`553`).
220 EndErrorRecord,
221 /// Begins a structured warning incident record. (`554`).
222 BeginWarningRecord,
223 /// Terminates a structured warning record. (`555`).
224 EndWarningRecord,
225 /// Human-readable explanatory or diagnostic log message. (`556`).
226 LogMessage,
227 /// Identifier correlating related operations log entries or distributed traces. (`557`).
228 TraceIdentifier,
229 /// Numeric status or return code associated with an operation. (`558`).
230 OperationStatusCode,
231 /// Begins an ordered key-value associative map of adjacent explicitly closed Dc 514 pairs. No Dc 312 occurs between pairs. The optional length counts pairs. The declared key and value types apply to each pair; inherited declarations must accompany independently extracted fragments. Invalid pair framing must not be reinterpreted as the legacy Dc 313 form. (`559`).
232 BeginKvMap,
233 /// Terminates an ordered key-value associative map begun by Dc 559. (`560`).
234 EndKvMap,
235 /// Indicates that the values within the list represent the same entity, but one or more representations are incomplete or lossy compared to the others. (`561`).
236 PartiallyEquivalentRepresentations,
237 /// Ontological root concept representing a type class or category of entities. (`565`).
238 EntityType,
239 /// Ontological concept representing a directed relationship or predicate type. (`566`).
240 RelationshipType,
241 /// Ontological concept representing a reified relationship or statement instance. (`567`).
242 Relationship,
243 /// Ontological concept representing an individual thing or entity. (`568`).
244 Entity,
245 /// A thing that replaces or supersedes another thing. (`569`).
246 Replacement,
247 /// Qualifier indicating that an option or representation is preferred over alternatives. (`570`).
248 Preferred,
249 /// A sequence of simpler or constituent elements into which something decomposes. (`571`).
250 Decomposition,
251 /// The authoritative human-readable name of something. (`572`).
252 CanonicalName,
253 /// A human-readable explanation of the meaning or purpose of something. (`573`).
254 Description,
255 /// An identifier string used to reference something in source code. (`574`).
256 ProgrammaticIdentifier,
257 /// A short informal name or command-line alias for something. (`575`).
258 Nickname,
259 /// An alternative informal name or synonym for something. (`576`).
260 InformalAlias,
261 /// A normative formal name alias for a character. (`577`).
262 FormalAlias,
263 /// An explanatory note or usage commentary attached to something. (`578`).
264 Annotation,
265 /// A signature description or pattern used to identify a data format. (`579`).
266 MagicSignature,
267 /// The Unicode Canonical Combining Class value of a character. (`580`).
268 CanonicalCombiningClass,
269 /// The Unicode Bidirectional Class code of a character. (`581`).
270 BidirectionalClass,
271 /// The casing partner character of a character. (`582`).
272 CaseMappingPartner,
273 /// The General Category classification of a character. (`583`).
274 CharacterGeneralCategory,
275 /// Asserts that the subject possesses the specified attribute component or property noun. (`584`).
276 HasA,
277 /// Asserts that a property attribute or expression has the specified value. (`585`).
278 IsEqualTo,
279 /// Asserts that the subject is an instance of the object type. (`586`).
280 IsInstanceOf,
281 /// Asserts that the subject type or format is a subtype of or logically entails the object type or format. (`587`).
282 IsSubtypeOf,
283 /// Asserts that the subject is derived from or historically based on the object. (`588`).
284 IsBasedOn,
285 /// Asserts whether the subject is deprecated. (`589`).
286 IsDeprecated,
287 /// Asserts that the subject closing delimiter character terminates a syntactic block opened by the object character. (`590`).
288 IsClosingDelimiterFor,
289 /// Asserts that the subject statement or revision node supersedes and replaces the object statement or revision node. (`591`).
290 Supersedes,
291 /// Asserts that the subject statement node withdraws and retracts the object statement node. (`592`).
292 Retracts,
293 /// A reference directing attention to another related entity or entry. (`593`).
294 CrossReference,
295 /// A pattern or grammar rule defining the valid syntactic structure of something. (`594`).
296 SyntaxRule,
297 /// A specification or expression describing the format, type, or composition pipeline of data. (`595`).
298 DataFormatDescription,
299 /// A Dc script classification, as in Unicode, extended for Dc (`596`).
300 CharacterScript,
301 /// An operating system environment or platform family. (`597`).
302 OperatingSystem,
303 /// Asserts that the subject is associated or affiliated with the object. (`598`).
304 IsAssociatedWith,
305 /// Placeholder referring to the character or pattern rule currently being defined or matched. (`599`).
306 SelfReference,
307 /// Matches any single Dc token or balanced syntactic frame. (`600`).
308 WildcardPattern,
309 /// Matches a Dc sequence only if all of the specified component patterns match. (`601`).
310 PatternConjunction,
311 /// Matches a Dc sequence if any of the specified alternative patterns match. (`602`).
312 PatternAlternation,
313 /// Quantifies a pattern element with an exact repetition count or a Dc 643 count range. (`603`).
314 PatternRepetition,
315 /// Matches any single Dc token or balanced syntactic frame that does not match the specified target pattern or character set. (`604`).
316 NegatedPattern,
317 /// Matches a sequence of Dcs against a referenced pattern or the syntax rule of a referenced entity or type, rather than matching the referenced identifier literally. (`605`).
318 SubpatternMatch,
319 /// Matches a pattern element and binds the matched Dc sub-sequence to an identifier for backreference, extraction, or substitution. (`606`).
320 PatternCapture,
321 /// Pairs a match pattern with a replacement or target Dc expression instantiated from its captured bindings. (`607`).
322 PatternReplacement,
323 /// General category as in Unicode, extended for Dc (`608`).
324 DcGeneralCategory,
325 /// The Unicode Script classification of a character. (`609`).
326 UnicodeScript,
327 /// Asserts that the subject property, attribute statement, or parameter has the specified value. (`610`).
328 HasValue,
329 /// A canonically equivalent decomposition of a character or sequence into a sequence with the same canonical meaning. (`611`).
330 CanonicalDecomposition,
331 /// A compatibility decomposition of a character into a sequence with equivalent compatibility content. (`612`).
332 CompatibilityDecomposition,
333 /// An approximate, non-executable decomposition of a character or type into a roughly corresponding sequence. (`613`).
334 ApproximateDecomposition,
335 /// A decomposition of a character into a sequence that approximates it while carrying additional semantic meaning. (`614`).
336 SemanticDecomposition,
337 /// Refers to the enclosing document or graph node currently being defined. (`615`).
338 EnclosingDocument,
339 /// Evaluates or substitutes the following [value] expression in place of itself in an [atom_dc] operand position. (`616`).
340 EvaluateValueAsAtom,
341 /// Begins a definition of the global graph node identified by the [atom_dc] header token. This creates a document scope, similar to 235 "Begin document": within the node body, Dc 615 (Enclosing document) refers to this node ID. (`617`).
342 BeginGraphNodeDefinition,
343 /// Terminates a graph node definition begun by Dc 617. (`618`).
344 EndGraphNodeDefinition,
345 /// Capability of an application or environment to read, parse, decode, decompress, or execute data in a format or forward transformation in general. (`619`).
346 GeneralFormatImportSupport,
347 /// Capability of an application or environment to import or convert data from a format into a Dc document representation. (`620`).
348 DcFormatImportSupport,
349 /// Capability of an application or environment to write, serialize, encode, compress, or reverse data in a format or transformation in general. (`621`).
350 GeneralFormatExportSupport,
351 /// Capability of an application or environment to export or convert a Dc document representation into a format. (`622`).
352 DcFormatExportSupport,
353 /// Automated test coverage in an application or environment for general handling of a format or transformation. (`623`).
354 GeneralFormatTestCoverage,
355 /// Automated test coverage in an application or environment for converting a format to or from Dc documents. (`624`).
356 DcFormatTestCoverage,
357 /// The maturity, completeness, or fidelity level of an implementation or test suite for a capability. (`625`).
358 ImplementationSupportLevel,
359 /// Indicates that a capability or conversion direction is not applicable to the format. (`626`).
360 SupportNotApplicable,
361 /// Indicates experimental or work-in-progress implementation or test coverage. (`627`).
362 SupportWorkInProgress,
363 /// Indicates support for a subset, basic dialect, or stream-level operation of a format, or partial test coverage. (`628`).
364 SupportPartial,
365 /// Indicates complete implementation of a format or complete semantic conversion to or from Dc syntax. (`629`).
366 SupportComplete,
367 /// Indicates that conversion preserves all information required for unambiguous bit-for-bit reconstruction. (`630`).
368 SupportLosslessRoundtrip,
369 /// Indicates lossless roundtripping with optional strict structural and semantic validation. (`631`).
370 SupportLosslessStrictValidation,
371 /// Property indicating a format variation (.Formats:format_variant) along which a format varies. (`632`).
372 FormatVariationAspect,
373 /// Property specifying the default variant format used by a format when none is explicitly specified. (`633`).
374 DefaultFormatVariant,
375 /// Short parameter nickname (such as in '@vary_as("...")') used to identify a format variation aspect in parametric format expressions. (`634`).
376 DcFormatVariationNickname,
377 /// Property identifying the data source or provenance from which a seed graph statement or node was derived. (`635`).
378 CollectiveToolboxSeedGraphDataSource,
379 /// Identifies the Collective Toolbox Dc CSV seed database tables in src/formats/dcdata/data-src/ as a data source. (`636`).
380 CollectiveToolboxDcCsvSeedDatabase,
381 /// General concept of manual entry or direct human authoring. (`637`).
382 ManualEntry,
383 /// Evaluates or asserts the first operand ([statement]) once for each element of the second operand, binding Dc 639 (This element) to the current element on each iteration. (`638`).
384 DistributeStatementOverEach,
385 /// Pronoun referring to the element currently being iterated over within an enclosing Dc 638 (Distribute statement over each element) expression. (The Dc is called "This" by analogy to jQuery $(this) in .each(), but maybe there's a better name for it.) (`639`).
386 ThisElement,
387 /// An unevaluated reference to a single Document Character (or Dc 616 atom expression), denoting the character or graph node itself rather than evaluating its syntax rule. (`640`).
388 TypeAtomDc,
389 /// Records the highest allocated System node ID when the document was written. (`641`).
390 GlobalGraphSystemBlockMostRecentNodeId,
391 /// Length of a data payload or representation in bytes. (`642`).
392 DataByteLength,
393 /// Defines a contiguous range of values of the specified type (or Dc 275 * for an unconstrained range) between a lower endpoint and an upper endpoint. Endpoints are inclusive unless wrapped in Dc 644 (Exclusive range endpoint), or unbounded if Dc 316 (Optional value absent). (`643`).
394 ValueRange,
395 /// Marks a lower or upper endpoint of a Dc 643 (Range) expression as strictly exclusive (open interval bound, excluding the endpoint value itself). (`644`).
396 ExclusiveRangeEndpoint,
397 /// Asserts whether the subject identifier, statement, or entity is stable. (`645`).
398 IsStable,
399 /// Asserts that the subject statement, property, or rule applies within the context or scope of the object entity. (`646`).
400 InContextOf,
401 /// WebAssembly instruction `unreachable` (opcode 0x00, stack type `[t* 1]->[t* 2]`). (`647`).
402 WasmStart,
403 /// WebAssembly instruction `struct.new x` (opcode 0xFB 0x00, stack type `[t*]->[(ref x)]`). (`903`).
404 WasmFbStart,
405 /// WebAssembly instruction `i32.trunc_sat_f32_s` (opcode 0xFC 0x00, stack type `[f32]->[i32]`). (`1159`).
406 WasmFcStart,
407 /// WebAssembly instruction `v128.load x memarg` (opcode 0xFD 0x00, stack type `[at]->[v128]`). (`1415`).
408 WasmFdPage0Start,
409 /// WebAssembly instruction `i8x16.relaxed_swizzle` (opcode 0xFD 0x80 0x02, stack type `[v128 v128]->[v128]`). (`1671`).
410 WasmFdPage1Start,
411 /// Begins a WebAssembly program consisting of either an ordered key-value array of program members or a direct sequence of WebAssembly instructions. (`1927`).
412 BeginWasmProgram,
413 /// Terminates a WebAssembly program begun by Dc 1927. (`1928`).
414 EndWasmProgram,
415 /// Standalone 1-Short-Dc execution supervisor for evaluating, converting, and metering Dc documents without starting the full workspace. (`1936`).
416 DcDocumentExecutionKernel,
417 /// Top-level 1-Short-Dc workspace bootstrap entry document for the full Collective Toolbox workspace application, delegating document execution and resource accounting to Dc 1936 (Dc document execution kernel). (`1937`).
418 CollectiveToolboxWorkspace,
419 /// Evaluates its second operand (and all graph definitions, decompositions, and routines transitively resolved within that evaluation) against the graph snapshot specified by [pin_description]. (`1938`).
420 ResolveToPin,
421 /// Queries the active System graph snapshot (respecting any active pin, or HEAD if unpinned) for verbatim node contents (617 <id> 600 618), exact-token reverse lookup (617 600 <tokens...> 618), relationship triples with 600 wildcards, or active snapshot watermark (641 600). (`1939`).
422 MinimalSystemGraphQuery,
423 /// Executes a pure Dc-WASM program (1927..1928 or wasm_routine) on the supplied [string] input under the shared task instruction quota, returning the program's output [string]. (`1940`).
424 ExecutePureWasmProgram,
425 /// Records the creation timestamp of the graph node defined in the enclosing checksummed document section as section metadata covered by the section digest. (`1941`).
426 SectionTimestampNodeCreationTime,
427 /// Property attaching a routine test block (Dc 2206..Dc 2207) of inline input/output contract cases to a routine entity. (`1942`).
428 RoutineTestSuite,
429 /// Begins a tokenized module containing an optional namespace declaration, zero or more use imports, and zero or more top-level items. (`2192`).
430 BeginModule,
431 /// Terminates a module begun by Dc 2192. (`2193`).
432 EndModule,
433 /// Declares the PSR-4 module namespace path of the enclosing module. (`2194`).
434 NamespaceDecl,
435 /// Imports one or more exported bindings or routines from the specified namespace path. (`2195`).
436 BeginUseImport,
437 /// Terminates a use import list begun by Dc 2195. (`2196`).
438 EndUseImport,
439 /// Specifies one imported item (by resolved Dc or source identifier) and an optional local alias identifier. (`2197`).
440 UseImportItem,
441 /// Declares a non-shadowing local mutable variable of the given type, with an optional initial value expression. (`2198`).
442 DeclareLet,
443 /// Declares a private immutable binding with an optional assigned graph Dc identity, static type, name, and initializer expression. (`2199`).
444 DeclareConst,
445 /// Declares an exported module-level immutable binding with an optional assigned graph Dc identity, static type, name, and initializer expression. (`2200`).
446 DeclarePub,
447 /// Assigns a new value expression to an existing mutable local variable (with an optional explicit static type matching its declaration). (`2201`).
448 AssignSet,
449 /// References a lexically bound variable or constant (by identifier or resolved graph Dc) with an optional explicit static type. (`2202`).
450 TypedValueRef,
451 /// Declares a named routine with a boolean export visibility flag (true for public, false for private), optional assigned graph Dc identity, return type, name, typed parameters, optional test block, and body expression. (`2203`).
452 BeginRoutineDecl,
453 /// Terminates a routine declaration begun by Dc 2203. (`2204`).
454 EndRoutineDecl,
455 /// Declares one formal parameter of a routine with its static type and identifier. (`2205`).
456 RoutineParam,
457 /// Begins a contract block of one or more inline input/output test cases attached to a routine declaration. (`2206`).
458 BeginTestBlock,
459 /// Terminates a routine test block begun by Dc 2206. (`2207`).
460 EndTestBlock,
461 /// Defines one inline routine test case consisting of positional argument expressions, Dc 2209, and the expected output expression (or FaultTrap for expected traps, or absent for void completion). (`2208`).
462 BeginTestCase,
463 /// Separates positional input argument expressions from the expected output within a Dc 2208 test case. (`2209`).
464 TestExpectedOut,
465 /// Terminates a routine test case begun by Dc 2208. (`2210`).
466 EndTestCase,
467 /// Invokes an inline routine value or a local or resolved graph routine with zero or more positional argument expressions. (`2211`).
468 BeginRoutineCall,
469 /// Terminates a routine call begun by Dc 2211. (`2212`).
470 EndRoutineCall,
471 /// Evaluates zero or more sequential expressions or local declarations in a new lexical scope, yielding the final expression's value (or void if empty). (`2213`).
472 BeginCodeBlock,
473 /// Terminates a code block begun by Dc 2213. (`2214`).
474 EndCodeBlock,
475 /// Begins a single n-ary tuple of length $length, declaring its $length slot types followed by $length contiguous ordered slot values separated by Dc 312. (`2215`).
476 BeginTuple,
477 /// Terminates an n-ary tuple begun by Dc 2215. (`2216`).
478 EndTuple,
479 /// Declares an immutable positional struct with a boolean export flag, optional assigned graph Dc identity, name, and one or more positional slot types. (`2217`).
480 BeginPositionalStructDecl,
481 /// Terminates a positional struct declaration begun by Dc 2217. (`2218`).
482 EndPositionalStructDecl,
483 /// Evaluates positional slot expressions left-to-right and constructs an instance of the referenced positional struct. (`2219`).
484 BeginPositionalStructValue,
485 /// Terminates a positional struct value constructor begun by Dc 2219. (`2220`).
486 EndPositionalStructValue,
487 /// Begins a tokenized StageR 3 module containing an optional namespace declaration, zero or more use imports, and zero or more top-level items. (`2221`).
488 BeginStagerModule,
489 /// Terminates a StageR 3 module begun by Dc 2221. (`2222`).
490 EndStagerModule,
491 /// Declares a nominal single-type wrapper with export visibility boolean, module-opacity boolean (false for transparent brand, true for module-opaque type), optional assigned graph Dc identity, underlying representation type, and identifier. (`2223`).
492 DeclareBrandType,
493 /// Declares an immutable named-field struct with export visibility boolean, optional assigned graph Dc identity, struct identifier, and one or more named field declarations. (`2224`).
494 BeginNamedStructDecl,
495 /// Terminates a named struct declaration begun by Dc 2224. (`2225`).
496 EndNamedStructDecl,
497 /// Declares one named field of a Dc 2224 struct with its static field type and field identifier. (`2226`).
498 NamedStructFieldDecl,
499 /// Evaluates named field initializers in source order and constructs an instance of the referenced named struct. (`2227`).
500 BeginNamedStructValue,
501 /// Terminates a named struct value constructor begun by Dc 2227. (`2228`).
502 EndNamedStructValue,
503 /// Initializes one named field within a Dc 2227 struct value constructor with its field identifier and value expression. (`2229`).
504 NamedStructFieldInit,
505 /// Declares a closed nominal tagged-union enum with export visibility boolean, optional assigned graph Dc identity, enum identifier, and zero or more variant declarations. (`2230`).
506 BeginEnumDecl,
507 /// Terminates an enum declaration begun by Dc 2230. (`2231`).
508 EndEnumDecl,
509 /// Declares one variant of a Dc 2230 enum with an optional payload type (absent for unit variants) and variant identifier. (`2232`).
510 EnumVariantDecl,
511 /// Constructs a value of the referenced enum with the specified variant identifier and optional payload expression. (`2233`).
512 EnumVariantValue,
513 /// Constructs the absent none variant of option/T for the specified payload type T. (`2234`).
514 OptionNoneValue,
515 /// Constructs the present some variant of option/T for the specified payload type T and payload expression. (`2235`).
516 OptionSomeValue,
517 /// Constructs the success ok variant of result/T for the specified success type T and payload expression. (`2236`).
518 ResultOkValue,
519 /// Constructs the failure err variant of result/T for the specified success type T and error-typed operand expression. (`2237`).
520 ResultErrValue,
521 /// Constructs a structured diagnostic error value identified by its tag identifier. (`2238`).
522 ErrorTagValue,
523 /// Quotes the single immediately following Document Character as an unnormalized and unevaluated atom without decomposing or evaluating it. (`2239`).
524 QuoteFollowingDcAsAtom,
525 /// Defines an anonymous inline routine value with its return type, zero or more typed formal parameters, and body expression. (`2240`).
526 BeginRoutine,
527 /// Terminates a routine value begun by Dc 2240. (`2241`).
528 EndRoutine,
529 /// Refers to the innermost enclosing routine (Dc 2203..Dc 2204 or Dc 2240..Dc 2241) as the target of a recursive Dc 2211..Dc 2212 routine call. (`2242`).
530 EnclosingRoutine,
531 /// Evaluates a boolean condition expression and branches to either the second operand (then) or third operand (else). (`2448`).
532 IfConditional,
533 /// Repeatedly evaluates the boolean condition expression and executes the void body expression while true. (`2449`).
534 WhileLoop,
535 /// Iterates over a sequence expression in order, binding a fresh non-shadowing element identifier of the declared type for each iteration of the body expression. (`2450`).
536 ForEach,
537 /// Exits the innermost enclosing loop immediately (type Never). (`2451`).
538 BreakLoop,
539 /// Advances immediately to the next iteration of the innermost enclosing loop (type Never). (`2452`).
540 ContinueLoop,
541 /// Returns early from the enclosing routine with an optional return value expression (or absent for void routines; type Never). (`2453`).
542 ReturnRoutine,
543 /// Deterministically aborts execution with an unrecoverable trap (type Never). (`2454`).
544 FaultTrap,
545 /// Evaluates to the unit value without side effects (type Void). (`2455`).
546 NoOp,
547 /// Evaluates a tagged scrutinee expression (enum, option/T, or result/T) and dispatches to the matching Dc 2458 case arm or optional trailing fallback expression. (`2456`).
548 BeginMatch,
549 /// Terminates a match expression begun by Dc 2456. (`2457`).
550 EndMatch,
551 /// Defines one variant arm of a Dc 2456 match expression with variant tag identifier, optional payload binding type, optional payload binding identifier, and arm body expression. (`2458`).
552 MatchCaseArm,
553 /// Unwraps ok/some from a result/T or option/T operand expression, or returns early from the enclosing routine on err/none. (`2459`).
554 PropagateOp,
555 /// Checked numeric addition of two operands of matching type; faults on overflow. (`2512`).
556 AddOp,
557 /// Checked subtraction of the second operand from the first operand; faults on overflow. (`2513`).
558 SubOp,
559 /// Checked numeric multiplication of two operands of matching type; faults on overflow. (`2514`).
560 MulOp,
561 /// Checked truncated division of the first operand by the second operand; faults on division by zero or signed minimum divided by -1. (`2515`).
562 DivOp,
563 /// Checked truncated remainder of dividing the first operand by the second operand; faults on zero divisor or signed minimum modulo -1. (`2516`).
564 RemOp,
565 /// Checked arithmetic negation of a signed operand; faults on two's-complement minimum value. (`2517`).
566 NegOp,
567 /// Modular two's-complement addition wrapping modulo 2^width on fixed-width integers. (`2518`).
568 WrapAddOp,
569 /// Modular two's-complement subtraction of the second operand from the first operand wrapping modulo 2^width. (`2519`).
570 WrapSubOp,
571 /// Modular two's-complement multiplication wrapping modulo 2^width on fixed-width integers. (`2520`).
572 WrapMulOp,
573 /// Bitwise conjunction of two integer operands of matching type. (`2521`).
574 BitAndOp,
575 /// Bitwise inclusive disjunction of two integer operands of matching type. (`2522`).
576 BitOrOp,
577 /// Bitwise exclusive disjunction of two integer operands of matching type. (`2523`).
578 BitXorOp,
579 /// Bitwise ones'-complement inversion of an integer operand. (`2524`).
580 BitNotOp,
581 /// Shifts the first integer operand left by the second u32 bit-count operand; faults if the shift count is greater than or equal to the bit width. (`2525`).
582 ShlOp,
583 /// Shifts the first integer operand right by the second u32 bit-count operand (logical zero-fill on unsigned types, arithmetic sign-extending on signed types); faults if the shift count is greater than or equal to the bit width. (`2526`).
584 ShrOp,
585 /// Bitwise left rotation of the first unsigned integer operand by the second u32 bit-count operand. (`2527`).
586 RotlOp,
587 /// Bitwise right rotation of the first unsigned integer operand by the second u32 bit-count operand. (`2528`).
588 RotrOp,
589 /// Counts leading zero bits in a fixed-width integer operand as a u32. (`2529`).
590 ClzOp,
591 /// Counts trailing zero bits in a fixed-width integer operand as a u32. (`2530`).
592 CtzOp,
593 /// Counts set one-bits in a fixed-width integer operand as a u32. (`2531`).
594 PopcntOp,
595 /// Boolean negation of a boolean operand. (`2532`).
596 LogicalNotOp,
597 /// Short-circuiting boolean conjunction: evaluates the second operand only when the first operand is true. (`2533`).
598 LogicalAndOp,
599 /// Short-circuiting boolean disjunction: evaluates the second operand only when the first operand is false. (`2534`).
600 LogicalOrOp,
601 /// Tests whether two operands of matching type are equal (including structural element-wise equality on immutable lists). (`2535`).
602 EqOp,
603 /// Tests whether two operands of matching type are not equal. (`2536`).
604 NeOp,
605 /// Tests whether the first operand is strictly less than the second operand. (`2537`).
606 LtOp,
607 /// Tests whether the first operand is less than or equal to the second operand. (`2538`).
608 LeOp,
609 /// Tests whether the first operand is strictly greater than the second operand. (`2539`).
610 GtOp,
611 /// Tests whether the first operand is greater than or equal to the second operand. (`2540`).
612 GeOp,
613 /// Converts the first operand's numeric value to the target type specified by the second operand (lossless when widening, faulting when outside the target type's range). (`2541`).
614 ConvertOp,
615 /// Reinterprets the raw bit pattern of the first fixed-width integer operand as a same-width integer of the target type specified by the second operand. (`2542`).
616 BitcastOp,
617 /// Returns the element count of a sequence or buffer as a u64. (`2543`).
618 SeqLenOp,
619 /// Reads the element of the first sequence/buffer operand at the zero-based u64 index given by the second operand; faults when out of bounds. (`2544`).
620 SeqGetOp,
621 /// Extracts the half-open sub-sequence [start..end) from the first operand using the second (start) and third (end) u64 index operands; faults unless start <= end <= length. (`2545`).
622 SeqSliceOp,
623 /// Returns a new immutable sequence containing all elements of the first operand followed by all elements of the second operand. (`2546`).
624 SeqConcatOp,
625 /// Projects the zero-based compile-time integer slot index from an n-ary tuple or positional struct. (`2547`).
626 GetPositionalFieldOp,
627 /// Evaluates the base tuple or positional struct expression then the replacement expression, returning a new value with the zero-based slot replaced. (`2548`).
628 WithPositionalFieldOp,
629 /// Projects the named field specified by the second identifier operand from the first named-struct expression. (`2549`).
630 GetNamedFieldOp,
631 /// Evaluates the base named-struct expression then the replacement expression, returning a new struct value with the named field replaced. (`2550`).
632 WithNamedFieldOp,
633 /// Wraps an underlying representation expression into the target brand or in-module opaque nominal type. (`2551`).
634 WrapNominalOp,
635 /// Extracts the underlying representation value from a brand or in-module opaque nominal value expression. (`2552`).
636 UnwrapNominalOp,
637 /// Total numeric addition: returns result/T on bounded fixed-width integers (err on overflow) and exact T on arbitrary-precision int and rat. (`2553`).
638 TotalAddOp,
639 /// Total numeric subtraction: returns result/T on bounded fixed-width integers (err on overflow) and exact T on arbitrary-precision int and rat. (`2554`).
640 TotalSubOp,
641 /// Total numeric multiplication: returns result/T on bounded fixed-width integers (err on overflow) and exact T on arbitrary-precision int and rat. (`2555`).
642 TotalMulOp,
643 /// Total numeric division: returns result/T (err on zero divisor, or signed MIN / -1 on fixed-width integers; truncating toward zero on integers, exact reduced quotient on rat). (`2556`).
644 TotalDivOp,
645 /// Total Euclidean modulo on integers: returns result/T with remainder r satisfying 0 <= r < |rhs| (err on zero divisor; ok 0 for signed MIN mod -1). (`2557`).
646 TotalModOp,
647 /// Total truncating remainder on integers: returns result/T matching truncating division (err on zero divisor; ok 0 for signed MIN truncRem -1). (`2558`).
648 TotalTruncRemOp,
649 /// Total arithmetic negation: returns result/T on bounded signed integers (err on two's-complement MIN) and exact T on int and rat. (`2559`).
650 TotalNegOp,
651 /// Total bitwise left shift of a fixed-width integer by a u32 bit count, returning result/T (err if count >= bit width). (`2560`).
652 TotalShlOp,
653 /// Total bitwise right shift of a fixed-width integer by a u32 bit count (logical on unsigned, arithmetic on signed), returning result/T (err if count >= bit width). (`2561`).
654 TotalShrOp,
655 /// Converts the first numeric operand to the target type: infallible T when strictly widening, or result/T when narrowing or bounds-checked. (`2562`).
656 TotalConvertOp,
657 /// Reads the element of a sequence or buffer at a zero-based u64 index, returning option/Elem (none when out of bounds). (`2563`).
658 TotalSeqGetOp,
659 /// Extracts half-open sub-sequence [start..end) using u64 indices, returning option/Seq (none unless start <= end <= length). (`2564`).
660 TotalSeqSliceOp,
661 /// Overwrites a linear un-frozen StageR buffer at a zero-based u64 index, returning result/void (err outOfBounds when index >= length). (`2565`).
662 TotalBufSetOp,
663 /// Tests whether an option/T operand holds a present some value. (`2566`).
664 OptionIsSomeOp,
665 /// Tests whether an option/T operand is none. (`2567`).
666 OptionIsNoneOp,
667 /// Tests whether a result/T operand holds a success ok value. (`2568`).
668 ResultIsOkOp,
669 /// Tests whether a result/T operand holds a failure err value. (`2569`).
670 ResultIsErrOp,
671 /// Evaluates an option/T or result/T expression and a fallback T expression, returning the unwrapped payload or the fallback value. (`2570`).
672 UnwrapOrOp,
673 /// Converts an option/T operand into result/T, mapping some v to ok v and none to err of the second error operand. (`2571`).
674 OptionOkOrOp,
675 /// Returns the encoded DcMixed payload byte length of an s (DcMst) value as a u64. (`2572`).
676 ByteLenOp,
677 /// Parameterized immutable value-semantics StageL list type l/T over element type T. (`2576`).
678 StagelListType,
679 /// Parameterized mutable local StageL buffer type buf/T over element type T for linear-time construction and O(1) indexed updates. (`2577`).
680 StagelBufType,
681 /// Constructs an immutable StageL list of the specified element type from zero or more evaluated element expressions. (`2578`).
682 BeginStagelList,
683 /// Terminates a StageL list constructor begun by Dc 2578. (`2579`).
684 EndStagelList,
685 /// Allocates an empty mutable StageL buffer of the specified element type with initial u64 capacity given by the second operand. (`2580`).
686 StagelBufNew,
687 /// Allocates a mutable StageL buffer initialized with copies of the first element-value operand repeated to the u64 length given by the second operand. (`2581`).
688 StagelBufFill,
689 /// Appends the second element operand to the end of the first mutable StageL buffer operand in amortized O(1) time; faults if the buffer has been frozen. (`2582`).
690 StagelBufPush,
691 /// Appends all elements of the second immutable list operand to the end of the first mutable StageL buffer operand; faults if the buffer has been frozen. (`2583`).
692 StagelBufExtend,
693 /// Overwrites the element of the first mutable StageL buffer operand at the zero-based u64 index (second operand) with the third operand in O(1) time; faults if out of bounds or frozen. (`2584`).
694 StagelBufSet,
695 /// Freezes a mutable StageL buffer into an immutable l/T list in O(1) zero-copy time and marks the buffer handle frozen against subsequent mutation. (`2585`).
696 StagelBufFreeze,
697 /// Compiles the quoted Dc document inside [string] (Dc 260..Dc 261) into an executable WASM program (Dc 1927..Dc 1928) without executing the target program. (`2608`).
698 ConvertDcStringToWasm,
699 /// Constructs a canonical reduced rational rat from numerator int and denominator int, returning result/rat (err divisionByZero when denominator is 0). (`2609`).
700 MakeRatOp,
701 /// Constructs a dc Document Character directly from its raw 128-bit numeric identifier (infallible u128 -> dc; all 0..=2^128-1 values, including UTF-16 surrogate codepoints, are valid Document Characters). (`2610`).
702 DcFromU128Op,
703 /// Extracts the raw 128-bit numeric identifier of a dc value as an infallible u128. (`2611`).
704 U128FromDcOp,
705 /// Validates that an s (DcMst) value contains no encapsulated binary runs, returning result/dcs (err invalidEncoding if binary segments are present). (`2612`).
706 DcsFromSOp,
707 /// Widens a pure-character dcs string infallibly into a mixed-mode s (DcMst) string. (`2613`).
708 SFromDcsOp,
709 /// Splits a sequence (l/T, dcs, or s) around non-overlapping occurrences of the first separator operand, returning l/Seq. (`2614`).
710 SeqExplodeOp,
711 /// Concatenates a list of sequences (l/l/T, l/dcs, or l/s) interspersed with the first separator operand, returning Seq. (`2615`).
712 SeqImplodeOp,
713 /// Requests a host capability payload (l/u8 -> l/u8 in StageL 3, s -> result/s in StageR 3) by yielding to the bootstrap kernel host ABI. (`2616`).
714 RequestHostCapabilityOp,
715 /// Fixed-slot n-ary tuple type parameterized by a Dc 310..Dc 311 list of slot types. (`2672`).
716 TypeTuple,
717 /// References a declared positional or named struct type by identifier or resolved graph Dc. (`2673`).
718 TypeStruct,
719 /// Parameterized optional value type option/T with variants none and some T. (`2674`).
720 TypeOption,
721 /// Parameterized fallible result type result/T with variants ok T and err error. (`2675`).
722 TypeResult,
723 /// Structured non-panicking StageR diagnostic error value type. (`2676`).
724 TypeError,
725 /// Immutable bounds-checked read-only window handle over a host-managed streaming extent. (`2677`).
726 TypeView,
727 /// Immutable value-typed cursor advancing functionally over a host-managed extent view. (`2678`).
728 TypeCursor,
729 /// References a declared StageR brand, module-opaque type, or enum type by identifier or resolved graph Dc. (`2679`).
730 TypeNominal,
731 /// Base64 encapsulation digit character (0..=63).
732Base64Digit,
733/// Built-in type token, format token, or type operator.
734TypeToken,
735/// Expression starter token that can be evaluated (`.EM Routines`, references, invocations, representation sets).
736EvaluableExpressionStarter,
737}
738
739impl DcRole {
740 /// Returns the defining short Dc ID for this role, if uniquely defined by a single Document Character.
741#[must_use]
742pub fn defining_short(self) -> Option<u32> {
743match self {
744 Self::Range => Some(4),
745 Self::BeginNumber => Some(6),
746 Self::EndNumber => Some(7),
747 Self::Positive => Some(10),
748 Self::Negative => Some(11),
749 Self::Base64Start => Some(127),
750 Self::Base64End => Some(190),
751 Self::StartEncapsulationUtf8 => Some(191),
752 Self::EndEncapsulationUtf8 => Some(192),
753 Self::Base64Padding => Some(195),
754 Self::StartEncapsulationBinary => Some(203),
755 Self::EndEncapsulationBinary => Some(204),
756 Self::ReplacementUnavailUnicode => Some(206),
757 Self::ReplacementUnavailDc => Some(207),
758 Self::BeginDocument => Some(235),
759 Self::EndDocument => Some(236),
760 Self::BeginSingleLineComment => Some(246),
761 Self::BeginSingleLineCommentNewLine => Some(247),
762 Self::EndSingleLineComment => Some(248),
763 Self::BeginBlockComment => Some(249),
764 Self::BeginBlockCommentNewLine => Some(250),
765 Self::EndBlockComment => Some(251),
766 Self::Escape => Some(255),
767 Self::LangSay => Some(256),
768 Self::BeginParameter => Some(258),
769 Self::EndParameter => Some(259),
770 Self::BeginLiteral => Some(260),
771 Self::EndLiteral => Some(261),
772 Self::BeginTypeDef => Some(262),
773 Self::EndTypeDef => Some(263),
774 Self::TypeString => Some(264),
775 Self::LangAssign => Some(268),
776 Self::Assign => Some(269),
777 Self::BeginIdentifier => Some(270),
778 Self::EndIdentifier => Some(271),
779 Self::TypeAny => Some(275),
780 Self::ReferenceNamedObject => Some(276),
781 Self::TypeNumber => Some(278),
782 Self::RoutineInvocation => Some(279),
783 Self::TypeRoutine => Some(280),
784 Self::LocalNode => Some(296),
785 Self::BeginAssociativityGroup => Some(298),
786 Self::EndAssociativityGroup => Some(299),
787 Self::TypeUnion => Some(300),
788 Self::TypeTransformation => Some(301),
789 Self::TypeConversion => Some(302),
790 Self::TypeTransmutation => Some(303),
791 Self::TypeRoutineName => Some(306),
792 Self::LongDc => Some(308),
793 Self::BeginList => Some(310),
794 Self::EndList => Some(311),
795 Self::ListElementSeparator => Some(312),
796 Self::BeginLegacyKvMap => Some(313),
797 Self::EndLegacyKvMap => Some(314),
798 Self::OptionalPresent => Some(315),
799 Self::OptionalAbsent => Some(316),
800 Self::BeginEnvironmentDescription => Some(340),
801 Self::EndEnvironmentDescription => Some(341),
802 Self::BeginFileFlagsDescription => Some(388),
803 Self::EndFileFlagsDescription => Some(389),
804 Self::BeginTimeMoment => Some(390),
805 Self::EndTimeMoment => Some(391),
806 Self::BeginDateMagnitude => Some(393),
807 Self::EndDateMagnitude => Some(394),
808 Self::BeginDateDuration => Some(395),
809 Self::EndDateDuration => Some(396),
810 Self::EquivalentRepresentations => Some(397),
811 Self::BeginFormatRepresentation => Some(511),
812 Self::EndFormatRepresentation => Some(512),
813 Self::FilePathDelimiter => Some(513),
814 Self::BeginKvPair => Some(514),
815 Self::EndKvPair => Some(515),
816 Self::TypeIntersection => Some(516),
817 Self::BooleanTrue => Some(517),
818 Self::BooleanFalse => Some(518),
819 Self::FormatParamApplication => Some(535),
820 Self::RawFileFlags => Some(539),
821 Self::ReferenceBoundValue => Some(540),
822 Self::EnterIdentifierScope => Some(541),
823 Self::ExitIdentifierScope => Some(542),
824 Self::BeginChecksummedSection => Some(543),
825 Self::EndChecksummedSection => Some(544),
826 Self::SectionDigest => Some(545),
827 Self::SequenceIdentifier => Some(546),
828 Self::BeginOperationSession => Some(547),
829 Self::EndOperationSession => Some(548),
830 Self::SourcePath => Some(549),
831 Self::DestinationPath => Some(550),
832 Self::OperationCompleted => Some(551),
833 Self::BeginErrorRecord => Some(552),
834 Self::EndErrorRecord => Some(553),
835 Self::BeginWarningRecord => Some(554),
836 Self::EndWarningRecord => Some(555),
837 Self::LogMessage => Some(556),
838 Self::TraceIdentifier => Some(557),
839 Self::OperationStatusCode => Some(558),
840 Self::BeginKvMap => Some(559),
841 Self::EndKvMap => Some(560),
842 Self::PartiallyEquivalentRepresentations => Some(561),
843 Self::EntityType => Some(565),
844 Self::RelationshipType => Some(566),
845 Self::Relationship => Some(567),
846 Self::Entity => Some(568),
847 Self::Replacement => Some(569),
848 Self::Preferred => Some(570),
849 Self::Decomposition => Some(571),
850 Self::CanonicalName => Some(572),
851 Self::Description => Some(573),
852 Self::ProgrammaticIdentifier => Some(574),
853 Self::Nickname => Some(575),
854 Self::InformalAlias => Some(576),
855 Self::FormalAlias => Some(577),
856 Self::Annotation => Some(578),
857 Self::MagicSignature => Some(579),
858 Self::CanonicalCombiningClass => Some(580),
859 Self::BidirectionalClass => Some(581),
860 Self::CaseMappingPartner => Some(582),
861 Self::CharacterGeneralCategory => Some(583),
862 Self::HasA => Some(584),
863 Self::IsEqualTo => Some(585),
864 Self::IsInstanceOf => Some(586),
865 Self::IsSubtypeOf => Some(587),
866 Self::IsBasedOn => Some(588),
867 Self::IsDeprecated => Some(589),
868 Self::IsClosingDelimiterFor => Some(590),
869 Self::Supersedes => Some(591),
870 Self::Retracts => Some(592),
871 Self::CrossReference => Some(593),
872 Self::SyntaxRule => Some(594),
873 Self::DataFormatDescription => Some(595),
874 Self::CharacterScript => Some(596),
875 Self::OperatingSystem => Some(597),
876 Self::IsAssociatedWith => Some(598),
877 Self::SelfReference => Some(599),
878 Self::WildcardPattern => Some(600),
879 Self::PatternConjunction => Some(601),
880 Self::PatternAlternation => Some(602),
881 Self::PatternRepetition => Some(603),
882 Self::NegatedPattern => Some(604),
883 Self::SubpatternMatch => Some(605),
884 Self::PatternCapture => Some(606),
885 Self::PatternReplacement => Some(607),
886 Self::DcGeneralCategory => Some(608),
887 Self::UnicodeScript => Some(609),
888 Self::HasValue => Some(610),
889 Self::CanonicalDecomposition => Some(611),
890 Self::CompatibilityDecomposition => Some(612),
891 Self::ApproximateDecomposition => Some(613),
892 Self::SemanticDecomposition => Some(614),
893 Self::EnclosingDocument => Some(615),
894 Self::EvaluateValueAsAtom => Some(616),
895 Self::BeginGraphNodeDefinition => Some(617),
896 Self::EndGraphNodeDefinition => Some(618),
897 Self::GeneralFormatImportSupport => Some(619),
898 Self::DcFormatImportSupport => Some(620),
899 Self::GeneralFormatExportSupport => Some(621),
900 Self::DcFormatExportSupport => Some(622),
901 Self::GeneralFormatTestCoverage => Some(623),
902 Self::DcFormatTestCoverage => Some(624),
903 Self::ImplementationSupportLevel => Some(625),
904 Self::SupportNotApplicable => Some(626),
905 Self::SupportWorkInProgress => Some(627),
906 Self::SupportPartial => Some(628),
907 Self::SupportComplete => Some(629),
908 Self::SupportLosslessRoundtrip => Some(630),
909 Self::SupportLosslessStrictValidation => Some(631),
910 Self::FormatVariationAspect => Some(632),
911 Self::DefaultFormatVariant => Some(633),
912 Self::DcFormatVariationNickname => Some(634),
913 Self::CollectiveToolboxSeedGraphDataSource => Some(635),
914 Self::CollectiveToolboxDcCsvSeedDatabase => Some(636),
915 Self::ManualEntry => Some(637),
916 Self::DistributeStatementOverEach => Some(638),
917 Self::ThisElement => Some(639),
918 Self::TypeAtomDc => Some(640),
919 Self::GlobalGraphSystemBlockMostRecentNodeId => Some(641),
920 Self::DataByteLength => Some(642),
921 Self::ValueRange => Some(643),
922 Self::ExclusiveRangeEndpoint => Some(644),
923 Self::IsStable => Some(645),
924 Self::InContextOf => Some(646),
925 Self::WasmStart => Some(647),
926 Self::WasmFbStart => Some(903),
927 Self::WasmFcStart => Some(1159),
928 Self::WasmFdPage0Start => Some(1415),
929 Self::WasmFdPage1Start => Some(1671),
930 Self::BeginWasmProgram => Some(1927),
931 Self::EndWasmProgram => Some(1928),
932 Self::DcDocumentExecutionKernel => Some(1936),
933 Self::CollectiveToolboxWorkspace => Some(1937),
934 Self::ResolveToPin => Some(1938),
935 Self::MinimalSystemGraphQuery => Some(1939),
936 Self::ExecutePureWasmProgram => Some(1940),
937 Self::SectionTimestampNodeCreationTime => Some(1941),
938 Self::RoutineTestSuite => Some(1942),
939 Self::BeginModule => Some(2192),
940 Self::EndModule => Some(2193),
941 Self::NamespaceDecl => Some(2194),
942 Self::BeginUseImport => Some(2195),
943 Self::EndUseImport => Some(2196),
944 Self::UseImportItem => Some(2197),
945 Self::DeclareLet => Some(2198),
946 Self::DeclareConst => Some(2199),
947 Self::DeclarePub => Some(2200),
948 Self::AssignSet => Some(2201),
949 Self::TypedValueRef => Some(2202),
950 Self::BeginRoutineDecl => Some(2203),
951 Self::EndRoutineDecl => Some(2204),
952 Self::RoutineParam => Some(2205),
953 Self::BeginTestBlock => Some(2206),
954 Self::EndTestBlock => Some(2207),
955 Self::BeginTestCase => Some(2208),
956 Self::TestExpectedOut => Some(2209),
957 Self::EndTestCase => Some(2210),
958 Self::BeginRoutineCall => Some(2211),
959 Self::EndRoutineCall => Some(2212),
960 Self::BeginCodeBlock => Some(2213),
961 Self::EndCodeBlock => Some(2214),
962 Self::BeginTuple => Some(2215),
963 Self::EndTuple => Some(2216),
964 Self::BeginPositionalStructDecl => Some(2217),
965 Self::EndPositionalStructDecl => Some(2218),
966 Self::BeginPositionalStructValue => Some(2219),
967 Self::EndPositionalStructValue => Some(2220),
968 Self::BeginStagerModule => Some(2221),
969 Self::EndStagerModule => Some(2222),
970 Self::DeclareBrandType => Some(2223),
971 Self::BeginNamedStructDecl => Some(2224),
972 Self::EndNamedStructDecl => Some(2225),
973 Self::NamedStructFieldDecl => Some(2226),
974 Self::BeginNamedStructValue => Some(2227),
975 Self::EndNamedStructValue => Some(2228),
976 Self::NamedStructFieldInit => Some(2229),
977 Self::BeginEnumDecl => Some(2230),
978 Self::EndEnumDecl => Some(2231),
979 Self::EnumVariantDecl => Some(2232),
980 Self::EnumVariantValue => Some(2233),
981 Self::OptionNoneValue => Some(2234),
982 Self::OptionSomeValue => Some(2235),
983 Self::ResultOkValue => Some(2236),
984 Self::ResultErrValue => Some(2237),
985 Self::ErrorTagValue => Some(2238),
986 Self::QuoteFollowingDcAsAtom => Some(2239),
987 Self::BeginRoutine => Some(2240),
988 Self::EndRoutine => Some(2241),
989 Self::EnclosingRoutine => Some(2242),
990 Self::IfConditional => Some(2448),
991 Self::WhileLoop => Some(2449),
992 Self::ForEach => Some(2450),
993 Self::BreakLoop => Some(2451),
994 Self::ContinueLoop => Some(2452),
995 Self::ReturnRoutine => Some(2453),
996 Self::FaultTrap => Some(2454),
997 Self::NoOp => Some(2455),
998 Self::BeginMatch => Some(2456),
999 Self::EndMatch => Some(2457),
1000 Self::MatchCaseArm => Some(2458),
1001 Self::PropagateOp => Some(2459),
1002 Self::AddOp => Some(2512),
1003 Self::SubOp => Some(2513),
1004 Self::MulOp => Some(2514),
1005 Self::DivOp => Some(2515),
1006 Self::RemOp => Some(2516),
1007 Self::NegOp => Some(2517),
1008 Self::WrapAddOp => Some(2518),
1009 Self::WrapSubOp => Some(2519),
1010 Self::WrapMulOp => Some(2520),
1011 Self::BitAndOp => Some(2521),
1012 Self::BitOrOp => Some(2522),
1013 Self::BitXorOp => Some(2523),
1014 Self::BitNotOp => Some(2524),
1015 Self::ShlOp => Some(2525),
1016 Self::ShrOp => Some(2526),
1017 Self::RotlOp => Some(2527),
1018 Self::RotrOp => Some(2528),
1019 Self::ClzOp => Some(2529),
1020 Self::CtzOp => Some(2530),
1021 Self::PopcntOp => Some(2531),
1022 Self::LogicalNotOp => Some(2532),
1023 Self::LogicalAndOp => Some(2533),
1024 Self::LogicalOrOp => Some(2534),
1025 Self::EqOp => Some(2535),
1026 Self::NeOp => Some(2536),
1027 Self::LtOp => Some(2537),
1028 Self::LeOp => Some(2538),
1029 Self::GtOp => Some(2539),
1030 Self::GeOp => Some(2540),
1031 Self::ConvertOp => Some(2541),
1032 Self::BitcastOp => Some(2542),
1033 Self::SeqLenOp => Some(2543),
1034 Self::SeqGetOp => Some(2544),
1035 Self::SeqSliceOp => Some(2545),
1036 Self::SeqConcatOp => Some(2546),
1037 Self::GetPositionalFieldOp => Some(2547),
1038 Self::WithPositionalFieldOp => Some(2548),
1039 Self::GetNamedFieldOp => Some(2549),
1040 Self::WithNamedFieldOp => Some(2550),
1041 Self::WrapNominalOp => Some(2551),
1042 Self::UnwrapNominalOp => Some(2552),
1043 Self::TotalAddOp => Some(2553),
1044 Self::TotalSubOp => Some(2554),
1045 Self::TotalMulOp => Some(2555),
1046 Self::TotalDivOp => Some(2556),
1047 Self::TotalModOp => Some(2557),
1048 Self::TotalTruncRemOp => Some(2558),
1049 Self::TotalNegOp => Some(2559),
1050 Self::TotalShlOp => Some(2560),
1051 Self::TotalShrOp => Some(2561),
1052 Self::TotalConvertOp => Some(2562),
1053 Self::TotalSeqGetOp => Some(2563),
1054 Self::TotalSeqSliceOp => Some(2564),
1055 Self::TotalBufSetOp => Some(2565),
1056 Self::OptionIsSomeOp => Some(2566),
1057 Self::OptionIsNoneOp => Some(2567),
1058 Self::ResultIsOkOp => Some(2568),
1059 Self::ResultIsErrOp => Some(2569),
1060 Self::UnwrapOrOp => Some(2570),
1061 Self::OptionOkOrOp => Some(2571),
1062 Self::ByteLenOp => Some(2572),
1063 Self::StagelListType => Some(2576),
1064 Self::StagelBufType => Some(2577),
1065 Self::BeginStagelList => Some(2578),
1066 Self::EndStagelList => Some(2579),
1067 Self::StagelBufNew => Some(2580),
1068 Self::StagelBufFill => Some(2581),
1069 Self::StagelBufPush => Some(2582),
1070 Self::StagelBufExtend => Some(2583),
1071 Self::StagelBufSet => Some(2584),
1072 Self::StagelBufFreeze => Some(2585),
1073 Self::ConvertDcStringToWasm => Some(2608),
1074 Self::MakeRatOp => Some(2609),
1075 Self::DcFromU128Op => Some(2610),
1076 Self::U128FromDcOp => Some(2611),
1077 Self::DcsFromSOp => Some(2612),
1078 Self::SFromDcsOp => Some(2613),
1079 Self::SeqExplodeOp => Some(2614),
1080 Self::SeqImplodeOp => Some(2615),
1081 Self::RequestHostCapabilityOp => Some(2616),
1082 Self::TypeTuple => Some(2672),
1083 Self::TypeStruct => Some(2673),
1084 Self::TypeOption => Some(2674),
1085 Self::TypeResult => Some(2675),
1086 Self::TypeError => Some(2676),
1087 Self::TypeView => Some(2677),
1088 Self::TypeCursor => Some(2678),
1089 Self::TypeNominal => Some(2679),
1090 _ => None,
1091}
1092}
1093
1094/// Returns the defining `DcChar` for this role, if uniquely defined by a single Document Character.
1095#[must_use]
1096pub fn defining_dc(self) -> Option<DcChar> {
1097self.defining_short().map(DcChar::from_short)
1098}
1099
1100/// Returns true if the given canonical token (in global graph `u128` layout)
1101/// directly matches this role.
1102#[must_use]
1103pub fn matches_canonical(self, token: u128) -> bool {
1104let short = DcChar::from_u128(token).to_short().ok();
1105match self {
1106 Self::Range => short == Some(4),
1107 Self::BeginNumber => short == Some(6),
1108 Self::EndNumber => short == Some(7),
1109 Self::Positive => short == Some(10),
1110 Self::Negative => short == Some(11),
1111 Self::Base64Start => short == Some(127),
1112 Self::Base64End => short == Some(190),
1113 Self::StartEncapsulationUtf8 => short == Some(191),
1114 Self::EndEncapsulationUtf8 => short == Some(192),
1115 Self::Base64Padding => short == Some(195),
1116 Self::StartEncapsulationBinary => short == Some(203),
1117 Self::EndEncapsulationBinary => short == Some(204),
1118 Self::ReplacementUnavailUnicode => short == Some(206),
1119 Self::ReplacementUnavailDc => short == Some(207),
1120 Self::BeginDocument => short == Some(235),
1121 Self::EndDocument => short == Some(236),
1122 Self::BeginSingleLineComment => short == Some(246),
1123 Self::BeginSingleLineCommentNewLine => short == Some(247),
1124 Self::EndSingleLineComment => short == Some(248),
1125 Self::BeginBlockComment => short == Some(249),
1126 Self::BeginBlockCommentNewLine => short == Some(250),
1127 Self::EndBlockComment => short == Some(251),
1128 Self::Escape => short == Some(255),
1129 Self::LangSay => short == Some(256),
1130 Self::BeginParameter => short == Some(258),
1131 Self::EndParameter => short == Some(259),
1132 Self::BeginLiteral => short == Some(260),
1133 Self::EndLiteral => short == Some(261),
1134 Self::BeginTypeDef => short == Some(262),
1135 Self::EndTypeDef => short == Some(263),
1136 Self::TypeString => short == Some(264),
1137 Self::LangAssign => short == Some(268),
1138 Self::Assign => short == Some(269),
1139 Self::BeginIdentifier => short == Some(270),
1140 Self::EndIdentifier => short == Some(271),
1141 Self::TypeAny => short == Some(275),
1142 Self::ReferenceNamedObject => short == Some(276),
1143 Self::TypeNumber => short == Some(278),
1144 Self::RoutineInvocation => short == Some(279),
1145 Self::TypeRoutine => short == Some(280),
1146 Self::LocalNode => short == Some(296),
1147 Self::BeginAssociativityGroup => short == Some(298),
1148 Self::EndAssociativityGroup => short == Some(299),
1149 Self::TypeUnion => short == Some(300),
1150 Self::TypeTransformation => short == Some(301),
1151 Self::TypeConversion => short == Some(302),
1152 Self::TypeTransmutation => short == Some(303),
1153 Self::TypeRoutineName => short == Some(306),
1154 Self::LongDc => short == Some(308),
1155 Self::BeginList => short == Some(310),
1156 Self::EndList => short == Some(311),
1157 Self::ListElementSeparator => short == Some(312),
1158 Self::BeginLegacyKvMap => short == Some(313),
1159 Self::EndLegacyKvMap => short == Some(314),
1160 Self::OptionalPresent => short == Some(315),
1161 Self::OptionalAbsent => short == Some(316),
1162 Self::BeginEnvironmentDescription => short == Some(340),
1163 Self::EndEnvironmentDescription => short == Some(341),
1164 Self::BeginFileFlagsDescription => short == Some(388),
1165 Self::EndFileFlagsDescription => short == Some(389),
1166 Self::BeginTimeMoment => short == Some(390),
1167 Self::EndTimeMoment => short == Some(391),
1168 Self::BeginDateMagnitude => short == Some(393),
1169 Self::EndDateMagnitude => short == Some(394),
1170 Self::BeginDateDuration => short == Some(395),
1171 Self::EndDateDuration => short == Some(396),
1172 Self::EquivalentRepresentations => short == Some(397),
1173 Self::BeginFormatRepresentation => short == Some(511),
1174 Self::EndFormatRepresentation => short == Some(512),
1175 Self::FilePathDelimiter => short == Some(513),
1176 Self::BeginKvPair => short == Some(514),
1177 Self::EndKvPair => short == Some(515),
1178 Self::TypeIntersection => short == Some(516),
1179 Self::BooleanTrue => short == Some(517),
1180 Self::BooleanFalse => short == Some(518),
1181 Self::FormatParamApplication => short == Some(535),
1182 Self::RawFileFlags => short == Some(539),
1183 Self::ReferenceBoundValue => short == Some(540),
1184 Self::EnterIdentifierScope => short == Some(541),
1185 Self::ExitIdentifierScope => short == Some(542),
1186 Self::BeginChecksummedSection => short == Some(543),
1187 Self::EndChecksummedSection => short == Some(544),
1188 Self::SectionDigest => short == Some(545),
1189 Self::SequenceIdentifier => short == Some(546),
1190 Self::BeginOperationSession => short == Some(547),
1191 Self::EndOperationSession => short == Some(548),
1192 Self::SourcePath => short == Some(549),
1193 Self::DestinationPath => short == Some(550),
1194 Self::OperationCompleted => short == Some(551),
1195 Self::BeginErrorRecord => short == Some(552),
1196 Self::EndErrorRecord => short == Some(553),
1197 Self::BeginWarningRecord => short == Some(554),
1198 Self::EndWarningRecord => short == Some(555),
1199 Self::LogMessage => short == Some(556),
1200 Self::TraceIdentifier => short == Some(557),
1201 Self::OperationStatusCode => short == Some(558),
1202 Self::BeginKvMap => short == Some(559),
1203 Self::EndKvMap => short == Some(560),
1204 Self::PartiallyEquivalentRepresentations => short == Some(561),
1205 Self::EntityType => short == Some(565),
1206 Self::RelationshipType => short == Some(566),
1207 Self::Relationship => short == Some(567),
1208 Self::Entity => short == Some(568),
1209 Self::Replacement => short == Some(569),
1210 Self::Preferred => short == Some(570),
1211 Self::Decomposition => short == Some(571),
1212 Self::CanonicalName => short == Some(572),
1213 Self::Description => short == Some(573),
1214 Self::ProgrammaticIdentifier => short == Some(574),
1215 Self::Nickname => short == Some(575),
1216 Self::InformalAlias => short == Some(576),
1217 Self::FormalAlias => short == Some(577),
1218 Self::Annotation => short == Some(578),
1219 Self::MagicSignature => short == Some(579),
1220 Self::CanonicalCombiningClass => short == Some(580),
1221 Self::BidirectionalClass => short == Some(581),
1222 Self::CaseMappingPartner => short == Some(582),
1223 Self::CharacterGeneralCategory => short == Some(583),
1224 Self::HasA => short == Some(584),
1225 Self::IsEqualTo => short == Some(585),
1226 Self::IsInstanceOf => short == Some(586),
1227 Self::IsSubtypeOf => short == Some(587),
1228 Self::IsBasedOn => short == Some(588),
1229 Self::IsDeprecated => short == Some(589),
1230 Self::IsClosingDelimiterFor => short == Some(590),
1231 Self::Supersedes => short == Some(591),
1232 Self::Retracts => short == Some(592),
1233 Self::CrossReference => short == Some(593),
1234 Self::SyntaxRule => short == Some(594),
1235 Self::DataFormatDescription => short == Some(595),
1236 Self::CharacterScript => short == Some(596),
1237 Self::OperatingSystem => short == Some(597),
1238 Self::IsAssociatedWith => short == Some(598),
1239 Self::SelfReference => short == Some(599),
1240 Self::WildcardPattern => short == Some(600),
1241 Self::PatternConjunction => short == Some(601),
1242 Self::PatternAlternation => short == Some(602),
1243 Self::PatternRepetition => short == Some(603),
1244 Self::NegatedPattern => short == Some(604),
1245 Self::SubpatternMatch => short == Some(605),
1246 Self::PatternCapture => short == Some(606),
1247 Self::PatternReplacement => short == Some(607),
1248 Self::DcGeneralCategory => short == Some(608),
1249 Self::UnicodeScript => short == Some(609),
1250 Self::HasValue => short == Some(610),
1251 Self::CanonicalDecomposition => short == Some(611),
1252 Self::CompatibilityDecomposition => short == Some(612),
1253 Self::ApproximateDecomposition => short == Some(613),
1254 Self::SemanticDecomposition => short == Some(614),
1255 Self::EnclosingDocument => short == Some(615),
1256 Self::EvaluateValueAsAtom => short == Some(616),
1257 Self::BeginGraphNodeDefinition => short == Some(617),
1258 Self::EndGraphNodeDefinition => short == Some(618),
1259 Self::GeneralFormatImportSupport => short == Some(619),
1260 Self::DcFormatImportSupport => short == Some(620),
1261 Self::GeneralFormatExportSupport => short == Some(621),
1262 Self::DcFormatExportSupport => short == Some(622),
1263 Self::GeneralFormatTestCoverage => short == Some(623),
1264 Self::DcFormatTestCoverage => short == Some(624),
1265 Self::ImplementationSupportLevel => short == Some(625),
1266 Self::SupportNotApplicable => short == Some(626),
1267 Self::SupportWorkInProgress => short == Some(627),
1268 Self::SupportPartial => short == Some(628),
1269 Self::SupportComplete => short == Some(629),
1270 Self::SupportLosslessRoundtrip => short == Some(630),
1271 Self::SupportLosslessStrictValidation => short == Some(631),
1272 Self::FormatVariationAspect => short == Some(632),
1273 Self::DefaultFormatVariant => short == Some(633),
1274 Self::DcFormatVariationNickname => short == Some(634),
1275 Self::CollectiveToolboxSeedGraphDataSource => short == Some(635),
1276 Self::CollectiveToolboxDcCsvSeedDatabase => short == Some(636),
1277 Self::ManualEntry => short == Some(637),
1278 Self::DistributeStatementOverEach => short == Some(638),
1279 Self::ThisElement => short == Some(639),
1280 Self::TypeAtomDc => short == Some(640),
1281 Self::GlobalGraphSystemBlockMostRecentNodeId => short == Some(641),
1282 Self::DataByteLength => short == Some(642),
1283 Self::ValueRange => short == Some(643),
1284 Self::ExclusiveRangeEndpoint => short == Some(644),
1285 Self::IsStable => short == Some(645),
1286 Self::InContextOf => short == Some(646),
1287 Self::WasmStart => short == Some(647),
1288 Self::WasmFbStart => short == Some(903),
1289 Self::WasmFcStart => short == Some(1159),
1290 Self::WasmFdPage0Start => short == Some(1415),
1291 Self::WasmFdPage1Start => short == Some(1671),
1292 Self::BeginWasmProgram => short == Some(1927),
1293 Self::EndWasmProgram => short == Some(1928),
1294 Self::DcDocumentExecutionKernel => short == Some(1936),
1295 Self::CollectiveToolboxWorkspace => short == Some(1937),
1296 Self::ResolveToPin => short == Some(1938),
1297 Self::MinimalSystemGraphQuery => short == Some(1939),
1298 Self::ExecutePureWasmProgram => short == Some(1940),
1299 Self::SectionTimestampNodeCreationTime => short == Some(1941),
1300 Self::RoutineTestSuite => short == Some(1942),
1301 Self::BeginModule => short == Some(2192),
1302 Self::EndModule => short == Some(2193),
1303 Self::NamespaceDecl => short == Some(2194),
1304 Self::BeginUseImport => short == Some(2195),
1305 Self::EndUseImport => short == Some(2196),
1306 Self::UseImportItem => short == Some(2197),
1307 Self::DeclareLet => short == Some(2198),
1308 Self::DeclareConst => short == Some(2199),
1309 Self::DeclarePub => short == Some(2200),
1310 Self::AssignSet => short == Some(2201),
1311 Self::TypedValueRef => short == Some(2202),
1312 Self::BeginRoutineDecl => short == Some(2203),
1313 Self::EndRoutineDecl => short == Some(2204),
1314 Self::RoutineParam => short == Some(2205),
1315 Self::BeginTestBlock => short == Some(2206),
1316 Self::EndTestBlock => short == Some(2207),
1317 Self::BeginTestCase => short == Some(2208),
1318 Self::TestExpectedOut => short == Some(2209),
1319 Self::EndTestCase => short == Some(2210),
1320 Self::BeginRoutineCall => short == Some(2211),
1321 Self::EndRoutineCall => short == Some(2212),
1322 Self::BeginCodeBlock => short == Some(2213),
1323 Self::EndCodeBlock => short == Some(2214),
1324 Self::BeginTuple => short == Some(2215),
1325 Self::EndTuple => short == Some(2216),
1326 Self::BeginPositionalStructDecl => short == Some(2217),
1327 Self::EndPositionalStructDecl => short == Some(2218),
1328 Self::BeginPositionalStructValue => short == Some(2219),
1329 Self::EndPositionalStructValue => short == Some(2220),
1330 Self::BeginStagerModule => short == Some(2221),
1331 Self::EndStagerModule => short == Some(2222),
1332 Self::DeclareBrandType => short == Some(2223),
1333 Self::BeginNamedStructDecl => short == Some(2224),
1334 Self::EndNamedStructDecl => short == Some(2225),
1335 Self::NamedStructFieldDecl => short == Some(2226),
1336 Self::BeginNamedStructValue => short == Some(2227),
1337 Self::EndNamedStructValue => short == Some(2228),
1338 Self::NamedStructFieldInit => short == Some(2229),
1339 Self::BeginEnumDecl => short == Some(2230),
1340 Self::EndEnumDecl => short == Some(2231),
1341 Self::EnumVariantDecl => short == Some(2232),
1342 Self::EnumVariantValue => short == Some(2233),
1343 Self::OptionNoneValue => short == Some(2234),
1344 Self::OptionSomeValue => short == Some(2235),
1345 Self::ResultOkValue => short == Some(2236),
1346 Self::ResultErrValue => short == Some(2237),
1347 Self::ErrorTagValue => short == Some(2238),
1348 Self::QuoteFollowingDcAsAtom => short == Some(2239),
1349 Self::BeginRoutine => short == Some(2240),
1350 Self::EndRoutine => short == Some(2241),
1351 Self::EnclosingRoutine => short == Some(2242),
1352 Self::IfConditional => short == Some(2448),
1353 Self::WhileLoop => short == Some(2449),
1354 Self::ForEach => short == Some(2450),
1355 Self::BreakLoop => short == Some(2451),
1356 Self::ContinueLoop => short == Some(2452),
1357 Self::ReturnRoutine => short == Some(2453),
1358 Self::FaultTrap => short == Some(2454),
1359 Self::NoOp => short == Some(2455),
1360 Self::BeginMatch => short == Some(2456),
1361 Self::EndMatch => short == Some(2457),
1362 Self::MatchCaseArm => short == Some(2458),
1363 Self::PropagateOp => short == Some(2459),
1364 Self::AddOp => short == Some(2512),
1365 Self::SubOp => short == Some(2513),
1366 Self::MulOp => short == Some(2514),
1367 Self::DivOp => short == Some(2515),
1368 Self::RemOp => short == Some(2516),
1369 Self::NegOp => short == Some(2517),
1370 Self::WrapAddOp => short == Some(2518),
1371 Self::WrapSubOp => short == Some(2519),
1372 Self::WrapMulOp => short == Some(2520),
1373 Self::BitAndOp => short == Some(2521),
1374 Self::BitOrOp => short == Some(2522),
1375 Self::BitXorOp => short == Some(2523),
1376 Self::BitNotOp => short == Some(2524),
1377 Self::ShlOp => short == Some(2525),
1378 Self::ShrOp => short == Some(2526),
1379 Self::RotlOp => short == Some(2527),
1380 Self::RotrOp => short == Some(2528),
1381 Self::ClzOp => short == Some(2529),
1382 Self::CtzOp => short == Some(2530),
1383 Self::PopcntOp => short == Some(2531),
1384 Self::LogicalNotOp => short == Some(2532),
1385 Self::LogicalAndOp => short == Some(2533),
1386 Self::LogicalOrOp => short == Some(2534),
1387 Self::EqOp => short == Some(2535),
1388 Self::NeOp => short == Some(2536),
1389 Self::LtOp => short == Some(2537),
1390 Self::LeOp => short == Some(2538),
1391 Self::GtOp => short == Some(2539),
1392 Self::GeOp => short == Some(2540),
1393 Self::ConvertOp => short == Some(2541),
1394 Self::BitcastOp => short == Some(2542),
1395 Self::SeqLenOp => short == Some(2543),
1396 Self::SeqGetOp => short == Some(2544),
1397 Self::SeqSliceOp => short == Some(2545),
1398 Self::SeqConcatOp => short == Some(2546),
1399 Self::GetPositionalFieldOp => short == Some(2547),
1400 Self::WithPositionalFieldOp => short == Some(2548),
1401 Self::GetNamedFieldOp => short == Some(2549),
1402 Self::WithNamedFieldOp => short == Some(2550),
1403 Self::WrapNominalOp => short == Some(2551),
1404 Self::UnwrapNominalOp => short == Some(2552),
1405 Self::TotalAddOp => short == Some(2553),
1406 Self::TotalSubOp => short == Some(2554),
1407 Self::TotalMulOp => short == Some(2555),
1408 Self::TotalDivOp => short == Some(2556),
1409 Self::TotalModOp => short == Some(2557),
1410 Self::TotalTruncRemOp => short == Some(2558),
1411 Self::TotalNegOp => short == Some(2559),
1412 Self::TotalShlOp => short == Some(2560),
1413 Self::TotalShrOp => short == Some(2561),
1414 Self::TotalConvertOp => short == Some(2562),
1415 Self::TotalSeqGetOp => short == Some(2563),
1416 Self::TotalSeqSliceOp => short == Some(2564),
1417 Self::TotalBufSetOp => short == Some(2565),
1418 Self::OptionIsSomeOp => short == Some(2566),
1419 Self::OptionIsNoneOp => short == Some(2567),
1420 Self::ResultIsOkOp => short == Some(2568),
1421 Self::ResultIsErrOp => short == Some(2569),
1422 Self::UnwrapOrOp => short == Some(2570),
1423 Self::OptionOkOrOp => short == Some(2571),
1424 Self::ByteLenOp => short == Some(2572),
1425 Self::StagelListType => short == Some(2576),
1426 Self::StagelBufType => short == Some(2577),
1427 Self::BeginStagelList => short == Some(2578),
1428 Self::EndStagelList => short == Some(2579),
1429 Self::StagelBufNew => short == Some(2580),
1430 Self::StagelBufFill => short == Some(2581),
1431 Self::StagelBufPush => short == Some(2582),
1432 Self::StagelBufExtend => short == Some(2583),
1433 Self::StagelBufSet => short == Some(2584),
1434 Self::StagelBufFreeze => short == Some(2585),
1435 Self::ConvertDcStringToWasm => short == Some(2608),
1436 Self::MakeRatOp => short == Some(2609),
1437 Self::DcFromU128Op => short == Some(2610),
1438 Self::U128FromDcOp => short == Some(2611),
1439 Self::DcsFromSOp => short == Some(2612),
1440 Self::SFromDcsOp => short == Some(2613),
1441 Self::SeqExplodeOp => short == Some(2614),
1442 Self::SeqImplodeOp => short == Some(2615),
1443 Self::RequestHostCapabilityOp => short == Some(2616),
1444 Self::TypeTuple => short == Some(2672),
1445 Self::TypeStruct => short == Some(2673),
1446 Self::TypeOption => short == Some(2674),
1447 Self::TypeResult => short == Some(2675),
1448 Self::TypeError => short == Some(2676),
1449 Self::TypeView => short == Some(2677),
1450 Self::TypeCursor => short == Some(2678),
1451 Self::TypeNominal => short == Some(2679),
1452 Self::Base64Digit => matches!(short, Some(127..=190)),
1453Self::TypeToken => {
1454(FORMAT_REGION_START..=FORMAT_REGION_END).contains(&token)
1455|| matches!(short, Some(264 | 275 | 278 | 280 | 300 | 306 | 513 | 516 | 535 | 640 | 643 | 2672..=2679))
1456}
1457Self::EvaluableExpressionStarter => {
1458matches!(short, Some(256 | 265 | 266 | 268 | 276 | 279 | 307 | 397 | 511 | 540 | 561 | 1938..=1940 | 2215 | 2512..=2572 | 2608..=2616))
1459}
1460}
1461}
1462
1463/// Returns the Base64 numeral digit value (`0..=63`) or padding sentinel
1464/// (`64`) if `token` represents a Base64 encapsulation character.
1465#[must_use]
1466pub fn base64_digit_value(token: u128) -> Option<u8> {
1467let short = DcChar::from_u128(token).to_short().ok()?;
1468if short == 195 {
1469Some(64)
1470} else if (127..=190).contains(&short) {
1471u8::try_from(short.saturating_sub(127)).ok()
1472} else {
1473None
1474}
1475}
1476}