step-examples/12-1c-syntax/Ls045.stp
Sources
- N047
Description
Control directives like `\X\`, `\S\`, `\F\`, `\N\` are valid only inside `'..'` string literals. Tools that pre-process content textually sometimes leave directives in BINARY values, ENUMERATION names, or between top-level tokens.
Reproducer recipe
`#1=DIRECTION('',(1.\X\09,0.,0.));`
Expected kernel behavior
Strict reject; lenient strip and warn.
Notes
Synonyms: "X escape outside string literal", "STEP control directive in BINARY", "directive in enumeration name", "backslash X in non-string slot", "control directive between top-level tokens".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
matches(rb"\(\s*\d+\.\\X\\")matches(rb"\\X\\09")
Tier-3 assertions
load == "ok"
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1/* Ls045 - Print/control directives appearing outside string-literal context 2 ---------------------------------------------------------------------- 3 Catalog section : §12.1c lexical / directive scope 4 Sources : N047 5 ---------------------------------------------------------------------- 6 Defect 7 Control directives (\X\, \S\, \F\, \N\) are valid only inside 8 '..' string literals. Tools that pre-process content textually 9 sometimes leave directives in BINARY values, ENUMERATION names, 10 or between top-level tokens. 11 Expected behavior 12 Strict reject; lenient mode may strip and warn. 13 ---------------------------------------------------------------------- 14*/ 15ISO-10303-21; 16HEADER; 17FILE_DESCRIPTION(('Ls045 - control directives outside string context'),'2;1'); 18FILE_NAME('Ls045.stp','2026-06-20T00:00:00',('auto-generated'),(''), 19 'auto-generated','',''); 20FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 21ENDSEC; 22DATA; 23/* Defect 1: \X\09 (horizontal tab escape) embedded in a coordinate list */ 24/* The directive appears after the real number 1. outside any string literal */ 25#1=DIRECTION('',(1.\X\09,0.,0.)); 26/* Defect 2: \N\ (newline directive) embedded between entity tokens */ 27#2=CARTESIAN_POINT(''\N\,(0.,0.,0.)); 28/* Defect 3: \S\ (shift directive) left inside an ENUMERATION slot */ 29#3=FACE_SURFACE('',(),$,\S\.T.); 30ENDSEC; 31END-ISO-10303-21;