@ifc-lite/parser 5.2.0 → 6.2.1

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 (153) hide show
  1. package/dist/columnar-entity-preparation.d.ts +3 -0
  2. package/dist/columnar-entity-preparation.d.ts.map +1 -1
  3. package/dist/columnar-entity-preparation.js +101 -11
  4. package/dist/columnar-entity-preparation.js.map +1 -1
  5. package/dist/columnar-parser-indexes.d.ts +17 -1
  6. package/dist/columnar-parser-indexes.d.ts.map +1 -1
  7. package/dist/columnar-parser-indexes.js +31 -21
  8. package/dist/columnar-parser-indexes.js.map +1 -1
  9. package/dist/columnar-parser.d.ts +10 -1
  10. package/dist/columnar-parser.d.ts.map +1 -1
  11. package/dist/columnar-parser.js +14 -2
  12. package/dist/columnar-parser.js.map +1 -1
  13. package/dist/cost-extractor.d.ts +10 -0
  14. package/dist/cost-extractor.d.ts.map +1 -0
  15. package/dist/cost-extractor.js +369 -0
  16. package/dist/cost-extractor.js.map +1 -0
  17. package/dist/cost-schedule-2x3.d.ts +31 -0
  18. package/dist/cost-schedule-2x3.d.ts.map +1 -0
  19. package/dist/cost-schedule-2x3.js +75 -0
  20. package/dist/cost-schedule-2x3.js.map +1 -0
  21. package/dist/cost-types.d.ts +105 -0
  22. package/dist/cost-types.d.ts.map +1 -0
  23. package/dist/cost-types.js +5 -0
  24. package/dist/cost-types.js.map +1 -0
  25. package/dist/data-store-transport.d.ts +1 -0
  26. package/dist/data-store-transport.d.ts.map +1 -1
  27. package/dist/data-store-transport.js +5 -29
  28. package/dist/data-store-transport.js.map +1 -1
  29. package/dist/drop-census.d.ts +136 -0
  30. package/dist/drop-census.d.ts.map +1 -0
  31. package/dist/drop-census.js +53 -0
  32. package/dist/drop-census.js.map +1 -0
  33. package/dist/entity-scanner.d.ts.map +1 -1
  34. package/dist/entity-scanner.js +10 -5
  35. package/dist/entity-scanner.js.map +1 -1
  36. package/dist/generated/ifc2x3/schema-registry.d.ts +50 -0
  37. package/dist/generated/ifc2x3/schema-registry.d.ts.map +1 -0
  38. package/dist/generated/ifc2x3/schema-registry.js +50052 -0
  39. package/dist/generated/ifc2x3/schema-registry.js.map +1 -0
  40. package/dist/generated/ifc4x3/schema-registry.d.ts +50 -0
  41. package/dist/generated/ifc4x3/schema-registry.d.ts.map +1 -0
  42. package/dist/generated/ifc4x3/schema-registry.js +71299 -0
  43. package/dist/generated/ifc4x3/schema-registry.js.map +1 -0
  44. package/dist/generated/schema-registry-by-version.d.ts +61 -0
  45. package/dist/generated/schema-registry-by-version.d.ts.map +1 -0
  46. package/dist/generated/schema-registry-by-version.js +86 -0
  47. package/dist/generated/schema-registry-by-version.js.map +1 -0
  48. package/dist/georef-extractor.js +5 -5
  49. package/dist/georef-extractor.js.map +1 -1
  50. package/dist/group-assignment-factor.d.ts +13 -0
  51. package/dist/group-assignment-factor.d.ts.map +1 -0
  52. package/dist/group-assignment-factor.js +30 -0
  53. package/dist/group-assignment-factor.js.map +1 -0
  54. package/dist/ifczip.d.ts +7 -1
  55. package/dist/ifczip.d.ts.map +1 -1
  56. package/dist/ifczip.js +80 -14
  57. package/dist/ifczip.js.map +1 -1
  58. package/dist/index.d.ts +7 -2
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +13 -2
  61. package/dist/index.js.map +1 -1
  62. package/dist/on-demand-extractors.d.ts +1 -0
  63. package/dist/on-demand-extractors.d.ts.map +1 -1
  64. package/dist/on-demand-extractors.js +2 -1
  65. package/dist/on-demand-extractors.js.map +1 -1
  66. package/dist/property-value-parser.d.ts +10 -0
  67. package/dist/property-value-parser.d.ts.map +1 -1
  68. package/dist/property-value-parser.js +40 -1
  69. package/dist/property-value-parser.js.map +1 -1
  70. package/dist/scan-entities-balanced.d.ts.map +1 -1
  71. package/dist/scan-entities-balanced.js +11 -6
  72. package/dist/scan-entities-balanced.js.map +1 -1
  73. package/dist/scan-worker-lexing.d.ts +14 -0
  74. package/dist/scan-worker-lexing.d.ts.map +1 -0
  75. package/dist/scan-worker-lexing.js +106 -0
  76. package/dist/scan-worker-lexing.js.map +1 -0
  77. package/dist/scan-worker-source.d.ts +1 -1
  78. package/dist/scan-worker-source.d.ts.map +1 -1
  79. package/dist/scan-worker-source.js +64 -59
  80. package/dist/scan-worker-source.js.map +1 -1
  81. package/dist/schedule-extractor.d.ts +2 -80
  82. package/dist/schedule-extractor.d.ts.map +1 -1
  83. package/dist/schedule-extractor.js +100 -225
  84. package/dist/schedule-extractor.js.map +1 -1
  85. package/dist/schedule-serializer-builders.d.ts +28 -0
  86. package/dist/schedule-serializer-builders.d.ts.map +1 -0
  87. package/dist/schedule-serializer-builders.js +163 -0
  88. package/dist/schedule-serializer-builders.js.map +1 -0
  89. package/dist/schedule-serializer.d.ts +6 -0
  90. package/dist/schedule-serializer.d.ts.map +1 -1
  91. package/dist/schedule-serializer.js +26 -165
  92. package/dist/schedule-serializer.js.map +1 -1
  93. package/dist/schedule-types.d.ts +211 -0
  94. package/dist/schedule-types.d.ts.map +1 -0
  95. package/dist/schedule-types.js +221 -0
  96. package/dist/schedule-types.js.map +1 -0
  97. package/dist/spatial-hierarchy-ambiguity.d.ts +39 -0
  98. package/dist/spatial-hierarchy-ambiguity.d.ts.map +1 -0
  99. package/dist/spatial-hierarchy-ambiguity.js +25 -0
  100. package/dist/spatial-hierarchy-ambiguity.js.map +1 -0
  101. package/dist/spatial-hierarchy-attributes.d.ts +54 -0
  102. package/dist/spatial-hierarchy-attributes.d.ts.map +1 -0
  103. package/dist/spatial-hierarchy-attributes.js +145 -0
  104. package/dist/spatial-hierarchy-attributes.js.map +1 -0
  105. package/dist/spatial-hierarchy-builder.d.ts +0 -30
  106. package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
  107. package/dist/spatial-hierarchy-builder.js +45 -167
  108. package/dist/spatial-hierarchy-builder.js.map +1 -1
  109. package/dist/spatial-hierarchy-canonical-parent.d.ts +52 -2
  110. package/dist/spatial-hierarchy-canonical-parent.d.ts.map +1 -1
  111. package/dist/spatial-hierarchy-canonical-parent.js +153 -4
  112. package/dist/spatial-hierarchy-canonical-parent.js.map +1 -1
  113. package/dist/step-lexing.d.ts +1 -1
  114. package/dist/step-lexing.d.ts.map +1 -1
  115. package/dist/step-lexing.js +1 -56
  116. package/dist/step-lexing.js.map +1 -1
  117. package/dist/step-record-boundary.d.ts +28 -0
  118. package/dist/step-record-boundary.d.ts.map +1 -0
  119. package/dist/step-record-boundary.js +133 -0
  120. package/dist/step-record-boundary.js.map +1 -0
  121. package/dist/step-record-boundary.vectors.d.ts +102 -0
  122. package/dist/step-record-boundary.vectors.d.ts.map +1 -0
  123. package/dist/step-record-boundary.vectors.js +131 -0
  124. package/dist/step-record-boundary.vectors.js.map +1 -0
  125. package/dist/structural-extractor.d.ts +9 -0
  126. package/dist/structural-extractor.d.ts.map +1 -0
  127. package/dist/structural-extractor.js +310 -0
  128. package/dist/structural-extractor.js.map +1 -0
  129. package/dist/structural-load-extractor.d.ts +147 -0
  130. package/dist/structural-load-extractor.d.ts.map +1 -0
  131. package/dist/structural-load-extractor.js +178 -0
  132. package/dist/structural-load-extractor.js.map +1 -0
  133. package/dist/structural-step-values.d.ts +51 -0
  134. package/dist/structural-step-values.d.ts.map +1 -0
  135. package/dist/structural-step-values.js +109 -0
  136. package/dist/structural-step-values.js.map +1 -0
  137. package/dist/structural-types.d.ts +145 -0
  138. package/dist/structural-types.d.ts.map +1 -0
  139. package/dist/structural-types.js +5 -0
  140. package/dist/structural-types.js.map +1 -0
  141. package/dist/tokenizer.d.ts +11 -5
  142. package/dist/tokenizer.d.ts.map +1 -1
  143. package/dist/tokenizer.js +78 -21
  144. package/dist/tokenizer.js.map +1 -1
  145. package/dist/wasm-init-retry.d.ts +6 -42
  146. package/dist/wasm-init-retry.d.ts.map +1 -1
  147. package/dist/wasm-init-retry.js +6 -99
  148. package/dist/wasm-init-retry.js.map +1 -1
  149. package/dist/wasm-panic-forward.d.ts +7 -63
  150. package/dist/wasm-panic-forward.d.ts.map +1 -1
  151. package/dist/wasm-panic-forward.js +7 -100
  152. package/dist/wasm-panic-forward.js.map +1 -1
  153. package/package.json +5 -4
