step-examples/12-1a-encoding/Le038.stp
Sources
- 16-iso-spec ISO 10303-21 Ed.3 §6.4.3 (`\PE\` alphabet extension)
Description
Edition-3 `\PE\` requires a single ASCII letter (the page selector A.I) immediately following the slashes. A producer that truncates a string at the directive boundary or copy/pastes incorrectly emits a bare `\PE\` with no follow-byte before the closing apostrophe. A naive parser may consume the closing `'` as the page operand and lose string termination, walking off into the rest of the entity.
Reproducer recipe
`PRODUCT.name='text\PE\'` — closing apostrophe immediately follows `\PE\`. The next entity definition becomes part of the apparent string body if the parser eats the apostrophe as the operand.
Expected kernel behavior
reject the malformed directive with a precise diagnostic citing the string offset; never let the closing apostrophe be consumed as a directive operand.
Notes
**See also**: Le037, Le039. Synonyms: "bare PE at end of string", "PE directive without operand letter", "PE truncated at apostrophe", "PE escape with no follow byte", "STEP PE with missing selector".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
matches(rb"\\PE\\'")
Tier-3 assertions
shape_null == True
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Le038: Bare \PE\ directive at end-of-string with no operand letter; ISO 10303-21 Ed.3 §6.4.3: \PE\ must be followed by exactly one ASCII letter (page selector A-I) before any further string content; a truncated or copy-paste-corrupted string emits 'text\PE\' â the closing apostrophe immediately follows \PE\ with no page-letter between; a naive parser that reads the next byte as the \PE\ operand consumes the apostrophe as the selector letter, losing the string terminator; the parser then walks into the next entity record, treating #9001=... as string content until it encounters an unexpected token; receiver must reject with a precise diagnostic citing the string offset; never let the closing apostrophe be consumed as a directive operand; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le038'),'2;1'); 5FILE_NAME('Le038.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 10#2=GEOMETRIC_CURVE_SET('',(#1)); 11#8999=PERSON('text\PE\'bare-pe-no-selector',''); 12#9000=PERSON('prefix\PE\','bare-pe-truncated-string',''); 13 14ENDSEC; 15END-ISO-10303-21;