Module header

Module header 

Source
Expand description

Shared, quote-aware ISO 10303-21 header record and schema reading. The export writer and analytic processing use the same lexical rules.

Structs§

Lex
A monotonically advancing scan of one byte buffer.

Constants§

MAX_HEADER_BYTES
The bounded source-header reader’s maximum scan window.

Functions§

declared_schema
Read the first declared schema identifier from the complete header.
declared_schema_bounded
Read the first declared schema identifier from a bounded header window.
declared_schemas
Read all declared schema identifiers from the complete header.
declared_schemas_bounded
Read schema identifiers from a bounded header window.
decode_opt_string
Decode one argument to a string, or None for $ (unset), * (derived) or empty.
decode_opt_string_list
decode_string_list, but an unset ($, *) or missing argument is None rather than an empty list, so a writer can tell “never stated” from a literal () (#5470).
decode_string_list
Decode a list argument (('a','b',...)). $/empty yield an empty list, and unset entries are dropped. A bare single value where a list was expected is tolerated, as on the TS side.
extract_record_args
Extract the argument substring inside the parentheses of KEYWORD( ... ). Quote- and nesting-aware, so a quoted ) never closes the record early.
find_record_open
Find the opening parenthesis of an exact record keyword outside literals/comments, ignoring ASCII case.
find_section_marker
Locate an exact section marker such as ENDSEC; or DATA;.
split_top_level
Split STEP record arguments at top-level commas, respecting paren/bracket nesting and single-quoted strings (with '' escapes). Returns the raw, still-escaped argument substrings, trimmed.