@ifc-lite/export 4.11.0 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/anonymize-placement.d.ts +0 -34
  2. package/dist/anonymize-placement.d.ts.map +1 -1
  3. package/dist/anonymize-placement.js +58 -27
  4. package/dist/anonymize-placement.js.map +1 -1
  5. package/dist/declared-property-type.d.ts.map +1 -1
  6. package/dist/declared-property-type.js +3 -2
  7. package/dist/declared-property-type.js.map +1 -1
  8. package/dist/effective-index.d.ts.map +1 -1
  9. package/dist/effective-index.js +12 -5
  10. package/dist/effective-index.js.map +1 -1
  11. package/dist/ifc5-exporter.d.ts.map +1 -1
  12. package/dist/ifc5-exporter.js +5 -4
  13. package/dist/ifc5-exporter.js.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/lod-geometry-types.d.ts +5 -0
  19. package/dist/lod-geometry-types.d.ts.map +1 -1
  20. package/dist/lod0-generator.d.ts.map +1 -1
  21. package/dist/lod0-generator.js +52 -18
  22. package/dist/lod0-generator.js.map +1 -1
  23. package/dist/lod1-generator.d.ts.map +1 -1
  24. package/dist/lod1-generator.js +4 -1
  25. package/dist/lod1-generator.js.map +1 -1
  26. package/dist/merged-empty-containers-refs.d.ts.map +1 -1
  27. package/dist/merged-empty-containers-refs.js +5 -3
  28. package/dist/merged-empty-containers-refs.js.map +1 -1
  29. package/dist/merged-exporter.d.ts.map +1 -1
  30. package/dist/merged-exporter.js +31 -31
  31. package/dist/merged-exporter.js.map +1 -1
  32. package/dist/merged-remap.d.ts +0 -8
  33. package/dist/merged-remap.d.ts.map +1 -1
  34. package/dist/merged-remap.js +7 -17
  35. package/dist/merged-remap.js.map +1 -1
  36. package/dist/obj.d.ts +8 -8
  37. package/dist/obj.js +8 -8
  38. package/dist/parquet-exporter.d.ts.map +1 -1
  39. package/dist/parquet-exporter.js +14 -2
  40. package/dist/parquet-exporter.js.map +1 -1
  41. package/dist/property-value-serialization.d.ts.map +1 -1
  42. package/dist/property-value-serialization.js +7 -3
  43. package/dist/property-value-serialization.js.map +1 -1
  44. package/dist/reference-collector.d.ts.map +1 -1
  45. package/dist/reference-collector.js +17 -16
  46. package/dist/reference-collector.js.map +1 -1
  47. package/dist/retype.d.ts.map +1 -1
  48. package/dist/retype.js +12 -11
  49. package/dist/retype.js.map +1 -1
  50. package/dist/schema-conversion-loss-report.d.ts +2 -1
  51. package/dist/schema-conversion-loss-report.d.ts.map +1 -1
  52. package/dist/schema-conversion-loss-report.js +20 -11
  53. package/dist/schema-conversion-loss-report.js.map +1 -1
  54. package/dist/schema-converter-mep.d.ts +2 -0
  55. package/dist/schema-converter-mep.d.ts.map +1 -0
  56. package/dist/schema-converter-mep.js +9 -0
  57. package/dist/schema-converter-mep.js.map +1 -0
  58. package/dist/schema-converter-mep.json +96 -0
  59. package/dist/schema-converter-product-proxy.d.ts +25 -0
  60. package/dist/schema-converter-product-proxy.d.ts.map +1 -0
  61. package/dist/schema-converter-product-proxy.js +33 -0
  62. package/dist/schema-converter-product-proxy.js.map +1 -0
  63. package/dist/schema-converter-renames.d.ts +32 -0
  64. package/dist/schema-converter-renames.d.ts.map +1 -0
  65. package/dist/schema-converter-renames.js +60 -0
  66. package/dist/schema-converter-renames.js.map +1 -0
  67. package/dist/schema-converter.d.ts +8 -16
  68. package/dist/schema-converter.d.ts.map +1 -1
  69. package/dist/schema-converter.js +44 -71
  70. package/dist/schema-converter.js.map +1 -1
  71. package/dist/schema-style-flatten.d.ts +82 -0
  72. package/dist/schema-style-flatten.d.ts.map +1 -0
  73. package/dist/schema-style-flatten.js +245 -0
  74. package/dist/schema-style-flatten.js.map +1 -0
  75. package/dist/step-argument-parser.d.ts +7 -2
  76. package/dist/step-argument-parser.d.ts.map +1 -1
  77. package/dist/step-argument-parser.js +69 -62
  78. package/dist/step-argument-parser.js.map +1 -1
  79. package/dist/step-attribute-mutations.d.ts.map +1 -1
  80. package/dist/step-attribute-mutations.js +21 -22
  81. package/dist/step-attribute-mutations.js.map +1 -1
  82. package/dist/step-export-contexts.d.ts +1 -1
  83. package/dist/step-export-contexts.d.ts.map +1 -1
  84. package/dist/step-export-contexts.js +4 -1
  85. package/dist/step-export-contexts.js.map +1 -1
  86. package/dist/step-export-types.d.ts +2 -0
  87. package/dist/step-export-types.d.ts.map +1 -1
  88. package/dist/step-export-types.js.map +1 -1
  89. package/dist/step-exporter.d.ts.map +1 -1
  90. package/dist/step-exporter.js +13 -13
  91. package/dist/step-exporter.js.map +1 -1
  92. package/dist/step-outer-args.d.ts +10 -0
  93. package/dist/step-outer-args.d.ts.map +1 -1
  94. package/dist/step-outer-args.js +29 -12
  95. package/dist/step-outer-args.js.map +1 -1
  96. package/dist/step-overlay-entities.d.ts +2 -0
  97. package/dist/step-overlay-entities.d.ts.map +1 -1
  98. package/dist/step-overlay-entities.js +43 -11
  99. package/dist/step-overlay-entities.js.map +1 -1
  100. package/dist/step-pass-builder.d.ts.map +1 -1
  101. package/dist/step-pass-builder.js +2 -0
  102. package/dist/step-pass-builder.js.map +1 -1
  103. package/dist/step-property-set-index.d.ts.map +1 -1
  104. package/dist/step-property-set-index.js +8 -3
  105. package/dist/step-property-set-index.js.map +1 -1
  106. package/dist/step-property-set-readers.d.ts +6 -0
  107. package/dist/step-property-set-readers.d.ts.map +1 -1
  108. package/dist/step-property-set-readers.js +53 -14
  109. package/dist/step-property-set-readers.js.map +1 -1
  110. package/dist/step-property-sets.d.ts +14 -0
  111. package/dist/step-property-sets.d.ts.map +1 -1
  112. package/dist/step-property-sets.js +25 -8
  113. package/dist/step-property-sets.js.map +1 -1
  114. package/dist/step-record-frame.d.ts +69 -0
  115. package/dist/step-record-frame.d.ts.map +1 -0
  116. package/dist/step-record-frame.js +136 -0
  117. package/dist/step-record-frame.js.map +1 -0
  118. package/dist/step-ref-scan.d.ts +8 -0
  119. package/dist/step-ref-scan.d.ts.map +1 -1
  120. package/dist/step-ref-scan.js +29 -8
  121. package/dist/step-ref-scan.js.map +1 -1
  122. package/dist/step-serialization.d.ts +16 -4
  123. package/dist/step-serialization.d.ts.map +1 -1
  124. package/dist/step-serialization.js +39 -13
  125. package/dist/step-serialization.js.map +1 -1
  126. package/dist/step-slot-grammar.d.ts +21 -18
  127. package/dist/step-slot-grammar.d.ts.map +1 -1
  128. package/dist/step-slot-grammar.js +210 -177
  129. package/dist/step-slot-grammar.js.map +1 -1
  130. package/dist/step-source-iteration.d.ts +1 -1
  131. package/dist/step-source-iteration.d.ts.map +1 -1
  132. package/dist/step-source-iteration.js +27 -3
  133. package/dist/step-source-iteration.js.map +1 -1
  134. package/dist/unit-normalize.d.ts.map +1 -1
  135. package/dist/unit-normalize.js +13 -20
  136. package/dist/unit-normalize.js.map +1 -1
  137. package/dist/zero-content.d.ts +21 -3
  138. package/dist/zero-content.d.ts.map +1 -1
  139. package/dist/zero-content.js +35 -3
  140. package/dist/zero-content.js.map +1 -1
  141. package/package.json +8 -8
