step-examples/12-1c-syntax/Ls057.stp
Sources
- Pattern-mined from ricosjp/ruststep #71 (bare `--` tail comment mis-scopes following content) (Apache-2.0/MIT — pattern only, no bytes copied)
- ISO 10303-21 §6.3 (block comment is the ONLY exchange-file comment form)
- ISO 10303-11 (EXPRESS `--` line comment)
Description
ISO 10303-21 §6.3 defines exactly one comment form for a Part-21 exchange file: the block comment `/* ... */`. The double-hyphen `--` end-of-line comment is EXPRESS (Part-11 / `.exp` schema) syntax and is not valid in a Part-21 exchange file. A reader that reuses an EXPRESS lexer for its Part-21 tokenizer — a common implementation shortcut — treats `--` as a line comment and silently swallows the rest of that physical line, including a live entity instance (`#2=CARTESIAN_POINT('swallowed',...)`) and its terminating `;`. A conforming Part-21 reader instead sees `--` as two consecutive minus tokens: a lexical error. This is a cross-reader conformance trap for a new kernel — keep EXPRESS line-comment handling out of the Part-21 lexer, or a real entity on the same line vanishes with no diagnostic.
Reproducer recipe
in DATA, a line `-- <text>: #2=CARTESIAN_POINT('swallowed',(0.,0.,0.));` — the `--` opens an EXPRESS line comment that runs to end-of-line, so a `--`-tolerant reader drops the `#2` entity and its `;` entirely.
Expected kernel behavior
reject the double-hyphen as invalid Part-21 punctuation (Part-21 has no `--` comment); at minimum, never let EXPRESS line-comment handling silently drop a real entity — if the token stream is ambiguous, diagnose rather than discard.
Notes
**See also**: Ls055, Ls056 (sibling ruststep-derived comment-framing fixtures). **Cross-reader divergence, live-measured (2026-08-10, validation/.venv OCP/OCCT 7.8.1)**: the pure-Python Part-21 validator `part21_strict` REJECTS this file (`E_UNRESOLVED_REFS`, parsing only 2 of the 3 entities — the `--` swallowed `#2`), where it `accept_with_warnings` on the clean sibling Ls056; OCC and gmsh both accept-silent and build no shape (the model root is loose `DIRECTION`s / a swallowed `CARTESIAN_POINT` with no shape-representation root, so empty is expected regardless of the syntax defect). The defect is oracle-visible on the structural/Part-21 axis, not the shape-count axis. Synonyms: "double-hyphen comment in STEP", "EXPRESS line comment in Part-21", "dash-dash comment swallows entity", "end-of-line comment exchange file", "EXPRESS lexer leaks into Part-21 tokenizer". Provenance tier: bytes-only.
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Provenance tier
bytes-only — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'-- EXPRESS line comment')contains(b"CARTESIAN_POINT('swallowed'")
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/* Ls057: an EXPRESS double-hyphen line comment appears in the Part-21 DATA section; ISO 10303-21 6.3 permits only slash-star block comments, so -- is not a valid Part-21 comment; a reader that reuses an EXPRESS lexer treats -- as an end-of-line comment and swallows the rest of that physical line, including a live CARTESIAN_POINT entity and its terminating semicolon, with no diagnostic; a conforming reader sees -- as two minus tokens and a lexical error; expected kernel behavior: reject the double-hyphen as invalid Part-21 punctuation, or at minimum never let EXPRESS line-comment handling drop a real entity silently; synonyms: double-hyphen comment in STEP, EXPRESS line comment in Part-21, dash-dash comment swallows entity, end-of-line comment exchange file, EXPRESS lexer leaks into Part-21; the double-hyphen and the swallowed CARTESIAN_POINT are the defect carriers */ 3HEADER; 4FILE_DESCRIPTION(('Ls057'),'2;1'); 5FILE_NAME('Ls057.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#1=DIRECTION('d',(1.,0.,0.)); 10-- EXPRESS line comment (illegal in Part-21); an EXPRESS-lexer reader swallows the rest of this line: #2=CARTESIAN_POINT('swallowed',(0.,0.,0.)); 11#3=DIRECTION('after',(0.,1.,0.)); 12ENDSEC; 13END-ISO-10303-21;