@@ -1 +1 @@
1
- {"version":3,"file":"step-lexing.d.ts","sourceRoot":"","sources":["../src/step-lexing.ts"],"names":[],"mappings":"AA2BA,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/E;AA0BD,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAO7E;AAaD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAanF;AAED,MAAM,WAAW,IAAI;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAKd,IAAI,EAAE,OAAO,CAAC;CACf;AAKD,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAa3E;AAGD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAExF;AAuCD,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAkB1E;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAM/E;AAkBD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAgC1F;AAmBD;;;;;;;;;;;;;;;;;;;;;;;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AE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAExF;AAeD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAI9C;AAoBD,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAkB1E;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAM/E;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,YAAY;IASX,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,QAAQ,CAAS;IAEzB,iFAAiF;IACjF,IAAI,QAAQ,IAAI,MAAM,CAErB;gBAE4B,IAAI,EAAE,MAAM;IAEzC;;;;;;;;OAQG;IACH,OAAO,CAAC,aAAa;IAarB;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAahC;;;;;;;;OAQG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAS9B;AAOD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAOlF"}
@@ -19,8 +19,6 @@ const SLASH = 0x2f; // '/'
19
19
  const STAR = 0x2a; // '*'
20
20
  const NEWLINE = 0x0a; // '\n'
