Ls033 — Whitespace handling: tab/CR/LF/FF as token separators or ignored chars

§12.1c whitespace

P1 — silent data loss

syntax

Sources

Description

ISO 10303-21 §5.2 says LF, CR, TAB, FF are ignored characters; §5.6 says only SPACE, comments, and print directives separate tokens. Strict reading: `#1\t=\tCARTESIAN_POINT(..)` after tab-removal becomes `#1=CARTESIAN_POINT(..)`, but `#1<TAB>2` would become `#12`. Real-world parsers tolerate any ASCII whitespace as a separator. Defects: split keyword `FILE _SCHEMA`, internal whitespace inside `#NNN` references, files with `\r`-only line endings, `\f` between attributes, long-line wrapping inside an instance.

Reproducer recipe

`FILE _SCHEMA(('AUTOMOTIVE_DESIGN'));`, `# 12 = IFCPERSON(..);`, file with CR-only line endings, `#1=IFCPOINT(\F\(0.,0.,0.));`

Expected kernel behavior

Treat any of `\t \f\r\n` as whitespace separator (matches user expectation); preserve line/column counting across line-ending conventions; warn on TAB inside an identifier; accept print-control directives `\F\` and `\N\` as zero-width separators where token separator is allowed; reject embedded whitespace inside `#N` (between `#` and digits).

Notes

**See also**: Le028. Synonyms: "tab as STEP token separator", "FF as token separator", "tab between # and =", "ignored char inside STEP token", "whitespace handling in STEP scanner".

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Cross-references

Le028

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1/* Ls033 - Whitespace handling: tab/CR/LF/FF as token separators
2   ----------------------------------------------------------------------
3   Catalog section : §12.1c whitespace
4   Sources         : T031, T032, T037, N030, N031
5   See also        : Le028
6   ----------------------------------------------------------------------
7   Defect
8     ISO 10303-21 §5.2: LF, CR, TAB, FF are ignored characters.
9     §5.6: only SPACE, comments, and print directives separate tokens.
10     Critical defect: embedded whitespace inside #NNN reference
11     (between # and digits) — this changes what the tokenizer reads.
12     Defect 1: space between # and instance number: # 1=...
13     Defect 2: TAB characters used as token separators.
14   Expected behavior
15     Reject embedded whitespace inside #N (between # and digits);
16     treat any ASCII whitespace as separator elsewhere.
17   ----------------------------------------------------------------------
18*/
19ISO-10303-21;
20HEADER;
21FILE_DESCRIPTION(('Ls033 - whitespace inside instance-ID and TAB separators'),'2;1');
22FILE_NAME('Ls033.stp','2026-06-20T00:00:00',('auto-generated'),(''),
23  'auto-generated','','');
24FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
25ENDSEC;
26DATA;
27/* Defect 1: space between # and instance number -- # 1 is NOT #1 per §5.6 */
28# 1=CARTESIAN_POINT('origin',(0.,0.,0.));
29/* Defect 2: TAB characters used as token separators throughout */
30#2	=	CARTESIAN_POINT('p1',(1.,0.,0.));
31#3	=	DIRECTION('x',(1.,0.,0.));
32/* Defect 3: space inside back-reference -- # 1 as argument */
33#4=VECTOR('v',# 3,1.);
34ENDSEC;
35END-ISO-10303-21;