@ifc-lite/parser 5.2.0 → 6.1.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 (151) 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/group-assignment-factor.d.ts +13 -0
  49. package/dist/group-assignment-factor.d.ts.map +1 -0
  50. package/dist/group-assignment-factor.js +30 -0
  51. package/dist/group-assignment-factor.js.map +1 -0
  52. package/dist/ifczip.d.ts +6 -0
  53. package/dist/ifczip.d.ts.map +1 -1
  54. package/dist/ifczip.js +20 -11
  55. package/dist/ifczip.js.map +1 -1
  56. package/dist/index.d.ts +7 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +13 -2
  59. package/dist/index.js.map +1 -1
  60. package/dist/on-demand-extractors.d.ts +1 -0
  61. package/dist/on-demand-extractors.d.ts.map +1 -1
  62. package/dist/on-demand-extractors.js +2 -1
  63. package/dist/on-demand-extractors.js.map +1 -1
  64. package/dist/property-value-parser.d.ts +10 -0
  65. package/dist/property-value-parser.d.ts.map +1 -1
  66. package/dist/property-value-parser.js +40 -1
  67. package/dist/property-value-parser.js.map +1 -1
  68. package/dist/scan-entities-balanced.d.ts.map +1 -1
  69. package/dist/scan-entities-balanced.js +8 -6
  70. package/dist/scan-entities-balanced.js.map +1 -1
  71. package/dist/scan-worker-lexing.d.ts +14 -0
  72. package/dist/scan-worker-lexing.d.ts.map +1 -0
  73. package/dist/scan-worker-lexing.js +101 -0
  74. package/dist/scan-worker-lexing.js.map +1 -0
  75. package/dist/scan-worker-source.d.ts +1 -1
  76. package/dist/scan-worker-source.d.ts.map +1 -1
  77. package/dist/scan-worker-source.js +61 -59
  78. package/dist/scan-worker-source.js.map +1 -1
  79. package/dist/schedule-extractor.d.ts +2 -80
  80. package/dist/schedule-extractor.d.ts.map +1 -1
  81. package/dist/schedule-extractor.js +100 -225
  82. package/dist/schedule-extractor.js.map +1 -1
  83. package/dist/schedule-serializer-builders.d.ts +28 -0
  84. package/dist/schedule-serializer-builders.d.ts.map +1 -0
  85. package/dist/schedule-serializer-builders.js +163 -0
  86. package/dist/schedule-serializer-builders.js.map +1 -0
  87. package/dist/schedule-serializer.d.ts +6 -0
  88. package/dist/schedule-serializer.d.ts.map +1 -1
  89. package/dist/schedule-serializer.js +26 -165
  90. package/dist/schedule-serializer.js.map +1 -1
  91. package/dist/schedule-types.d.ts +211 -0
  92. package/dist/schedule-types.d.ts.map +1 -0
  93. package/dist/schedule-types.js +221 -0
  94. package/dist/schedule-types.js.map +1 -0
  95. package/dist/spatial-hierarchy-ambiguity.d.ts +39 -0
  96. package/dist/spatial-hierarchy-ambiguity.d.ts.map +1 -0
  97. package/dist/spatial-hierarchy-ambiguity.js +25 -0
  98. package/dist/spatial-hierarchy-ambiguity.js.map +1 -0
  99. package/dist/spatial-hierarchy-attributes.d.ts +54 -0
  100. package/dist/spatial-hierarchy-attributes.d.ts.map +1 -0
  101. package/dist/spatial-hierarchy-attributes.js +145 -0
  102. package/dist/spatial-hierarchy-attributes.js.map +1 -0
  103. package/dist/spatial-hierarchy-builder.d.ts +0 -30
  104. package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
  105. package/dist/spatial-hierarchy-builder.js +45 -167
  106. package/dist/spatial-hierarchy-builder.js.map +1 -1
  107. package/dist/spatial-hierarchy-canonical-parent.d.ts +52 -2
  108. package/dist/spatial-hierarchy-canonical-parent.d.ts.map +1 -1
  109. package/dist/spatial-hierarchy-canonical-parent.js +153 -4
  110. package/dist/spatial-hierarchy-canonical-parent.js.map +1 -1
  111. package/dist/step-lexing.d.ts +1 -1
  112. package/dist/step-lexing.d.ts.map +1 -1
  113. package/dist/step-lexing.js +1 -56
  114. package/dist/step-lexing.js.map +1 -1
  115. package/dist/step-record-boundary.d.ts +28 -0
  116. package/dist/step-record-boundary.d.ts.map +1 -0
  117. package/dist/step-record-boundary.js +108 -0
  118. package/dist/step-record-boundary.js.map +1 -0
  119. package/dist/step-record-boundary.vectors.d.ts +58 -0
  120. package/dist/step-record-boundary.vectors.d.ts.map +1 -0
  121. package/dist/step-record-boundary.vectors.js +80 -0
  122. package/dist/step-record-boundary.vectors.js.map +1 -0
  123. package/dist/structural-extractor.d.ts +9 -0
  124. package/dist/structural-extractor.d.ts.map +1 -0
  125. package/dist/structural-extractor.js +310 -0
  126. package/dist/structural-extractor.js.map +1 -0
  127. package/dist/structural-load-extractor.d.ts +147 -0
  128. package/dist/structural-load-extractor.d.ts.map +1 -0
  129. package/dist/structural-load-extractor.js +178 -0
  130. package/dist/structural-load-extractor.js.map +1 -0
  131. package/dist/structural-step-values.d.ts +51 -0
  132. package/dist/structural-step-values.d.ts.map +1 -0
  133. package/dist/structural-step-values.js +109 -0
  134. package/dist/structural-step-values.js.map +1 -0
  135. package/dist/structural-types.d.ts +145 -0
  136. package/dist/structural-types.d.ts.map +1 -0
  137. package/dist/structural-types.js +5 -0
  138. package/dist/structural-types.js.map +1 -0
  139. package/dist/tokenizer.d.ts +11 -5
  140. package/dist/tokenizer.d.ts.map +1 -1
  141. package/dist/tokenizer.js +75 -21
  142. package/dist/tokenizer.js.map +1 -1
  143. package/dist/wasm-init-retry.d.ts +6 -42
  144. package/dist/wasm-init-retry.d.ts.map +1 -1
  145. package/dist/wasm-init-retry.js +6 -99
  146. package/dist/wasm-init-retry.js.map +1 -1
  147. package/dist/wasm-panic-forward.d.ts +7 -63
  148. package/dist/wasm-panic-forward.d.ts.map +1 -1
  149. package/dist/wasm-panic-forward.js +7 -100
  150. package/dist/wasm-panic-forward.js.map +1 -1
  151. package/package.json +5 -4