@@ -44,12 +44,24 @@ export declare function serializeTypedMarker(type: string, value: string | numbe
44
44
  /**
45
45
  * Convert a number to a valid STEP REAL literal.
46
46
  *
47
- * Handles NaN/Infinity (-> `0.`) and delegates the mantissa/`E` rewrite to the
48
- * shared {@link formatStepReal} so exponential magnitudes serialize as valid
49
- * STEP (`5e-8` -> `5.E-8`, `1e21` -> `1.E+21`, `1.5e-7` -> `1.5E-7`) rather than
50
- * the invalid `5e-8.` / lowercase-`e` forms a bare decimal-point append produced.
47
+ * Delegates the mantissa/`E` rewrite to the shared {@link formatStepReal} so
48
+ * exponential magnitudes serialize as valid STEP (`5e-8` -> `5.E-8`, `1e21` ->
49
+ * `1.E+21`, `1.5e-7` -> `1.5E-7`) rather than the invalid `5e-8.` /
50
+ * lowercase-`e` forms a bare decimal-point append produced.
51
+ *
52
+ * A non-finite value THROWS (#7679). It used to be written as a made-up `0.`,
53
+ * which turned a NaN measure into a real zero. `$` ("omitted") is the reading
54
+ * only a caller that owns a whole optional attribute or property value can
55
+ * give, so those callers test `Number.isFinite` first; every other slot is
56
+ * refused here. The Rust writer (`jsval.rs::to_step_real`) refuses identically.
51
57
  */
52
58
  export declare function toStepReal(v: number): string;
59
+ /**
60
+ * The digits of a finite integral number below 1e21, or `null`.
61
+ * `String(1e21)` is `1e+21`, which is not a STEP INTEGER (#7679). Not 2^53:
62
+ * the digits of a value between 2^53 and 1e21 are still a valid STEP INTEGER.
63
+ */
64
+ export declare function toStepInteger(v: number): string | null;
53
65
  /**
54
66
  * Map QuantityType enum to IFC STEP entity type name.
55
67
  */
@@ -1 +1 @@
1
- {"version":3,"file":"step-serialization.d.ts","sourceRoot":"","sources":["../src/step-serialization.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAkB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhF;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAK5B;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBlE;AAiDD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAI3F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAWhE;AAGD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAA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H,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAyCnF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,UAAQ,GAAG,MAAM,CAEtF;AA8CD,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAExD"}
@@ -20,7 +20,7 @@
20
20
  * generic STEP token, and worth reading on its own.
21
21
  */
22
22
  import { serializeValue, SCHEMA_REGISTRY } from '@ifc-lite/parser';
23
- import { QuantityType, formatStepReal, escapeStepString } from '@ifc-lite/data';
23
+ import { QuantityType, formatStepReal, escapeStepString, isCompleteStepNumericLiteral } from '@ifc-lite/data';
24
24
  /**
25
25
  * Re-exported so every existing `import { escapeStepString } from
26
26
  * './step-serialization.js'` call site keeps working. The implementation
@@ -93,8 +93,13 @@ function serializeInnerByBase(value, base) {
93
93
  case 'REAL':
94
94
  case 'NUMBER':
95
95
  return toStepReal(Number(value));
96
- case 'INTEGER':
97
- return String(Math.trunc(Number(value)));
96
+ case 'INTEGER': {
97
+ const n = Math.trunc(Number(value));
98
+ const digits = toStepInteger(n);
99
+ if (digits === null)
100
+ throw new Error(`Cannot write ${n} as a STEP INTEGER: it is not a finite value below 1e21`);
101
+ return digits;
102
+ }
98
103
  case 'BOOLEAN':
99
104
  // A BOOLEAN has no unknown state; an unrecognized token coerces to `.F.`.
100
105
  return coerceLogical(value) === true ? '.T.' : '.F.';
@@ -109,7 +114,7 @@ function serializeInnerByBase(value, base) {
109
114
  if (typeof value === 'boolean')
110
115
  return value ? '.T.' : '.F.';
111
116
  if (typeof value === 'number')
112
- return Number.isInteger(value) ? String(value) : toStepReal(value);
117
+ return Number.isInteger(value) ? integralToken(value) : toStepReal(value);
113
118
  return `'${escapeStepString(String(value))}'`;
114
119
  }
115
120
  }
@@ -128,16 +133,34 @@ export function serializeTypedMarker(type, value) {
128
133
  /**
129
134
  * Convert a number to a valid STEP REAL literal.
130
135
  *
131
- * Handles NaN/Infinity (-> `0.`) and delegates the mantissa/`E` rewrite to the
132
- * shared {@link formatStepReal} so exponential magnitudes serialize as valid
133
- * STEP (`5e-8` -> `5.E-8`, `1e21` -> `1.E+21`, `1.5e-7` -> `1.5E-7`) rather than
134
- * the invalid `5e-8.` / lowercase-`e` forms a bare decimal-point append produced.
136
+ * Delegates the mantissa/`E` rewrite to the shared {@link formatStepReal} so
137
+ * exponential magnitudes serialize as valid STEP (`5e-8` -> `5.E-8`, `1e21` ->
138
+ * `1.E+21`, `1.5e-7` -> `1.5E-7`) rather than the invalid `5e-8.` /
139
+ * lowercase-`e` forms a bare decimal-point append produced.
140
+ *
141
+ * A non-finite value THROWS (#7679). It used to be written as a made-up `0.`,
142
+ * which turned a NaN measure into a real zero. `$` ("omitted") is the reading
143
+ * only a caller that owns a whole optional attribute or property value can
144
+ * give, so those callers test `Number.isFinite` first; every other slot is
145
+ * refused here. The Rust writer (`jsval.rs::to_step_real`) refuses identically.
135
146
  */
136
147
  export function toStepReal(v) {
137
148
  if (!Number.isFinite(v))
138
- return '0.';
149
+ throw new Error(`Cannot write ${v} as a STEP REAL: it has no finite value`);
139
150
  return formatStepReal(v);
140
151
  }
152
+ /**
153
+ * The digits of a finite integral number below 1e21, or `null`.
154
+ * `String(1e21)` is `1e+21`, which is not a STEP INTEGER (#7679). Not 2^53:
155
+ * the digits of a value between 2^53 and 1e21 are still a valid STEP INTEGER.
156
+ */
157
+ export function toStepInteger(v) {
158
+ return Number.isFinite(v) && Math.abs(v) < 1e21 ? String(v === 0 ? 0 : v) : null;
159
+ }
160
+ /** An integral finite number as a token: INTEGER digits below 1e21, the REAL form from there up. */
161
+ function integralToken(v) {
162
+ return toStepInteger(v) ?? formatStepReal(v);
163
+ }
141
164
  /**
142
165
  * Map QuantityType enum to IFC STEP entity type name.
143
166
  */
@@ -198,13 +221,16 @@ export function serializeAttributeValue(value, currentToken) {
198
221
  return '.F.';
199
222
  return '.U.';
200
223
  }
201
- if (/^-?\d+(?:\.\d+)?(?:E[+-]?\d+)?$/i.test(trimmed) && /^-?\d/.test(current)) {
224
+ // The one STEP numeric grammar (core's `step_numeric_literal_len`): `.5`,
225
+ // `+1`, `1.E5`, `+1.` and `-0.` are numbers too. The regex this was refused
226
+ // them, so such a slot was rewritten as a quoted string (F4 M-export-a).
227
+ if (isCompleteStepNumericLiteral(trimmed) && isCompleteStepNumericLiteral(current)) {
202
228
  const numberValue = Number(trimmed);
203
229
  if (!Number.isFinite(numberValue))
204
230
  return '$';
205
- return current.includes('.') || /E/i.test(current)
231
+ return current.includes('.') || /E/i.test(current) || !Number.isInteger(numberValue)
206
232
  ? toStepReal(numberValue)
207
- : String(numberValue);
233
+ : integralToken(numberValue);
208
234
  }
209
235
  return serializeValue(value);
210
236
  }
@@ -252,7 +278,7 @@ function serializeStepValueAt(value, forceReal, inList) {
252
278
  }
253
279
  if (forceReal)
254
280
  return toStepReal(value);
255
- return Number.isInteger(value) ? String(value) : toStepReal(value);
281
+ return Number.isInteger(value) ? integralToken(value) : toStepReal(value);
256
282
  }
257
283
  if (Array.isArray(value)) {
258
284
  return `(${value.map(v => serializeStepValueAt(v, forceReal, true)).join(',')})`;
@@ -1 +1 @@
1
- {"version":3,"file":"step-serialization.js","sourceRoot":"","sources":["../src/step-serialization.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAA0B,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhF;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAA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EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC"}
@@ -1,24 +1,27 @@
1
+ /** The STEP whitespace set, as core's `is_step_space`. */
2
+ export declare function isStepSpaceCode(code: number): boolean;
3
+ /** Whether `text` is empty or only STEP whitespace. */
4
+ export declare function isStepBlank(text: string): boolean;
5
+ /**
6
+ * Index past the whitespace and `/* ... *\/` comments starting at `from`, or
7
+ * -1 when a comment never closes (core's `skip_step_trivia`).
8
+ */
9
+ export declare function skipStepTrivia(text: string, from: number): number;
10
+ /**
11
+ * Whether `value` is exactly ONE STEP value, trivia allowed around it and
12
+ * between its parts. See the module comment for the grammar.
13
+ */
14
+ export declare function isStepValue(value: string): boolean;
1
15
  /**
2
16
  * Whether `part` — one slot `splitTopLevelStepArguments` already separated on
3
- * a top-level comma, raw text including any surrounding whitespace/comments —
4
- * is a single well-formed STEP value (a string literal, a binary literal
5
- * (`"..."`), `$`, `*`, a bare keyword / enumeration / number / `#`-reference
6
- * token, or a typed value or list `NAME(...)` / `(...)`), or is empty.
7
- *
8
- * Empty is deliberately accepted, matching `splitTopLevelStepArguments`'s
9
- * docstring: `a,,b` is one empty part, not a rejection, so slot indices after it
10
- * stay aligned with what the entity parser counts. A part that is ONLY a comment
11
- * (no value) is NOT given that same pass — a lone `/* c *​/` between two commas
12
- * is not a value at all, so treating it as one more empty slot is exactly the
13
- * index shift that produces a phantom slot; rejecting the whole split is the
14
- * correct answer there, same as any other malformed argument list.
15
- *
16
- * A `/` that is not opening a comment cannot be swallowed into a bare token:
17
- * it is outside every token's character set, so it stops the scan and the
18
- * top-of-function "consumed to the end" check then fails the whole part.
17
+ * a top-level comma, raw text including any surrounding whitespace or
18
+ * comments — is a single well-formed STEP value, or is empty.
19
19
  *
20
- * Nesting past {@link MAX_SLOT_NESTING_DEPTH} is refused like any other
21
- * malformed part, for the reason recorded on that constant.
20
+ * Empty is deliberately accepted, matching `splitTopLevelStepArguments`:
21
+ * `a,,b` is one empty part, not a rejection, so slot indices after it stay
22
+ * aligned with what the entity parser counts. A part that is ONLY a comment is
23
+ * NOT given that pass: counting it as one more empty slot would shift every
24
+ * index after it.
22
25
  */
23
26
  export declare function isWellFormedStepSlot(part: string): boolean;
24
27
  //# sourceMappingURL=step-slot-grammar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"step-slot-grammar.d.ts","sourceRoot":"","sources":["../src/step-slot-grammar.ts"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAmH1D"}
1
+ {"version":3,"file":"step-slot-grammar.d.ts","sourceRoot":"","sources":["../src/step-slot-grammar.ts"],"names":[],"mappings":"AAuCA,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKjD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAYjE;AA8CD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAgFlD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D"}
@@ -6,196 +6,229 @@
6
6
  * `splitTopLevelStepArguments` (`step-argument-parser.ts`) separated on a
7
7
  * top-level comma, is that part a single well-formed STEP value?
8
8
  *
9
- * Split out of `step-argument-parser.ts` because the two answer different
10
- * questions and only one of them recurses. The splitter is a flat scan over the
11
- * whole argument list; this is a small recursive-descent grammar over one slot,
12
- * and it is the recursion that needs the bound documented below. Keeping them in
13
- * one file also put that file one line under the module-size ratchet.
14
- */
15
- /**
16
- * How deep a slot's parentheses may nest before the slot is refused.
17
- *
18
- * The grammar below is recursive descent — `parseValue` -> `parseParenList` ->
19
- * `parseValue`, two stack frames per nesting level — over text this process did
20
- * not write. Unbounded, deep enough nesting exhausts the JS stack and throws a
21
- * `RangeError`, and a throw is a THIRD outcome for a function whose two callers
22
- * (`replaceStepArgument`, and every by-index writer behind
23
- * `splitTopLevelStepArguments`) are written against exactly two: parts, or
24
- * `null` meaning "this edit cannot be made". A malformed or adversarial file
25
- * would abort the whole export instead of refusing one edit. Bounding the
26
- * nesting and returning `null` past the bound is what makes the contract total.
27
- *
28
- * The number is picked between two measurements taken on 2026-09-09 (#4213):
29
- *
30
- * - REAL NESTING. Over the repo's whole `tests/models` corpus (122 `.ifc`
31
- * files, 1.4 GB), the deepest paren nesting inside any top-level slot of any
32
- * record is 3 — the record-level maximum is 4, and one of those is the slot
33
- * itself. The deepest shape in the corpus is
34
- * `IFCINDEXEDPOLYCURVE(#307,(IFCLINEINDEX((1,2)),...),.F.)`.
35
- * - THE STACK. In a fresh Node 22 process the deepest slot this grammar could
36
- * validate before throwing `RangeError` was 3763 (eight fresh-process
37
- * bisections, all eight identical); under vitest, 3768. That floor is the
38
- * COLD one: once V8 has optimised the frames the same bisection reaches
39
- * ~7900 in the same process, so the low number is the one to design against,
40
- * and a real export calls this from far deeper in its own stack than a
41
- * bisection harness does.
9
+ * This is the TypeScript twin of `ifc_lite_core::parser::is_step_value`
10
+ * (F4 M-export-a, #7778), and both are held to
11
+ * `rust/core/tests/fixtures/step_slot_vectors.json`
12
+ * (`step-slot-vectors.parity.test.ts` here, `slots_tests.rs` there). The
13
+ * grammar is the one the STEP tokenizer reads, so whatever passes is a token
14
+ * on the reading side: a string `'...'`, a binary `"[0-3]hex*"`, `$`, `*`, a
15
+ * reference `#digits`, an enumeration `.NAME.`, a number, a list `( ... )`
16
+ * or a typed value `NAME( ... )`. Not values, because the tokenizer reads
17
+ * none of them: a bare keyword, `1..2`, `#+5`, an empty list element
18
+ * (`(1,,2)`), a binary with a non-hex byte, an integer beyond `i64`. The
19
+ * whitespace is the STEP set (space, tab, LF, CR, FF, VT), never `\s`, so a
20
+ * no-break space is not padding. A comment that never closes is not trivia.
42
21
  *
43
- * 64 is ~21x the deepest nesting real files use and ~59x below the shallowest
44
- * depth measured to throw: it refuses nothing the corpus contains, and it is
45
- * reached long before the stack is. Both figures are historical, not
46
- * invariants: the corpus can gain a file and V8 can change its frame size. What
47
- * must stay true is the ORDER — comfortably above real nesting, far below the
48
- * crash floor — and `step-argument-parser.test.ts` pins the two ends of the
49
- * bound itself, plus one depth measured to throw before it existed.
50
- *
51
- * Deliberately NOT mirrored into the two sibling grammars. `step_slot.rs`'s
52
- * `is_well_formed_step_slot` and `packages/cli/src/commands/step-args.ts`'s
53
- * `skipToken` are both flat loops with an explicit `depth` counter — the CLI
54
- * one says so in its own docstring, in as many words — so neither has a stack
55
- * to exhaust and neither needs a bound; adding one there would only invent a
56
- * refusal. This grammar was the odd one out, not the one setting the rule.
57
- *
58
- * The implementations therefore diverge on what they ACCEPT at extreme depth,
59
- * which is why this is not in `rust/export/tests/fixtures/step_refuse_vectors.json`
60
- * — that fixture pins agreement on refusals only, and pinning an accept-side
61
- * divergence would freeze the divergence as agreement (#4125).
22
+ * The scan carries its nesting in a counter rather than recursing, so no input
23
+ * can exhaust the stack; nesting past {@link MAX_SLOT_NESTING_DEPTH} (the
24
+ * tokenizer's bound) is refused like any other malformed part. The recursive
25
+ * descent this replaced bounded nesting at 64 because it could throw
26
+ * `RangeError` (#4213); the loop has no such floor.
62
27
  */
63
- const MAX_SLOT_NESTING_DEPTH = 64;
28
+ import { stepStringLiteralEnd } from '@ifc-lite/encoding';
29
+ import { isCompleteStepNumericLiteral } from '@ifc-lite/data';
30
+ /** The tokenizer's nesting bound (`MAX_NESTING_DEPTH` in core's tokenizer). */
31
+ const MAX_SLOT_NESTING_DEPTH = 256;
32
+ const I64_MAX = 9223372036854775807n;
33
+ const I64_MIN = -9223372036854775808n;
34
+ const U32_MAX = 4294967295;
35
+ /** The STEP whitespace set, as core's `is_step_space`. */
36
+ export function isStepSpaceCode(code) {
37
+ return code === 0x20 || (code >= 0x09 && code <= 0x0d);
38
+ }
39
+ /** Whether `text` is empty or only STEP whitespace. */
40
+ export function isStepBlank(text) {
41
+ for (let i = 0; i < text.length; i++) {
42
+ if (!isStepSpaceCode(text.charCodeAt(i)))
43
+ return false;
44
+ }
45
+ return true;
46
+ }
64
47
  /**
65
- * Whether `part` — one slot `splitTopLevelStepArguments` already separated on
66
- * a top-level comma, raw text including any surrounding whitespace/comments —
67
- * is a single well-formed STEP value (a string literal, a binary literal
68
- * (`"..."`), `$`, `*`, a bare keyword / enumeration / number / `#`-reference
69
- * token, or a typed value or list `NAME(...)` / `(...)`), or is empty.
70
- *
71
- * Empty is deliberately accepted, matching `splitTopLevelStepArguments`'s
72
- * docstring: `a,,b` is one empty part, not a rejection, so slot indices after it
73
- * stay aligned with what the entity parser counts. A part that is ONLY a comment
74
- * (no value) is NOT given that same pass — a lone `/* c *​/` between two commas
75
- * is not a value at all, so treating it as one more empty slot is exactly the
76
- * index shift that produces a phantom slot; rejecting the whole split is the
77
- * correct answer there, same as any other malformed argument list.
78
- *
79
- * A `/` that is not opening a comment cannot be swallowed into a bare token:
80
- * it is outside every token's character set, so it stops the scan and the
81
- * top-of-function "consumed to the end" check then fails the whole part.
82
- *
83
- * Nesting past {@link MAX_SLOT_NESTING_DEPTH} is refused like any other
84
- * malformed part, for the reason recorded on that constant.
48
+ * Index past the whitespace and `/* ... *\/` comments starting at `from`, or
49
+ * -1 when a comment never closes (core's `skip_step_trivia`).
85
50
  */
86
- export function isWellFormedStepSlot(part) {
87
- if (part.trim() === '')
88
- return true;
89
- let i = 0;
90
- const n = part.length;
91
- const skipTrivia = () => {
92
- for (;;) {
93
- while (i < n && /\s/.test(part[i]))
94
- i++;
95
- if (part[i] === '/' && part[i + 1] === '*') {
96
- const end = part.indexOf('*/', i + 2);
97
- if (end === -1) {
98
- i = n; // unterminated: leave content unconsumed so parseValue fails
99
- return;
100
- }
101
- i = end + 2;
102
- continue;
103
- }
104
- break;
105
- }
106
- };
107
- /**
108
- * `depth` is how many parens are open around this list — 1 for a list that is
109
- * the slot's own outermost `(`. Checked on ENTRY, before any recursion, so the
110
- * frame budget is spent by the check rather than by the call it guards.
111
- */
112
- const parseParenList = (depth) => {
113
- if (depth > MAX_SLOT_NESTING_DEPTH)
114
- return false;
115
- // Caller has already consumed the opening '('.
116
- skipTrivia();
117
- if (part[i] === ')') {
51
+ export function skipStepTrivia(text, from) {
52
+ let i = from;
53
+ for (;;) {
54
+ while (i < text.length && isStepSpaceCode(text.charCodeAt(i)))
118
55
  i++;
119
- return true;
56
+ if (text.charCodeAt(i) === 0x2f && text.charCodeAt(i + 1) === 0x2a) {
57
+ const end = text.indexOf('*/', i + 2);
58
+ if (end === -1)
59
+ return -1;
60
+ i = end + 2;
61
+ continue;
120
62
  }
121
- for (;;) {
122
- if (!parseValue(depth))
63
+ return i;
64
+ }
65
+ }
66
+ function isDigit(code) {
67
+ return code >= 0x30 && code <= 0x39;
68
+ }
69
+ function isNameCode(code) {
70
+ return (isDigit(code) ||
71
+ (code >= 0x41 && code <= 0x5a) ||
72
+ (code >= 0x61 && code <= 0x7a) ||
73
+ code === 0x5f);
74
+ }
75
+ function isHexCode(code) {
76
+ return isDigit(code) || (code >= 0x41 && code <= 0x46) || (code >= 0x61 && code <= 0x66);
77
+ }
78
+ function isNumberRunCode(code) {
79
+ return isDigit(code) || code === 0x2b || code === 0x2d || code === 0x2e || code === 0x45 || code === 0x65;
80
+ }
81
+ /** Index past the run of name characters at `from`. */
82
+ function nameEnd(text, from) {
83
+ let i = from;
84
+ while (i < text.length && isNameCode(text.charCodeAt(i)))
85
+ i++;
86
+ return i;
87
+ }
88
+ /**
89
+ * Index past the number at `from`, or -1: one complete STEP numeric literal
90
+ * (core's `read_step_number`), an `INTEGER` within `i64`.
91
+ */
92
+ function numberEnd(text, from) {
93
+ let i = from;
94
+ while (i < text.length && isNumberRunCode(text.charCodeAt(i)))
95
+ i++;
96
+ const token = text.slice(from, i);
97
+ if (!isCompleteStepNumericLiteral(token))
98
+ return -1;
99
+ if (!/[.eE]/.test(token)) {
100
+ const value = BigInt(token);
101
+ if (value > I64_MAX || value < I64_MIN)
102
+ return -1;
103
+ }
104
+ return i;
105
+ }
106
+ /**
107
+ * Whether `value` is exactly ONE STEP value, trivia allowed around it and
108
+ * between its parts. See the module comment for the grammar.
109
+ */
110
+ export function isStepValue(value) {
111
+ const n = value.length;
112
+ let i = skipStepTrivia(value, 0);
113
+ if (i === -1)
114
+ return false;
115
+ let depth = 0;
116
+ // Whether the next thing read is a value (after `(` or `,`) rather than a
117
+ // separator (after a value).
118
+ let expectValue = true;
119
+ for (;;) {
120
+ if (expectValue) {
121
+ if (i >= n)
123
122
  return false;
124
- skipTrivia();
125
- if (part[i] === ',') {
123
+ const code = value.charCodeAt(i);
124
+ const openList = (from) => {
125
+ depth++;
126
+ if (depth > MAX_SLOT_NESTING_DEPTH)
127
+ return false;
128
+ i = skipStepTrivia(value, from);
129
+ if (i === -1)
130
+ return false;
131
+ // An empty list is a value; an element may not be empty.
132
+ if (value.charCodeAt(i) === 0x29) {
133
+ depth--;
134
+ i++;
135
+ expectValue = false;
136
+ }
137
+ i = skipStepTrivia(value, i);
138
+ return i !== -1;
139
+ };
140
+ if (code === 0x27) {
141
+ const end = stepStringLiteralEnd(value, i);
142
+ if (end === -1)
143
+ return false;
144
+ i = end;
145
+ }
146
+ else if (code === 0x22) {
147
+ const close = value.indexOf('"', i + 1);
148
+ if (close === -1)
149
+ return false;
150
+ const first = value.charCodeAt(i + 1);
151
+ if (close === i + 1 || first < 0x30 || first > 0x33)
152
+ return false;
153
+ for (let k = i + 2; k < close; k++) {
154
+ if (!isHexCode(value.charCodeAt(k)))
155
+ return false;
156
+ }
157
+ i = close + 1;
158
+ }
159
+ else if (code === 0x24 || code === 0x2a) {
126
160
  i++;
127
- skipTrivia();
161
+ }
162
+ else if (code === 0x23) {
163
+ let end = i + 1;
164
+ while (end < n && isDigit(value.charCodeAt(end)))
165
+ end++;
166
+ if (end === i + 1 || Number(value.slice(i + 1, end)) > U32_MAX)
167
+ return false;
168
+ i = end;
169
+ }
170
+ else if (code === 0x2e && i + 1 < n && !isDigit(value.charCodeAt(i + 1))) {
171
+ const end = nameEnd(value, i + 1);
172
+ if (end === i + 1 || value.charCodeAt(end) !== 0x2e)
173
+ return false;
174
+ i = end + 1;
175
+ }
176
+ else if (code === 0x28) {
177
+ if (!openList(i + 1))
178
+ return false;
128
179
  continue;
129
180
  }
130
- if (part[i] === ')') {
131
- i++;
132
- return true;
181
+ else if (code === 0x2b || code === 0x2d || code === 0x2e || isDigit(code)) {
182
+ const end = numberEnd(value, i);
183
+ if (end === -1)
184
+ return false;
185
+ i = end;
133
186
  }
134
- return false;
135
- }
136
- };
137
- const parseValue = (depth) => {
138
- skipTrivia();
139
- if (i >= n)
140
- return false;
141
- const c = part[i];
142
- if (c === "'") {
143
- i++;
144
- while (i < n) {
145
- if (part[i] === "'") {
146
- if (part[i + 1] === "'") {
147
- i += 2;
148
- continue;
149
- }
150
- i++;
151
- return true;
152
- }
153
- i++;
187
+ else if ((code >= 0x41 && code <= 0x5a) || (code >= 0x61 && code <= 0x7a) || code === 0x5f) {
188
+ const open = skipStepTrivia(value, nameEnd(value, i));
189
+ // A bare keyword is no value.
190
+ if (open === -1 || value.charCodeAt(open) !== 0x28)
191
+ return false;
192
+ if (!openList(open + 1))
193
+ return false;
194
+ continue;
154
195
  }
155
- return false; // unterminated string
156
- }
157
- if (c === '(') {
158
- i++;
159
- return parseParenList(depth + 1);
160
- }
161
- // Binary literal (ISO 10303-21 `"..."`, e.g. `"0123ABC"` — an
162
- // IfcBinary-typed value, distinct from the `'...'` string literal above.
163
- // Unlike a string, `"` has no doubled-quote escape in STEP: ifcopenshell's
164
- // tokenizer (`IfcParse.cpp`, `GeneralTokenPtr`/`IfcSpfLexer::Next`)
165
- // classifies a token as binary purely by its leading `"` and does not
166
- // decode escapes inside it, so the first following `"` ends the literal.
167
- if (c === '"') {
168
- i++;
169
- while (i < n && part[i] !== '"')
170
- i++;
171
- if (i >= n)
172
- return false; // unterminated binary literal
173
- i++;
174
- return true;
175
- }
176
- if (c === '$' || c === '*') {
177
- i++;
178
- return true;
196
+ else {
197
+ return false;
198
+ }
199
+ expectValue = false;
200
+ i = skipStepTrivia(value, i);
201
+ if (i === -1)
202
+ return false;
203
+ continue;
179
204
  }
180
- // Bare token: keyword, enumeration (`.NOTDEFINED.`), number (incl.
181
- // exponent), or an `#`-prefixed entity reference.
182
- const start = i;
183
- while (i < n && /[A-Za-z0-9_.+\-#]/.test(part[i]))
184
- i++;
185
- if (i === start)
205
+ // A value just closed: at depth zero it was the whole slot.
206
+ if (depth === 0)
207
+ return i === n;
208
+ const code = value.charCodeAt(i);
209
+ if (code === 0x29)
210
+ depth--;
211
+ else if (code === 0x2c)
212
+ expectValue = true;
213
+ else
186
214
  return false;
187
- // A typed value: NAME(...), trivia tolerated before '(' the same way
188
- // `RECORD_PREFIX_RE` tolerates it before a record's own '('.
189
- skipTrivia();
190
- if (part[i] === '(') {
191
- i++;
192
- return parseParenList(depth + 1);
193
- }
194
- return true;
195
- };
196
- if (!parseValue(0))
197
- return false;
198
- skipTrivia();
199
- return i === n;
215
+ i = skipStepTrivia(value, i + 1);
216
+ if (i === -1)
217
+ return false;
218
+ }
219
+ }
220
+ /**
221
+ * Whether `part` — one slot `splitTopLevelStepArguments` already separated on
222
+ * a top-level comma, raw text including any surrounding whitespace or
223
+ * comments — is a single well-formed STEP value, or is empty.
224
+ *
225
+ * Empty is deliberately accepted, matching `splitTopLevelStepArguments`:
226
+ * `a,,b` is one empty part, not a rejection, so slot indices after it stay
227
+ * aligned with what the entity parser counts. A part that is ONLY a comment is
228
+ * NOT given that pass: counting it as one more empty slot would shift every
229
+ * index after it.
230
+ */
231
+ export function isWellFormedStepSlot(part) {
232
+ return isStepBlank(part) || isStepValue(part);
200
233
  }
201
234
  //# sourceMappingURL=step-slot-grammar.js.map