Ls017 — Trailing comma at end of aggregate

§12.1c punctuation

P1 — silent data loss

syntax

Sources

Description

Aggregates do not permit trailing commas. JS/Python-influenced generators emit `(1.,2.,3.,)`. Recursive-descent grammars that accept it append a default-constructed element, mismatching schema-declared count.

Reproducer recipe

`#1=DIRECTION('',(1.,0.,0.,));`

Expected kernel behavior

Strict reject; lenient strip and warn.

Notes

Synonyms: "trailing comma in STEP aggregate", "(1.,2.,3.,) extra comma", "JS-style trailing comma in STEP", "extra comma at end of list", "aggregate ends with comma".

Expected validation

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

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)
1/* Ls017 - Trailing comma at end of aggregate
2   ----------------------------------------------------------------------
3   Catalog section : §12.1c punctuation
4   Sources         : A017, N051
5   Originally also catalogued as: Ad017
6   ----------------------------------------------------------------------
7   Defect
8     Aggregates do not permit trailing commas in ISO 10303-21. JS- or
9     Python-influenced generators routinely emit (1.,2.,3.,). Recursive-
10     descent grammars that silently accept the trailing comma may append
11     a default-constructed element, mismatching the schema-declared
12     element count and propagating uninitialised data downstream.
13   Expected behavior
14     Strict reject; lenient mode strip and warn. Never expand the trailing
15     comma into an extra element.
16   ----------------------------------------------------------------------
17*/
18ISO-10303-21;
19HEADER;
20FILE_DESCRIPTION(('Ls017 - trailing comma at end of aggregate'),'2;1');
21FILE_NAME('Ls017.stp','2026-04-26T00:00:00',('auto-generated'),(''),
22  'auto-generated','','');
23FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
24ENDSEC;
25DATA;
26#10=CARTESIAN_POINT('origin',(0.0,0.0,0.0));
27/* Defect: trailing comma after the last element of the coordinate list */
28#20=DIRECTION('x',(1.0,0.0,0.0,));
29/* Defect: trailing comma after the last attribute of the entity record */
30#30=DIRECTION('z',(0.0,0.0,1.0),);
31/* Defect: trailing comma in a reference list */
32#31=POLYLINE('seq',(#10,#20,#30,));
33#40=AXIS2_PLACEMENT_3D('placement',#10,#20,$);
34ENDSEC;
35END-ISO-10303-21;