@@ -1,7 +1,51 @@
1
1
  /* This Source Code Form is subject to the terms of the Mozilla Public
2
2
  * License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
- import { IfcTypeEnum, RelationshipType, isSpatialStructureType } from '@ifc-lite/data';
4
+ import { IfcTypeEnum, RelationshipType, createLogger, isSpatialStructureType } from '@ifc-lite/data';
5
+ const log = createLogger('SpatialHierarchy');
6
+ /**
7
+ * Is `candidateParent` reachable from `childId` by walking forward
8
+ * `IfcRelAggregates` edges (i.e. is `childId` an ANCESTOR of `candidateParent`
9
+ * in the raw, unresolved aggregation graph)? Used only to disqualify a tied
10
+ * candidate parent that would close a cycle back through the child itself -
11
+ * see the doc comment on `computeCanonicalParent` for why that specific shape
12
+ * needs a check at all. Bounded to `childId`'s own (raw) aggregation
13
+ * subtree, so it only costs anything on an already-malformed file where a
14
+ * child has more than one candidate Aggregates parent - the common case
15
+ * (one candidate) never calls this.
16
+ */
17
+ /**
18
+ * Upper bound on aggregate-graph node visits spent on back-edge cycle checks
19
+ * for one file. The check only runs for children named by MORE THAN ONE
20
+ * IfcRelAggregates (already malformed), and costs one descendant walk per
21
+ * such child - O(V+E) each - so a crafted file with thousands of contested
22
+ * children could otherwise burn O(C·(V+E)). Past the budget the resolver
23
+ * falls back to plain first-declared-wins (the pre-#4285 behaviour) and says
24
+ * so once, instead of stalling the parse.
25
+ */
26
+ export const CYCLE_CHECK_VISIT_BUDGET = 2_000_000;
27
+ /**
28
+ * Aggregated descendants of `childId` (transitive, forward `Aggregates`),
29
+ * charged against `budget`. Returns null when the budget ran out mid-walk
30
+ * (the partial set must not be used - a missing descendant reads as "no
31
+ * cycle", which is the wrong side to err on).
32
+ */
33
+ function aggregatedDescendants(childId, relationships, budget) {
34
+ const visited = new Set([childId]);
35
+ const stack = [childId];
36
+ while (stack.length > 0) {
37
+ const current = stack.pop();
38
+ for (const kid of relationships.getRelated(current, RelationshipType.Aggregates, 'forward')) {
39
+ if (--budget.visits < 0)
40
+ return null;
41
+ if (!visited.has(kid)) {
42
+ visited.add(kid);
43
+ stack.push(kid);
44
+ }
45
+ }
46
+ }
47
+ return visited;
48
+ }
5
49
  /**
6
50
  * Resolve each spatial-structure entity's ONE canonical parent, globally,
7
51
  * before any recursion starts - so the result cannot depend on traversal
@@ -20,7 +64,19 @@ import { IfcTypeEnum, RelationshipType, isSpatialStructureType } from '@ifc-lite
20
64
  * sort is stable per key (`relationship-graph.ts`) - it scatters edges
21
65
  * for the same child in the order they were appended, never
22
66
  * reordering by id. So `edges[0]` for a given child is the
23
- * first-declared parent edge; no id comparison is needed or correct.
67
+ * first-declared parent edge; no id comparison is needed or correct -
68
+ * EXCEPT that a candidate closing a cycle back through the child is
69
+ * skipped first (see `aggregatedDescendants`, #4246): a mutual or
70
+ * longer aggregation back-edge cannot win a tie against a candidate that
71
+ * doesn't orphan the child's own subtree from itself. Each time that
72
+ * happens, a warning is logged (always-visible, like the existing
73
+ * "No storeys/buildings found" warnings below) naming the child and the
74
+ * disqualified candidate - the only signal a caller gets that a
75
+ * malformed back-edge was found and repaired, short of building a
76
+ * dedicated report (out of scope here; see the #4208 semantic drop
77
+ * census for that shape of reporting - a different layer: per-STEP-class
78
+ * scan/retain counts collected during columnar categorization, not a
79
+ * graph-repair event like this one).
24
80
  * 2. Only when a child has NO aggregates edge at all does a containment edge
25
81
  * (IfcRelContainedInSpatialStructure targeting a spatial-structure type -
26
82
  * the Revit Family/Dynamo `IfcSpace`/`IfcSpatialZone` pattern, #1075)
@@ -31,8 +87,11 @@ import { IfcTypeEnum, RelationshipType, isSpatialStructureType } from '@ifc-lite
31
87
  * names the child drops the edge instead of adding an empty-stub duplicate
32
88
  * (#4095).
33
89
  */
