step-examples/12-1b-header/Lh023.stp
Sources
- 07-stepcode-ifcopenshell T018, 16-iso-spec N030
Description
stepcode tolerates `# 12 = ENT(..)` and even `# /*c*/ 12 = ENT(..)`; the IfcOpenShell Lark grammar rejects whitespace between `#` and digits. ISO 10303-21 §5.6 declares `#NNN` a single token, so spaces inside it are non-conformant. Treating tab as a separator inside an identifier produces silent corruption (`#1<TAB>2` becomes `#12`).
Reproducer recipe
`# 12 = IFCPERSON(..);` or `# /* note */ 12 = IFCPERSON(..);` or `#1\t2 = …`.
Expected kernel behavior
strictly reject whitespace/comment inside `#NNN`; tolerant readers may accept whitespace between tokens but never inside identifiers, and must warn rather than silently merge digits.
Notes
**See also**: Ls038. Synonyms: "whitespace between # and digits of instance ID", "tab between hash and number in #ID", "comment inside instance reference", "# 12 with space in STEP", "stepcode tolerates space inside ID".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
matches(rb'#\s+\d+\s*=') or matches(rb'#/\*[^*]*\*/\d') or matches(rb'#\d+\t\d')matches(rb'#\s+\d') or matches(rb'#/\*')
Tier-3 assertions
load == "ok"
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ISO-10303-21; 2/* Lh023: whitespace between # and instance-ID digits */ 3/* ISO 10303-21 §5.6: #NNN is a single token â no spaces allowed inside */ 4/* DEFECT: '# 12 = CARTESIAN_POINT(..)' has a space between # and 12 */ 5/* stepcode: tolerates space silently; IfcOpenShell: rejects; OCC: empty result */ 6HEADER; 7FILE_DESCRIPTION(('Lh023: whitespace between # and instance ID digits'),'2;1'); 8FILE_NAME('Lh023.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','',''); 9FILE_SCHEMA(('AUTOMOTIVE_DESIGN')); 10ENDSEC; 11DATA; 12#1=CARTESIAN_POINT('origin',(0.,0.,0.)); 13#2=CARTESIAN_POINT('corner',(1.,1.,0.)); 14#3=DIRECTION('xdir',(1.,0.,0.)); 15#4=DIRECTION('zdir',(0.,0.,1.)); 16/* DEFECT: space between # and 12 â non-conformant per ISO 10303-21 §5.6 */ 17# 12=CARTESIAN_POINT('defect-space-in-id',(0.5,0.5,0.)); 18#5=GEOMETRIC_CURVE_SET('whitespace-in-id-shape',(#1,#2)); 19ENDSEC; 20END-ISO-10303-21;