Le027 — 8-bit characters and case-insensitive keyword tolerance in lexer

§12.1a encoding/strings (sub-class: lexer 8-bit handling)

P1 — silent data loss

silent-loss encoding

Sources

Description

OCCT's lex grammar explicitly tolerates 8-bit characters and case-insensitive keywords. A schema-loader (e.g. stepcode `expscan.l`) that rewrites every byte ≥ 0x80 to space and reports an error rejects EXPRESS schemas containing Latin-1 in comments (e.g. `°C`).

Reproducer recipe

an EXPRESS schema source file with comment `(* foo bar °C *)`; STEP file with mixed-case keyword such as `iso-10303-21;`.

Expected kernel behavior

Heal and accept: lexer should be UTF-8/Latin-1 aware in comments and pass 8-bit bytes through to the string-decoder. Keyword recognition should be case-insensitive but identifiers/entity-names canonicalised once before binding.

Notes

Cross-oracle: pure-Python Part-21 validator rejects (reject(E_MAGIC_CASE)); OCCT silently accepts (load is `empty`). OCC auto-heals a spec-level violation. Synonyms: "high-bit byte in EXPRESS schema rejected", "8-bit char in STEP comment", "lex grammar tolerates Latin-1", "degree symbol in schema comment fails", "non-ASCII in keywords".

Expected validation

occt=empty/empty gmsh=empty ifc=reject

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1iso-10303-21;
2/* Le027: 8-bit characters and case-insensitive keyword tolerance in lexer; ISO 10303-21 §6.1: magic line is 'ISO-10303-21;' in uppercase; OCCT lex grammar (StepFile/step.lex:30-35) tolerates lowercase 'iso-10303-21;'; schema-loaders that rewrite bytes >= 0x80 to space reject Latin-1 in comments; file uses mixed-case keyword: 'iso-10303-21;' (all lowercase) as magic line; Latin-1 high-bit byte (0xB0 = degree sign) injected into a PERSON name field; pure-Python Part-21 validator rejects with E_MAGIC_CASE; OCCT silently heals; GEOMETRIC_CURVE_SET IS model entity — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('Le027'),'2;1');
5FILE_NAME('Le027.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#8997=PERSON('°C','raw-utf8-degree-celsius','');
12
13ENDSEC;
14End-Iso-10303-21;