34
- export function computeCanonicalParent(entities, relationships) {
90
+ export function computeCanonicalParent(entities, relationships, options = {}) {
35
91
  const canonicalParent = new Map();
92
+ const visitBudget = options.cycleCheckVisitBudget ?? CYCLE_CHECK_VISIT_BUDGET;
93
+ const cycleBudget = { visits: visitBudget };
94
+ let cycleBudgetExhausted = false;
36
95
  const claimFirstDeclaredParent = (predicate, relType) => {
37
96
  for (const childId of relationships.inverse.offsets.keys()) {
38
97
  if (canonicalParent.has(childId) || !predicate(childId))
@@ -45,7 +104,60 @@ export function computeCanonicalParent(entities, relationships) {
45
104
  // order here. This mirrors apps/server's `canonical_parent`
46
105
  // (`spatial.rs`), which does `entry(...).or_insert(...)` while
47
106
  // iterating relationships in file-scan order: first occurrence wins.
48
- const winner = edges[0];
107
+ let winner = edges[0];
108
+ if (relType === RelationshipType.Aggregates && edges.length > 1) {
109
+ // A child named as the target of more than one IfcRelAggregates is
110
+ // already a malformed file, but one shape needs a special rule: a
111
+ // BACK-EDGE, where a candidate parent P is itself a (possibly
112
+ // indirect) AGGREGATED DESCENDANT of this very child - i.e. taking P
113
+ // as childId's parent would close a cycle back through childId. That
114
+ // is the STEP-authoring-tool mistake of declaring an aggregation
115
+ // pair in both directions (#4246, the direct 2-node case; the same
116
+ // shape generalizes to a longer A->B->C->A chain). If the back-edge
117
+ // is declared before the real parent edge, plain first-declared-wins
118
+ // picks P as childId's canonical parent; P's own resolution (walking
119
+ // the SAME cycle) then independently lands back on a node inside the
120
+ // cycle too, so the whole cycle points at itself and none of it is
121
+ // reachable from IfcProject - orphaning whatever real subtree hung
122
+ // off any node in the cycle.
123
+ //
124
+ // Skip any candidate edge that closes a cycle through childId and
125
+ // take the first REMAINING candidate, still by declaration order -
126
+ // this changes nothing when a child has only one candidate (the
127
+ // overwhelmingly common case) or when none of its candidates close a
128
+ // cycle (the genuine multiple-real-parents case, #4095, which this
129
+ // loop never even sees more than one Aggregates edge for - #4095's
130
+ // contested child has exactly one Aggregates edge naming it; its
131
+ // OTHER "parent" only contains it). If EVERY candidate closes a
132
+ // cycle (a more degenerate file than anything observed), fall
133
+ // through to plain first-declared so the child is never left
134
+ // without a parent.
135
+ //
136
+ // One descendant walk per contested child (not per candidate), under a
137
+ // file-wide visit budget - see CYCLE_CHECK_VISIT_BUDGET.
138
+ const descendants = cycleBudgetExhausted ? null : aggregatedDescendants(childId, relationships, cycleBudget);
139
+ if (descendants === null) {
140
+ if (!cycleBudgetExhausted) {
141
+ cycleBudgetExhausted = true;
142
+ log.warn(`Aggregation back-edge cycle checks stopped after ${visitBudget} graph visits; ` +
143
+ 'remaining multi-parent children resolve to their first-declared IfcRelAggregates edge');
144
+ }
145
+ }
146
+ else {
147
+ const rejected = [];
148
+ const nonCyclic = edges.find((edge) => {
149
+ const cyclic = descendants.has(edge.target);
150
+ if (cyclic)
151
+ rejected.push(edge.target);
152
+ return !cyclic;
153
+ });
154
+ if (nonCyclic && nonCyclic !== winner) {
155
+ log.warn(`Ignored ${rejected.length} aggregation back-edge cycle(s): #${childId} kept parent #${nonCyclic.target}, ` +
156
+ `not ${rejected.map((id) => `#${id}`).join(', ')} (each would have closed a cycle back through #${childId})`);
157
+ winner = nonCyclic;
158
+ }
159
+ }
160
+ }
49
161
  // Inverse edges flip source/target, so `target` here is the original
50
162
  // relationship's `relating_id` (the parent).
51
163
  canonicalParent.set(childId, winner.target);
@@ -60,4 +172,41 @@ export function computeCanonicalParent(entities, relationships) {
60
172
  }, RelationshipType.ContainsElements);
61
173
  return canonicalParent;
62
174
  }
175
+ /**
176
+ * Which spatial-structure nodes will `SpatialHierarchyBuilder.buildNode`
177
+ * actually visit, starting from `projectId`? Mirrors `addSpatialChild`
178
+ * exactly: a node is visited iff it is `projectId` itself, or its
179
+ * `canonicalParent` entry points to an already-visited node - the same
180
+ * check `addSpatialChild` makes before recursing (`canonicalParent.get
181
+ * (childId) === expressId`). Computed as one forward walk over
182
+ * `canonicalParent` (childId -> parentId) up front, so a storey's
183
+ * reachability never depends on where in the traversal it happens to sit
184
+ * (#4310): a node named only by an unreachable storey - one with no path
185
+ * back to `projectId`, e.g. a malformed file where a storey has no
186
+ * `IfcRelAggregates` edge at all - is never in this set, exactly as
187
+ * `buildNode` would never recurse into it.
188
+ */
189
+ export function computeReachableSpatialNodes(projectId, canonicalParent) {
190
+ const childrenOf = new Map();
191
+ for (const [childId, parentId] of canonicalParent) {
192
+ let siblings = childrenOf.get(parentId);
193
+ if (!siblings) {
194
+ siblings = [];
195
+ childrenOf.set(parentId, siblings);
196
+ }
197
+ siblings.push(childId);
198
+ }
199
+ const reachable = new Set([projectId]);
200
+ const stack = [projectId];
201
+ while (stack.length > 0) {
202
+ const current = stack.pop();
203
+ for (const childId of childrenOf.get(current) ?? []) {
204
+ if (reachable.has(childId))
205
+ continue; // also guards a canonicalParent cycle from looping forever
206
+ reachable.add(childId);
207
+ stack.push(childId);
208
+ }
209
+ }
210
+ return reachable;
211
+ }
63
212
  //# sourceMappingURL=spatial-hierarchy-canonical-parent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spatial-hierarchy-canonical-parent.js","sourceRoot":"","sources":["../src/spatial-hierarchy-canonical-parent.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAQ/D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAqB,EAAE,aAAgC;IAC5F,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;IAElD,MAAM,wBAAwB,GAAG,CAC/B,SAAuC,EACvC,OAAyB,EACnB,EAAE;QACR,KAAK,MAAM,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YAC3D,IAAI,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBAAE,SAAS;YAClE,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YACjC,sEAAsE;YACtE,kEAAkE;YAClE,4DAA4D;YAC5D,+DAA+D;YAC/D,qEAAqE;YACrE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACxB,qEAAqE;YACrE,6CAA6C;YAC7C,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC,CAAC;IAEF,yDAAyD;IACzD,wBAAwB,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAClE,kFAAkF;IAClF,wBAAwB,CACtB,CAAC,OAAO,EAAE,EAAE;QACV,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,sBAAsB,CAAC,SAAS,CAAC,IAAI,SAAS,KAAK,WAAW,CAAC,UAAU,CAAC;IACnF,CAAC,EACD,gBAAgB,CAAC,gBAAgB,CAClC,CAAC;IAEF,OAAO,eAAe,CAAC;AACzB,CAAC"}
1
+ {"version":3,"file":"spatial-hierarchy-canonical-parent.js","sourceRoot":"","sources":["../src/spatial-hierarchy-canonical-parent.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAQ/D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAErG,MAAM,GAAG,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAE7C;;;;;;;;;;GAUG;AACH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAElD;;;;;GAKG;AACH,SAAS,qBAAqB,CAC5B,OAAe,EACf,aAAgC,EAChC,MAA0B;IAE1B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAa,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO,KAA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AC,OAAO,EAAE,QAAQ,CAAC,IAAI,eAAe,EAAE,CAAC;QAClD,IAAI,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,EAAE,CAAC;YACd,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAa,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,EAAY,CAAC;QACtC,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YACpD,IAAI,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC;gBAAE,SAAS,CAAC,2DAA2D;YACjG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACvB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -8,9 +8,9 @@ export interface Skip {
8
8
  }
9
9
  export declare function skipLexical(buf: Uint8Array, pos: number, len: number): Skip;
10
10
  export declare function opensLiteralOrComment(buf: Uint8Array, pos: number, len: number): boolean;
11
+ export declare function isSpaceByte(b: number): boolean;
11
12
  export declare function skipTrivia(buf: Uint8Array, pos: number, len: number): Skip;
12
13
  export declare function countNewlines(buf: Uint8Array, from: number, to: number): number;
13
- export declare function findEntityLength(buf: Uint8Array, pos: number, startOffset: number): number;
14
14
  /**
15
15
  * A scan of one decoded string.
16
16
  *
@@ -1 +1 @@
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AC,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;AAChF,8EAA8E;AAC9E,uCAAuC;AACvC,EAAE;AACF,yEAAyE;AACzE,+EAA+E;AAC/E,sEAAsE;AACtE,EAAE;AAC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,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":"AAyCA,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,CA+B1F;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,108 @@
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
+ // Byte length of the record starting at `startOffset` whose argument list
20
+ // opens at `pos`: up to and including the ')' balancing that '('.
21
+ //
22
+ // A failure is CLASSIFIED, because the two kinds call for opposite answers
23
+ // from a scan that wants to recover (#4179). UNBALANCED_RECORD: every literal
24
+ // and comment closed, so bytes after this record are readable and a caller may
25
+ // resume there. UNREADABLE_RECORD: one never closed, so everything to end of
26
+ // input is inside it and nothing can be resumed.
27
+ //
28
+ // A string literal is jumped over by skipStringLiteral rather than counted, so
29
+ // the '(' in 'Storey (Level 1)' is text and not depth, and STEP's doubled-quote
30
+ // escape ('') stays inside the literal instead of closing it. Sharing that
31
+ // helper keeps the escape rule in one place: an open-coded `inString` flag here
32
+ // would be a second copy, free to drift from the one every other scanner uses.
33
+ //
34
+ // A comment is jumped over for the same reason, in the same order: the literal
35
+ // test comes first, so a '/*' inside a value is text; the comment is then taken
36
+ // whole, so a '(' or a quote inside it is text. Without that, the comment in
37
+ // `#1=IFCWALL('a', /* see IFCWALL( */ $);` opened a depth that never closed.
38
+ export const UNBALANCED_RECORD = -1;
39
+ export const UNREADABLE_RECORD = -2;
40
+ export function findEntityLength(buf, pos, startOffset) {
41
+ const len = buf.length;
42
+ let depth = 0;
43
+ while (pos < len) {
44
+ const char = buf[pos];
45
+ if (char === QUOTE) {
46
+ // Returns `-1` on an unterminated literal (see skipStringLiteral's own
47
+ // doc): nothing after it is readable.
48
+ const next = skipStringLiteral(buf, pos, len);
49
+ if (next < 0)
50
+ return UNREADABLE_RECORD;
51
+ pos = next;
52
+ }
53
+ else if (opensComment(buf, pos, len)) {
54
+ const end = skipComment(buf, pos, len);
55
+ // Unterminated: the rest of the input is inside the comment.
56
+ if (end < 0)
57
+ return UNREADABLE_RECORD;
58
+ pos = end;
59
+ }
60
+ else if (char === LPAREN) {
61
+ depth++;
62
+ pos++;
63
+ }
64
+ else if (char === RPAREN) {
65
+ depth--;
66
+ pos++;
67
+ if (depth === 0)
68
+ return pos - startOffset;
69
+ }
70
+ else {
71
+ pos++;
72
+ }
73
+ }
74
+ return UNBALANCED_RECORD; // ran out of input with the '(' still open
75
+ }
76
+ /**
77
+ * Offset just past the `)` balancing the record's own `(`, or one of
78
+ * `UNBALANCED_RECORD` / `UNREADABLE_RECORD`.
79
+ *
80
+ * The byte a scan resumes at after dropping a record it refused, and the two
81
+ * failures a caller must tell apart to know whether it may resume at all.
82
+ */
83
+ export function recordCloseOffset(buf, parenPos, startOffset) {
84
+ const length = findEntityLength(buf, parenPos, startOffset);
85
+ return length > 0 ? startOffset + length : length;
86
+ }
87
+ /**
88
+ * Whether the `;` at `semi` terminates the record that closes at `close` (from
89
+ * `recordCloseOffset`).
90
+ *
91
+ * Only for the case a caller's backwards whitespace walk could not settle: on
92
+ * a record with a trailing comment before its `;` the walk lands on the last
93
+ * byte of the comment close, and it cannot see through a comment (searching
94
+ * back for the opener would find one written inside a string literal).
95
+ * Skipping the trivia after
96
+ * the closing `)` answers it exactly, for any run of comments, and runs only
97
+ * here -- never on a record whose `)` sits directly before its `;`.
98
+ *
99
+ * Takes `close` rather than recomputing it so the caller, which needs the same
100
+ * offset to resume from when this returns false, balances the record once.
101
+ */
102
+ export function semicolonClosesRecord(buf, close, semi) {
103
+ if (close <= 0)
104
+ return false;
105
+ const after = skipTrivia(buf, close, buf.length);
106
+ return !after.stop && after.next === semi;
107
+ }
108
+ //# 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;AAE3B,0EAA0E;AAC1E,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,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AAE,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,58 @@
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
+ /** The two shapes #4179 is about, as `[label, text, expected spans]`. */
45
+ /**
46
+ * Records whose LINE numbers a cold re-walk must not disturb.
47
+ *
48
+ * The worker's comment skip advances its line counter as a side effect, so a
49
+ * caller that balances the record again to settle the ')' rule inflates every
50
+ * later line unless it saves and restores. `#2` here landed on line 4 in the
51
+ * worker and line 3 in the tokenizer for the same bytes.
52
+ */
53
+ export declare const LINE_NUMBER_CASE: {
54
+ text: string;
55
+ lines: readonly [1, 3];
56
+ };
57
+ export declare const SWALLOW_CASES: readonly (readonly [string, string, (readonly [number, string])[]])[];
58
+ //# 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,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,80 @@
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
+ /** The two shapes #4179 is about, as `[label, text, expected spans]`. */
51
+ /**
52
+ * Records whose LINE numbers a cold re-walk must not disturb.
53
+ *
54
+ * The worker's comment skip advances its line counter as a side effect, so a
55
+ * caller that balances the record again to settle the ')' rule inflates every
56
+ * later line unless it saves and restores. `#2` here landed on line 4 in the
57
+ * worker and line 3 in the tokenizer for the same bytes.
58
+ */
59
+ export const LINE_NUMBER_CASE = {
60
+ text: '#1=IFCWALL(/* a\nb */$)/* c */;\n#2=IFCDOOR($);\n',
61
+ lines: [1, 3],
62
+ };
63
+ export const SWALLOW_CASES = [
64
+ [
65
+ // Pre-fix: [#1, #2, #4] -- #3 gone, #2's span covering #3's whole record,
66
+ // and no diagnostic. The broken record is DROPPED, not the tail: #3 and #4
67
+ // both survive, because the scan resumes at the ')' balancing #2's own '('.
68
+ 'a record missing its own ";" does not swallow the next record',
69
+ '#1=IFCA(1);\n#2=IFCB(2)\n#3=IFCC(3);\n#4=IFCD(4);\n',
70
+ [[1, '#1=IFCA(1);'], [3, '#3=IFCC(3);'], [4, '#4=IFCD(4);']],
71
+ ],
72
+ [
73
+ // Pre-fix: #2's span absorbed "ENDSEC;" and nothing was reported, so the
74
+ // file read as fully successful having lost a structural marker.
75
+ 'a truncated last record does not swallow the footer',
76
+ "#1=IFCPROJECT('a');\n#2=IFCWALL('b')\nENDSEC;\nEND-ISO-10303-21;\n",
77
+ [[1, "#1=IFCPROJECT('a');"]],
78
+ ],
79
+ ];
80
+ //# 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,C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