21
21
  const QUOTE = 0x27; // '\''
22
- const LPAREN = 0x28; // '('
23
- const RPAREN = 0x29; // ')'
24
22
  // Whether a comment opens at `pos`.
25
23
  export function opensComment(buf, pos, len) {
26
24
  return buf[pos] === SLASH && pos + 1 < len && buf[pos + 1] === STAR;
@@ -117,7 +115,7 @@ export function opensLiteralOrComment(buf, pos, len) {
117
115
  // definition and excludes vertical tab, so reaching for it on either side
118
116
  // reintroduces the exact FF/VT divergence issue #3733 reported (dropped
119
117
  // entity on a leading form feed) rather than closing it.
120
- function isSpaceByte(b) {
118
+ export function isSpaceByte(b) {
121
119
  return (b === 0x20 || b === 0x09 || b === 0x0d || b === NEWLINE || b === 0x0c || b === 0x0b);
122
120
  }
123
121
  // Skip STEP trivia from `pos`: whitespace, comments, and any run of the two.
@@ -166,59 +164,6 @@ export function countNewlines(buf, from, to) {
166
164
  }
167
165
  return n;
168
166
  }
169
- // Byte length of the record that starts at `startOffset` and whose argument
170
- // list opens at `pos`: the span up to and including the ')' balancing that '(',
171
- // or 0 when the input runs out first.
172
- //
173
- // A string literal is jumped over by skipStringLiteral above rather than
174
- // counted, so the '(' in 'Storey (Level 1)' is text and not depth, and STEP's
175
- // doubled-quote escape ('') stays inside the literal instead of closing it.
176
- // Sharing that helper is what keeps the escape rule in one place: an
177
- // open-coded `inString` flag here would be a second copy of it, free to drift
178
- // from the one every other scanner in this file uses.
179
- //
180
- // A comment is jumped over for the same reason, in the same order: the literal
181
- // test comes first, so a '/*' inside a value is text; the comment is then taken
182
- // whole, so a '(' or a quote inside it is text. Without that, the comment in
183
- // `#1=IFCWALL('a', /* see IFCWALL( */ $);` opened a paren depth that never
184
- // closed and the record came back with length 0.
185
- export function findEntityLength(buf, pos, startOffset) {
186
- const len = buf.length;
187
- let depth = 0;
188
- while (pos < len) {
189
- const char = buf[pos];
190
- if (char === QUOTE) {
191
- // Returns `-1` on an unterminated literal (see skipStringLiteral's own
192
- // doc): no balancing ')' can follow, same 0 as running off the end.
193
- const next = skipStringLiteral(buf, pos, len);
194
- if (next < 0)
195
- return 0;
196
- pos = next;
197
- }
198
- else if (opensComment(buf, pos, len)) {
199
- const end = skipComment(buf, pos, len);
200
- // Unterminated: the rest of the input is inside the comment, so no
201
- // balancing ')' can follow. Same 0 as running off the end.
202
- if (end < 0)
203
- return 0;
204
- pos = end;
205
- }
206
- else if (char === LPAREN) {
207
- depth++;
208
- pos++;
209
- }
210
- else if (char === RPAREN) {
211
- depth--;
212
- pos++;
213
- if (depth === 0)
214
- return pos - startOffset;
215
- }
216
- else {
217
- pos++;
218
- }
219
- }
220
- return 0; // no matching ')'
221
- }
222
167
  // ---------------------------------------------------------------------------
223
168
  // The same rule over a decoded string.
224
169
  //
@@ -1 +1 @@
1
- {"version":3,"file":"step-lexing.js","sourceRoot":"","sources":["../src/step-lexing.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,gDAAgD;AAChD,EAAE;AACF,uEAAuE;AACvE,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,qDAAqD;AACrD,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,oEAAoE;AAEpE,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,MAAM;AAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,MAAM;AACzB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,OAAO;AAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO;AAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM;AAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM;AAE3B,oCAAoC;AACpC,MAAM,UAAU,YAAY,CAAC,GAAe,EAAE,GAAW,EAAE,GAAW;IACpE,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;AACtE,CAAC;AAED,gFAAgF;AAChF,mBAAmB;AACnB,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,gFAAgF;AAChF,gFAAgF;AAChF,4EAA4E;AAC5E,gEAAgE;AAChE,EAAE;AACF,gFAAgF;A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,IAAI,EAAE,KAAK,IAAI,CAAC;AAC/F,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,CAAS,EAAE,OAAe;IACvE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,yCAAyC;QACzE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG;YAAE,CAAC,IAAI,EAAE,CAAC;QACjC,IAAI,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAChD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const UNBALANCED_RECORD = -1;
2
+ export declare const UNREADABLE_RECORD = -2;
3
+ export declare function findEntityLength(buf: Uint8Array, pos: number, startOffset: number): number;
4
+ /**
5
+ * Offset just past the `)` balancing the record's own `(`, or one of
6
+ * `UNBALANCED_RECORD` / `UNREADABLE_RECORD`.
7
+ *
8
+ * The byte a scan resumes at after dropping a record it refused, and the two
9
+ * failures a caller must tell apart to know whether it may resume at all.
10
+ */
11
+ export declare function recordCloseOffset(buf: Uint8Array, parenPos: number, startOffset: number): number;
12
+ /**
13
+ * Whether the `;` at `semi` terminates the record that closes at `close` (from
14
+ * `recordCloseOffset`).
15
+ *
16
+ * Only for the case a caller's backwards whitespace walk could not settle: on
17
+ * a record with a trailing comment before its `;` the walk lands on the last
18
+ * byte of the comment close, and it cannot see through a comment (searching
19
+ * back for the opener would find one written inside a string literal).
20
+ * Skipping the trivia after
21
+ * the closing `)` answers it exactly, for any run of comments, and runs only
22
+ * here -- never on a record whose `)` sits directly before its `;`.
23
+ *
24
+ * Takes `close` rather than recomputing it so the caller, which needs the same
25
+ * offset to resume from when this returns false, balances the record once.
26
+ */
27
+ export declare function semicolonClosesRecord(buf: Uint8Array, close: number, semi: number): boolean;
28
+ //# sourceMappingURL=step-record-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-record-boundary.d.ts","sourceRoot":"","sources":["../src/step-record-boundary.ts"],"names":[],"mappings":"AA0DA,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAqC1F;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CAGR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAIT"}
@@ -0,0 +1,133 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Where one STEP record ends, and whether a given `;` is its own (#4179).
6
+ *
7
+ * The TypeScript half of the rule argued in `close_step_record` in
8
+ * rust/core/src/parser/lexical.rs. Rust is the source of truth
9
+ * per AGENTS.md; read the two rules, the general property they approximate,
10
+ * and why a refusal recovers rather than stops, THERE, and change the halves
11
+ * together. `StepTokenizer.scanEntitiesFast` (tokenizer.ts) calls into here;
12
+ * `WORKER_CODE` (scan-worker-source.ts) hand-duplicates it because a Blob
13
+ * worker cannot import at runtime.
14
+ */
15
+ import { opensComment, skipComment, skipStringLiteral, skipTrivia } from './step-lexing.js';
16
+ const QUOTE = 0x27; // '\''
17
+ const LPAREN = 0x28; // '('
18
+ const RPAREN = 0x29; // ')'
19
+ const EQUALS = 0x3D; // '='
20
+ // Byte length of the record starting at `startOffset` whose argument list
21
+ // opens at `pos`: up to and including the ')' balancing that '('.
22
+ //
23
+ // A failure is CLASSIFIED, because the two kinds call for opposite answers
24
+ // from a scan that wants to recover (#4179). UNBALANCED_RECORD: every literal
25
+ // and comment closed, so bytes after this record are readable and a caller may
26
+ // resume there. UNREADABLE_RECORD: one never closed, so everything to end of
27
+ // input is inside it and nothing can be resumed.
28
+ //
29
+ // A string literal is jumped over by skipStringLiteral rather than counted, so
30
+ // the '(' in 'Storey (Level 1)' is text and not depth, and STEP's doubled-quote
31
+ // escape ('') stays inside the literal instead of closing it. Sharing that
32
+ // helper keeps the escape rule in one place: an open-coded `inString` flag here
33
+ // would be a second copy, free to drift from the one every other scanner uses.
34
+ //
35
+ // A comment is jumped over for the same reason, in the same order: the literal
36
+ // test comes first, so a '/*' inside a value is text; the comment is then taken
37
+ // whole, so a '(' or a quote inside it is text. Without that, the comment in
38
+ // `#1=IFCWALL('a', /* see IFCWALL( */ $);` opened a depth that never closed.
39
+ //
40
+ // The walk STOPS at the next top-level '=' and answers UNBALANCED_RECORD
41
+ // (#4573; "Why the scan stops at the next `=`" in lexical.rs). 10303-21 has
42
+ // '=' only in `entity_instance_name '=' record`, so a ')' past one closes a
43
+ // LATER record's list, never this one's: `#1=IFCA(2 #2=IFCWALL($));`
44
+ // balanced at #2's ')' and the recovery resumed past #2, dropping it with
45
+ // nothing reported. The same stop is what bounds the walk. Without it a record
46
+ // with no ')' of its own read to end of input, the caller resumed one byte
47
+ // past its '#', and the next declaration repeated the whole walk: a file of
48
+ // `#1=A(2;` repeated measured 2.5s at 10 000 records and 10s at 20 000, 4x
49
+ // per doubling, in this scan and the Blob worker's copy alike. Stopping at
50
+ // the '=' makes each refusal cost its own record's bytes, so a file of refused
51
+ // records costs its length. A byte-window cap is not monotone (work is
52
+ // records x window, and the adversary shrinks the record), and a suffix memo
53
+ // of "no terminator from here on" is disarmed by the `ENDSEC;` every real
54
+ // file ends with; neither substitutes for the grammar rule.
55
+ export const UNBALANCED_RECORD = -1;
56
+ export const UNREADABLE_RECORD = -2;
57
+ export function findEntityLength(buf, pos, startOffset) {
58
+ const len = buf.length;
59
+ let depth = 0;
60
+ while (pos < len) {
61
+ const char = buf[pos];
62
+ if (char === QUOTE) {
63
+ // Returns `-1` on an unterminated literal (see skipStringLiteral's own
64
+ // doc): nothing after it is readable.
65
+ const next = skipStringLiteral(buf, pos, len);
66
+ if (next < 0)
67
+ return UNREADABLE_RECORD;
68
+ pos = next;
69
+ }
70
+ else if (opensComment(buf, pos, len)) {
71
+ const end = skipComment(buf, pos, len);
72
+ // Unterminated: the rest of the input is inside the comment.
73
+ if (end < 0)
74
+ return UNREADABLE_RECORD;
75
+ pos = end;
76
+ }
77
+ else if (char === EQUALS) {
78
+ // The NEXT declaration's: this record's own ')' cannot lie past it.
79
+ return UNBALANCED_RECORD;
80
+ }
81
+ else if (char === LPAREN) {
82
+ depth++;
83
+ pos++;
84
+ }
85
+ else if (char === RPAREN) {
86
+ // A ')' before any '(' closes nothing, but the bytes after it are
87
+ // readable: the answer the Rust and worker copies already give.
88
+ if (depth === 0)
89
+ return UNBALANCED_RECORD;
90
+ depth--;
91
+ pos++;
92
+ if (depth === 0)
93
+ return pos - startOffset;
94
+ }
95
+ else {
96
+ pos++;
97
+ }
98
+ }
99
+ return UNBALANCED_RECORD; // ran out of input with the '(' still open
100
+ }
101
+ /**
102
+ * Offset just past the `)` balancing the record's own `(`, or one of
103
+ * `UNBALANCED_RECORD` / `UNREADABLE_RECORD`.
104
+ *
105
+ * The byte a scan resumes at after dropping a record it refused, and the two
106
+ * failures a caller must tell apart to know whether it may resume at all.
107
+ */
108
+ export function recordCloseOffset(buf, parenPos, startOffset) {
109
+ const length = findEntityLength(buf, parenPos, startOffset);
110
+ return length > 0 ? startOffset + length : length;
111
+ }
112
+ /**
113
+ * Whether the `;` at `semi` terminates the record that closes at `close` (from
114
+ * `recordCloseOffset`).
115
+ *
116
+ * Only for the case a caller's backwards whitespace walk could not settle: on
117
+ * a record with a trailing comment before its `;` the walk lands on the last
118
+ * byte of the comment close, and it cannot see through a comment (searching
119
+ * back for the opener would find one written inside a string literal).
120
+ * Skipping the trivia after
121
+ * the closing `)` answers it exactly, for any run of comments, and runs only
122
+ * here -- never on a record whose `)` sits directly before its `;`.
123
+ *
124
+ * Takes `close` rather than recomputing it so the caller, which needs the same
125
+ * offset to resume from when this returns false, balances the record once.
126
+ */
127
+ export function semicolonClosesRecord(buf, close, semi) {
128
+ if (close <= 0)
129
+ return false;
130
+ const after = skipTrivia(buf, close, buf.length);
131
+ return !after.stop && after.next === semi;
132
+ }
133
+ //# sourceMappingURL=step-record-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-record-boundary.js","sourceRoot":"","sources":["../src/step-record-boundary.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE5F,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO;AAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM;AAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM;AAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM;AAE3B,0EAA0E;AAC1E,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,iDAAiD;AACjD,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,+EAA+E;AAC/E,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,6EAA6E;AAC7E,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E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EAAE,CAAC;QACR,CAAC;aAAM,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YAC3B,kEAAkE;YAClE,gEAAgE;YAChE,IAAI,KAAK,KAAK,CAAC;gBAAE,OAAO,iBAAiB,CAAC;YAC1C,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,IAAI,KAAK,KAAK,CAAC;gBAAE,OAAO,GAAG,GAAG,WAAW,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,GAAG,EAAE,CAAC;QACR,CAAC;IACH,CAAC;IAED,OAAO,iBAAiB,CAAC,CAAC,2CAA2C;AACvE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAe,EACf,QAAgB,EAChB,WAAmB;IAEnB,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC5D,OAAO,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,qBAAqB,CACnC,GAAe,EACf,KAAa,EACb,IAAY;IAEZ,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7B,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjD,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Shared #4179 record-boundary cases for the two TypeScript scan copies.
3
+ *
4
+ * The SCANNERS are hand-duplicated because a Blob worker cannot import at
5
+ * runtime. A test file is an ordinary module and has no such excuse, so the
6
+ * vectors live here once and `tokenizer.test.ts` and
7
+ * `scan-worker-source.malformed-record.test.ts` supply only their own driver.
8
+ * They were copies for one commit and had already drifted inside it.
9
+ */
10
+ /** What a scan returned: each record as `[expressId, source text]`. */
11
+ export type ScanSpans = {
12
+ spans: (readonly [number, string])[];
13
+ malformed: number;
14
+ };
15
+ /** Drives one scan implementation over `text`. */
16
+ export type ScanDriver = (text: string) => ScanSpans;
17
+ /**
18
+ * Records that must be ACCEPTED, i.e. the false-positive direction.
19
+ *
20
+ * Every shape is hand-constructed because a 487-file, 14,282,864-record sweep
21
+ * of this repo's IFC corpus contains NONE of them: zero records with a comment
22
+ * between the ')' and the ';', and zero with any whitespace there either. A
23
+ * clean sweep over a population without the case is not evidence about the
24
+ * case. What the corpus DOES carry, and so does attest: 6,816,392 records
25
+ * ending in a nested '))', 234,391 spanning several lines, and 15,111 with an
26
+ * '=' inside a string or comment, all accepted.
27
+ */
28
+ export declare const LEGAL_BODIES: readonly string[];
29
+ /**
30
+ * A record with no closing ')' at all costs ONE record, not the tail.
31
+ *
32
+ * `close_step_record`'s two failures are not interchangeable: this one leaves
33
+ * every literal and comment closed, so the bytes after are readable and the
34
+ * scan re-hunts from past the record's '#'. Collapsing it with the
35
+ * unreadable case below took `[1]` from an input the parent scanner read as
36
+ * `[1, 2, 3, 4]`, which is the amplification #4179 exists to remove.
37
+ */
38
+ export declare const UNBALANCED_CASE: {
39
+ text: string;
40
+ spans: readonly [readonly [1, "#1=IFCA(1);"], readonly [3, "#3=IFCC(3);"], readonly [4, "#4=IFCD(4);"]];
41
+ };
42
+ /** Bodies with no ';' of their own AND no balancing ')' to resume at. */
43
+ export declare const UNRESUMABLE_BODIES: readonly string[];
44
+ /**
45
+ * A record whose parens balance only PAST a later declaration must not hand
46
+ * back a resume point past that declaration (#4573). Pre-fix the balance walk
47
+ * closed #1 at #2's ')' and the fast scan resumed after it, so #2 vanished
48
+ * with nothing reported. The walk now stops at #2's '=', #1 is dropped alone,
49
+ * and #2 (its own ')' then ';') is found by the re-hunt. Matches Rust's
50
+ * `recovery_does_not_resume_past_the_next_declaration_4179`.
51
+ */
52
+ export declare const NEXT_DECLARATION_CASE: {
53
+ text: string;
54
+ spans: readonly [readonly [2, "#2=IFCWALL($));"], readonly [3, "#3=IFCC(3);"]];
55
+ };
56
+ /**
57
+ * A refused record must not damage its NEIGHBOUR. #1 is refused at the stray
58
+ * '=' in its body and re-hunted from past its '#'; the hunt then meets
59
+ * `#5 = 3);`, which has a declaration's `#<digits> =` prefix. It is refused
60
+ * at the type-name check (a record needs a keyword after the '='), so the
61
+ * real #5 declared a line earlier is the only #5. Matches Rust's
62
+ * `a_stray_equals_in_a_refused_body_does_not_mint_a_phantom_neighbour`.
63
+ */
64
+ export declare const PHANTOM_NEIGHBOUR_CASE: {
65
+ text: string;
66
+ ids: readonly [5, 6];
67
+ };
68
+ /**
69
+ * Files that are nothing but refused records, one per way of reaching the
70
+ * balance walk (#4573). `#1=A(2;` finds a ';' with no ')' before it, so the
71
+ * exact check balances the record; `#1=A(` never finds a ';' at all, so the
72
+ * recovery balances it. The trailers are what disarmed a suffix-memo cut of
73
+ * the fix: a lone ';', and the `ENDSEC;` every real file ends with.
74
+ *
75
+ * Pre-fix each walk read to end of input and the next declaration repeated
76
+ * it: measured 1.8-2.5s at 10 000 records and 7.4-10s at 20 000, 4x per
77
+ * doubling, on the fast scan and the worker copy alike. Bounded at the next
78
+ * '=', all four cost the file's length. `RECORDS` is sized so the unfixed
79
+ * walk overruns the budget many times over on any machine (the well-formed
80
+ * twin takes ~2ms here; the 20ms floor keeps timer noise out), while a fixed
81
+ * scan finishes in single-digit milliseconds.
82
+ */
83
+ export declare const QUADRATIC_SHAPES: readonly (readonly [string, string, string])[];
84
+ export declare const QUADRATIC_RECORDS = 20000;
85
+ export declare const QUADRATIC_WELL_FORMED = "#1=A();\n";
86
+ /** The budget a refused-record file must scan within, from the well-formed twin's time. */
87
+ export declare function quadraticBudgetMs(baselineMs: number): number;
88
+ /** The two shapes #4179 is about, as `[label, text, expected spans]`. */
89
+ /**
90
+ * Records whose LINE numbers a cold re-walk must not disturb.
91
+ *
92
+ * The worker's comment skip advances its line counter as a side effect, so a
93
+ * caller that balances the record again to settle the ')' rule inflates every
94
+ * later line unless it saves and restores. `#2` here landed on line 4 in the
95
+ * worker and line 3 in the tokenizer for the same bytes.
96
+ */
97
+ export declare const LINE_NUMBER_CASE: {
98
+ text: string;
99
+ lines: readonly [1, 3];
100
+ };
101
+ export declare const SWALLOW_CASES: readonly (readonly [string, string, (readonly [number, string])[]])[];
102
+ //# sourceMappingURL=step-record-boundary.vectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-record-boundary.vectors.d.ts","sourceRoot":"","sources":["../src/step-record-boundary.vectors.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,uEAAuE;AACvE,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpF,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;AAErD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAgBzC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;CAG3B,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAG/C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;CAGlC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAK1E,CAAC;AACF,eAAO,MAAM,iBAAiB,QAAS,CAAC;AACxC,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,yEAAyE;AACzE;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAgB9F,CAAC"}
@@ -0,0 +1,131 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Records that must be ACCEPTED, i.e. the false-positive direction.
6
+ *
7
+ * Every shape is hand-constructed because a 487-file, 14,282,864-record sweep
8
+ * of this repo's IFC corpus contains NONE of them: zero records with a comment
9
+ * between the ')' and the ';', and zero with any whitespace there either. A
10
+ * clean sweep over a population without the case is not evidence about the
11
+ * case. What the corpus DOES carry, and so does attest: 6,816,392 records
12
+ * ending in a nested '))', 234,391 spanning several lines, and 15,111 with an
13
+ * '=' inside a string or comment, all accepted.
14
+ */
15
+ export const LEGAL_BODIES = [
16
+ "IFCWALL('a=b',$);",
17
+ 'IFCWALL($ /* a=b */);',
18
+ "IFCDOCUMENTREFERENCE('http://h/q?a=b&c=d',$);",
19
+ 'IFCWALL($)/* trailing */;',
20
+ 'IFCWALL($)/* one *//* two */;',
21
+ 'IFCWALL($) /* spaced */ \t /* twice */ ;',
22
+ 'IFCWALL($)/* multi\nline */;',
23
+ "IFCWALL(('a'),(1.,2.));",
24
+ "IFCWALL(\n 'a',\n $\n);",
25
+ // isSpaceByte includes vertical tab and form feed; a form feed silently
26
+ // dropping an entity is exactly what #3733 was.
27
+ ...[' ', '\t', '\r', '\n', '\v', '\f'].flatMap((sp) => [
28
+ `IFCWALL($)${sp};`,
29
+ `IFCWALL($)${sp}/* c */${sp};`,
30
+ ]),
31
+ ];
32
+ /**
33
+ * A record with no closing ')' at all costs ONE record, not the tail.
34
+ *
35
+ * `close_step_record`'s two failures are not interchangeable: this one leaves
36
+ * every literal and comment closed, so the bytes after are readable and the
37
+ * scan re-hunts from past the record's '#'. Collapsing it with the
38
+ * unreadable case below took `[1]` from an input the parent scanner read as
39
+ * `[1, 2, 3, 4]`, which is the amplification #4179 exists to remove.
40
+ */
41
+ export const UNBALANCED_CASE = {
42
+ text: '#1=IFCA(1);\n#2=IFCB(2;\n#3=IFCC(3);\n#4=IFCD(4);\n',
43
+ spans: [[1, '#1=IFCA(1);'], [3, '#3=IFCC(3);'], [4, '#4=IFCD(4);']],
44
+ };
45
+ /** Bodies with no ';' of their own AND no balancing ')' to resume at. */
46
+ export const UNRESUMABLE_BODIES = [
47
+ "IFCWALL('never closes,$)",
48
+ 'IFCWALL(/* never closes $)',
49
+ ];
50
+ /**
51
+ * A record whose parens balance only PAST a later declaration must not hand
52
+ * back a resume point past that declaration (#4573). Pre-fix the balance walk
53
+ * closed #1 at #2's ')' and the fast scan resumed after it, so #2 vanished
54
+ * with nothing reported. The walk now stops at #2's '=', #1 is dropped alone,
55
+ * and #2 (its own ')' then ';') is found by the re-hunt. Matches Rust's
56
+ * `recovery_does_not_resume_past_the_next_declaration_4179`.
57
+ */
58
+ export const NEXT_DECLARATION_CASE = {
59
+ text: '#1=IFCA(2 #2=IFCWALL($));\n#3=IFCC(3);\n',
60
+ spans: [[2, '#2=IFCWALL($));'], [3, '#3=IFCC(3);']],
61
+ };
62
+ /**
63
+ * A refused record must not damage its NEIGHBOUR. #1 is refused at the stray
64
+ * '=' in its body and re-hunted from past its '#'; the hunt then meets
65
+ * `#5 = 3);`, which has a declaration's `#<digits> =` prefix. It is refused
66
+ * at the type-name check (a record needs a keyword after the '='), so the
67
+ * real #5 declared a line earlier is the only #5. Matches Rust's
68
+ * `a_stray_equals_in_a_refused_body_does_not_mint_a_phantom_neighbour`.
69
+ */
70
+ export const PHANTOM_NEIGHBOUR_CASE = {
71
+ text: '#5=IFCCARTESIANPOINT((0.,0.));\n#1=IFCWALL(#5 = 3);\n#6=IFCWALL($);\n',
72
+ ids: [5, 6],
73
+ };
74
+ /**
75
+ * Files that are nothing but refused records, one per way of reaching the
76
+ * balance walk (#4573). `#1=A(2;` finds a ';' with no ')' before it, so the
77
+ * exact check balances the record; `#1=A(` never finds a ';' at all, so the
78
+ * recovery balances it. The trailers are what disarmed a suffix-memo cut of
79
+ * the fix: a lone ';', and the `ENDSEC;` every real file ends with.
80
+ *
81
+ * Pre-fix each walk read to end of input and the next declaration repeated
82
+ * it: measured 1.8-2.5s at 10 000 records and 7.4-10s at 20 000, 4x per
83
+ * doubling, on the fast scan and the worker copy alike. Bounded at the next
84
+ * '=', all four cost the file's length. `RECORDS` is sized so the unfixed
85
+ * walk overruns the budget many times over on any machine (the well-formed
86
+ * twin takes ~2ms here; the 20ms floor keeps timer noise out), while a fixed
87
+ * scan finishes in single-digit milliseconds.
88
+ */
89
+ export const QUADRATIC_SHAPES = [
90
+ ['#1=A(2;\\n', '#1=A(2;\n', ''],
91
+ ['#1=A(\\n', '#1=A(\n', ''],
92
+ ['#1=A(\\n then ;', '#1=A(\n', ';'],
93
+ ['#1=A(\\n then ENDSEC', '#1=A(\n', 'ENDSEC;\nEND-ISO-10303-21;\n'],
94
+ ];
95
+ export const QUADRATIC_RECORDS = 20_000;
96
+ export const QUADRATIC_WELL_FORMED = '#1=A();\n';
97
+ /** The budget a refused-record file must scan within, from the well-formed twin's time. */
98
+ export function quadraticBudgetMs(baselineMs) {
99
+ return Math.max(baselineMs, 20) * 20;
100
+ }
101
+ /** The two shapes #4179 is about, as `[label, text, expected spans]`. */
102
+ /**
103
+ * Records whose LINE numbers a cold re-walk must not disturb.
104
+ *
105
+ * The worker's comment skip advances its line counter as a side effect, so a
106
+ * caller that balances the record again to settle the ')' rule inflates every
107
+ * later line unless it saves and restores. `#2` here landed on line 4 in the
108
+ * worker and line 3 in the tokenizer for the same bytes.
109
+ */
110
+ export const LINE_NUMBER_CASE = {
111
+ text: '#1=IFCWALL(/* a\nb */$)/* c */;\n#2=IFCDOOR($);\n',
112
+ lines: [1, 3],
113
+ };
114
+ export const SWALLOW_CASES = [
115
+ [
116
+ // Pre-fix: [#1, #2, #4] -- #3 gone, #2's span covering #3's whole record,
117
+ // and no diagnostic. The broken record is DROPPED, not the tail: #3 and #4
118
+ // both survive, because the scan resumes at the ')' balancing #2's own '('.
119
+ 'a record missing its own ";" does not swallow the next record',
120
+ '#1=IFCA(1);\n#2=IFCB(2)\n#3=IFCC(3);\n#4=IFCD(4);\n',
121
+ [[1, '#1=IFCA(1);'], [3, '#3=IFCC(3);'], [4, '#4=IFCD(4);']],
122
+ ],
123
+ [
124
+ // Pre-fix: #2's span absorbed "ENDSEC;" and nothing was reported, so the
125
+ // file read as fully successful having lost a structural marker.
126
+ 'a truncated last record does not swallow the footer',
127
+ "#1=IFCPROJECT('a');\n#2=IFCWALL('b')\nENDSEC;\nEND-ISO-10303-21;\n",
128
+ [[1, "#1=IFCPROJECT('a');"]],
129
+ ],
130
+ ];
131
+ //# sourceMappingURL=step-record-boundary.vectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-record-boundary.vectors.js","sourceRoot":"","sources":["../src/step-record-boundary.vectors.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAkB/D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,mBAAmB;IACnB,uBAAuB;IACvB,+CAA+C;IAC/C,2BAA2B;IAC3B,+BAA+B;IAC/B,0CAA0C;IAC1C,8BAA8B;IAC9B,yBAAyB;IACzB,2BAA2B;IAC3B,wEAAwE;IACxE,gDAAgD;IAChD,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;QACrD,aAAa,EAAE,G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G,EAAE,CAAC;AACvC,CAAC;AAED,yEAAyE;AACzE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,mDAAmD;IACzD,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAU;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA0E;IAClG;QACE,0EAA0E;QAC1E,2EAA2E;QAC3E,4EAA4E;QAC5E,+DAA+D;QAC/D,qDAAqD;QACrD,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;KAC7D;IACD;QACE,yEAAyE;QACzE,iEAAiE;QACjE,qDAAqD;QACrD,oEAAoE;QACpE,CAAC,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;KAC7B;CACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { IfcDataStore } from './columnar-parser.js';
2
+ import { type BoundaryConditionInfo, type StructuralLoadConfigurationEntry, type StructuralLoadConfigurationInfo, type StructuralLoadDropReason, type StructuralLoadInfo } from './structural-load-extractor.js';
3
+ import type { StructuralActivityInfo, StructuralAnalysisModelInfo, StructuralConnectionInfo, StructuralExtraction, StructuralLoadGroupInfo, StructuralMemberInfo, StructuralResultGroupInfo } from './structural-types.js';
4
+ export type { BoundaryConditionInfo, StructuralActivityInfo, StructuralAnalysisModelInfo, StructuralConnectionInfo, StructuralExtraction, StructuralLoadConfigurationEntry, StructuralLoadConfigurationInfo, StructuralLoadDropReason, StructuralLoadGroupInfo, StructuralLoadInfo, StructuralMemberInfo, StructuralResultGroupInfo, };
5
+ /**
6
+ * Extract all structural analysis data from a parsed IFC store.
7
+ */
8
+ export declare function extractStructuralOnDemand(store: IfcDataStore): StructuralExtraction;
9
+ //# sourceMappingURL=structural-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-extractor.d.ts","sourceRoot":"","sources":["../src/structural-extractor.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAC;AAcxC,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,gCAAgC,EAChC,+BAA+B,EAC/B,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAC1B,CAAC;AAmEF;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,YAAY,GAAG,oBAAoB,CAkOnF"}