Lh023 — Whitespace, tab, or comment between `#` and digits of an instance ID

§12.1b header/numbering

P1 — silent data loss

spec-violation syntax

Sources

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

Tier-3 assertions

Cross-references

Ls038

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;