@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.
- package/dist/columnar-entity-preparation.d.ts +3 -0
- package/dist/columnar-entity-preparation.d.ts.map +1 -1
- package/dist/columnar-entity-preparation.js +101 -11
- package/dist/columnar-entity-preparation.js.map +1 -1
- package/dist/columnar-parser-indexes.d.ts +17 -1
- package/dist/columnar-parser-indexes.d.ts.map +1 -1
- package/dist/columnar-parser-indexes.js +31 -21
- package/dist/columnar-parser-indexes.js.map +1 -1
- package/dist/columnar-parser.d.ts +10 -1
- package/dist/columnar-parser.d.ts.map +1 -1
- package/dist/columnar-parser.js +14 -2
- package/dist/columnar-parser.js.map +1 -1
- package/dist/cost-extractor.d.ts +10 -0
- package/dist/cost-extractor.d.ts.map +1 -0
- package/dist/cost-extractor.js +369 -0
- package/dist/cost-extractor.js.map +1 -0
- package/dist/cost-schedule-2x3.d.ts +31 -0
- package/dist/cost-schedule-2x3.d.ts.map +1 -0
- package/dist/cost-schedule-2x3.js +75 -0
- package/dist/cost-schedule-2x3.js.map +1 -0
- package/dist/cost-types.d.ts +105 -0
- package/dist/cost-types.d.ts.map +1 -0
- package/dist/cost-types.js +5 -0
- package/dist/cost-types.js.map +1 -0
- package/dist/data-store-transport.d.ts +1 -0
- package/dist/data-store-transport.d.ts.map +1 -1
- package/dist/data-store-transport.js +5 -29
- package/dist/data-store-transport.js.map +1 -1
- package/dist/drop-census.d.ts +136 -0
- package/dist/drop-census.d.ts.map +1 -0
- package/dist/drop-census.js +53 -0
- package/dist/drop-census.js.map +1 -0
- package/dist/entity-scanner.d.ts.map +1 -1
- package/dist/entity-scanner.js +10 -5
- package/dist/entity-scanner.js.map +1 -1
- package/dist/generated/ifc2x3/schema-registry.d.ts +50 -0
- package/dist/generated/ifc2x3/schema-registry.d.ts.map +1 -0
- package/dist/generated/ifc2x3/schema-registry.js +50052 -0
- package/dist/generated/ifc2x3/schema-registry.js.map +1 -0
- package/dist/generated/ifc4x3/schema-registry.d.ts +50 -0
- package/dist/generated/ifc4x3/schema-registry.d.ts.map +1 -0
- package/dist/generated/ifc4x3/schema-registry.js +71299 -0
- package/dist/generated/ifc4x3/schema-registry.js.map +1 -0
- package/dist/generated/schema-registry-by-version.d.ts +61 -0
- package/dist/generated/schema-registry-by-version.d.ts.map +1 -0
- package/dist/generated/schema-registry-by-version.js +86 -0
- package/dist/generated/schema-registry-by-version.js.map +1 -0
- package/dist/group-assignment-factor.d.ts +13 -0
- package/dist/group-assignment-factor.d.ts.map +1 -0
- package/dist/group-assignment-factor.js +30 -0
- package/dist/group-assignment-factor.js.map +1 -0
- package/dist/ifczip.d.ts +6 -0
- package/dist/ifczip.d.ts.map +1 -1
- package/dist/ifczip.js +20 -11
- package/dist/ifczip.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/on-demand-extractors.d.ts +1 -0
- package/dist/on-demand-extractors.d.ts.map +1 -1
- package/dist/on-demand-extractors.js +2 -1
- package/dist/on-demand-extractors.js.map +1 -1
- package/dist/property-value-parser.d.ts +10 -0
- package/dist/property-value-parser.d.ts.map +1 -1
- package/dist/property-value-parser.js +40 -1
- package/dist/property-value-parser.js.map +1 -1
- package/dist/scan-entities-balanced.d.ts.map +1 -1
- package/dist/scan-entities-balanced.js +8 -6
- package/dist/scan-entities-balanced.js.map +1 -1
- package/dist/scan-worker-lexing.d.ts +14 -0
- package/dist/scan-worker-lexing.d.ts.map +1 -0
- package/dist/scan-worker-lexing.js +101 -0
- package/dist/scan-worker-lexing.js.map +1 -0
- package/dist/scan-worker-source.d.ts +1 -1
- package/dist/scan-worker-source.d.ts.map +1 -1
- package/dist/scan-worker-source.js +61 -59
- package/dist/scan-worker-source.js.map +1 -1
- package/dist/schedule-extractor.d.ts +2 -80
- package/dist/schedule-extractor.d.ts.map +1 -1
- package/dist/schedule-extractor.js +100 -225
- package/dist/schedule-extractor.js.map +1 -1
- package/dist/schedule-serializer-builders.d.ts +28 -0
- package/dist/schedule-serializer-builders.d.ts.map +1 -0
- package/dist/schedule-serializer-builders.js +163 -0
- package/dist/schedule-serializer-builders.js.map +1 -0
- package/dist/schedule-serializer.d.ts +6 -0
- package/dist/schedule-serializer.d.ts.map +1 -1
- package/dist/schedule-serializer.js +26 -165
- package/dist/schedule-serializer.js.map +1 -1
- package/dist/schedule-types.d.ts +211 -0
- package/dist/schedule-types.d.ts.map +1 -0
- package/dist/schedule-types.js +221 -0
- package/dist/schedule-types.js.map +1 -0
- package/dist/spatial-hierarchy-ambiguity.d.ts +39 -0
- package/dist/spatial-hierarchy-ambiguity.d.ts.map +1 -0
- package/dist/spatial-hierarchy-ambiguity.js +25 -0
- package/dist/spatial-hierarchy-ambiguity.js.map +1 -0
- package/dist/spatial-hierarchy-attributes.d.ts +54 -0
- package/dist/spatial-hierarchy-attributes.d.ts.map +1 -0
- package/dist/spatial-hierarchy-attributes.js +145 -0
- package/dist/spatial-hierarchy-attributes.js.map +1 -0
- package/dist/spatial-hierarchy-builder.d.ts +0 -30
- package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
- package/dist/spatial-hierarchy-builder.js +45 -167
- package/dist/spatial-hierarchy-builder.js.map +1 -1
- package/dist/spatial-hierarchy-canonical-parent.d.ts +52 -2
- package/dist/spatial-hierarchy-canonical-parent.d.ts.map +1 -1
- package/dist/spatial-hierarchy-canonical-parent.js +153 -4
- package/dist/spatial-hierarchy-canonical-parent.js.map +1 -1
- package/dist/step-lexing.d.ts +1 -1
- package/dist/step-lexing.d.ts.map +1 -1
- package/dist/step-lexing.js +1 -56
- package/dist/step-lexing.js.map +1 -1
- package/dist/step-record-boundary.d.ts +28 -0
- package/dist/step-record-boundary.d.ts.map +1 -0
- package/dist/step-record-boundary.js +108 -0
- package/dist/step-record-boundary.js.map +1 -0
- package/dist/step-record-boundary.vectors.d.ts +58 -0
- package/dist/step-record-boundary.vectors.d.ts.map +1 -0
- package/dist/step-record-boundary.vectors.js +80 -0
- package/dist/step-record-boundary.vectors.js.map +1 -0
- package/dist/structural-extractor.d.ts +9 -0
- package/dist/structural-extractor.d.ts.map +1 -0
- package/dist/structural-extractor.js +310 -0
- package/dist/structural-extractor.js.map +1 -0
- package/dist/structural-load-extractor.d.ts +147 -0
- package/dist/structural-load-extractor.d.ts.map +1 -0
- package/dist/structural-load-extractor.js +178 -0
- package/dist/structural-load-extractor.js.map +1 -0
- package/dist/structural-step-values.d.ts +51 -0
- package/dist/structural-step-values.d.ts.map +1 -0
- package/dist/structural-step-values.js +109 -0
- package/dist/structural-step-values.js.map +1 -0
- package/dist/structural-types.d.ts +145 -0
- package/dist/structural-types.d.ts.map +1 -0
- package/dist/structural-types.js +5 -0
- package/dist/structural-types.js.map +1 -0
- package/dist/tokenizer.d.ts +11 -5
- package/dist/tokenizer.d.ts.map +1 -1
- package/dist/tokenizer.js +75 -21
- package/dist/tokenizer.js.map +1 -1
- package/dist/wasm-init-retry.d.ts +6 -42
- package/dist/wasm-init-retry.d.ts.map +1 -1
- package/dist/wasm-init-retry.js +6 -99
- package/dist/wasm-init-retry.js.map +1 -1
- package/dist/wasm-panic-forward.d.ts +7 -63
- package/dist/wasm-panic-forward.d.ts.map +1 -1
- package/dist/wasm-panic-forward.js +7 -100
- package/dist/wasm-panic-forward.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
import { getAttributeNames, normalizeIfcTypeName } from './ifc-schema.js';
|
|
5
|
+
import { asBoolean, asNumber, asString } from './structural-step-values.js';
|
|
6
|
+
/** Attributes that every load/condition carries from its supertype, not a component. */
|
|
7
|
+
const NAME_ATTR = 'Name';
|
|
8
|
+
/**
|
|
9
|
+
* `IfcStructuralLoadConfiguration` positional attributes. Named here rather
|
|
10
|
+
* than resolved by name because this is the one load whose components are
|
|
11
|
+
* references and lists instead of measures.
|
|
12
|
+
*/
|
|
13
|
+
const LOAD_CONFIGURATION_ATTR = {
|
|
14
|
+
Name: 0,
|
|
15
|
+
Values: 1,
|
|
16
|
+
Locations: 2,
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Read the `Locations` attribute of an `IfcStructuralLoadConfiguration`: a
|
|
20
|
+
* list of 1..2-element lists of `IfcLengthMeasure`.
|
|
21
|
+
*/
|
|
22
|
+
function readLocations(value) {
|
|
23
|
+
if (!Array.isArray(value))
|
|
24
|
+
return undefined;
|
|
25
|
+
// A flat scalar list (`(0.,4.5)` instead of `((0.),(4.5))`) is unusable as
|
|
26
|
+
// a whole. Otherwise keep one row per slot so `Values[i]` still pairs with
|
|
27
|
+
// `Locations[i]`: a `$` row or a row with a non-numeric cell becomes an
|
|
28
|
+
// EMPTY placeholder rather than being dropped (which would shift every
|
|
29
|
+
// later row onto the wrong slot) or compacted.
|
|
30
|
+
if (!value.some((row) => Array.isArray(row)))
|
|
31
|
+
return undefined;
|
|
32
|
+
return value.map((row) => {
|
|
33
|
+
if (!Array.isArray(row))
|
|
34
|
+
return [];
|
|
35
|
+
const nums = row.map(asNumber);
|
|
36
|
+
return nums.every((n) => n !== undefined) ? nums : [];
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/** Longest chain of nested configurations followed before giving up. */
|
|
40
|
+
const MAX_LOAD_DEPTH = 4;
|
|
41
|
+
/** Ceiling on entities expanded by one top-level load read. */
|
|
42
|
+
const MAX_LOAD_NODES = 256;
|
|
43
|
+
/**
|
|
44
|
+
* Read one `IfcStructuralLoad` entity by expressId, resolving an
|
|
45
|
+
* `IfcStructuralLoadConfiguration` down through the loads its `Values` name.
|
|
46
|
+
*
|
|
47
|
+
* The `Values` edge is the only recursive one here, and it is
|
|
48
|
+
* exporter-controlled, so it is bounded three ways — none of which is
|
|
49
|
+
* redundant:
|
|
50
|
+
*
|
|
51
|
+
* - a **path-local** cycle set stops a configuration that reaches itself. It
|
|
52
|
+
* has to be path-local rather than shared across siblings, because `Values`
|
|
53
|
+
* is a LIST and may legitimately name one load twice; a shared set would
|
|
54
|
+
* suppress the repeat as if it were a cycle and report one load where the
|
|
55
|
+
* file applies two.
|
|
56
|
+
* - a **depth cap** bounds one chain's length, which the cycle set alone does
|
|
57
|
+
* not for a long acyclic chain.
|
|
58
|
+
* - a **node budget** bounds total work. The first two still admit `k`
|
|
59
|
+
* children each recursing `k` deep, which is O(k^depth) — an abort turned
|
|
60
|
+
* into a hang, and a hang reports nothing.
|
|
61
|
+
*
|
|
62
|
+
* All three bounds, and every reference this reader cannot follow for the
|
|
63
|
+
* file's own reasons, keep the `Values` slot they gave up on: the slot becomes
|
|
64
|
+
* an entry with no `value` and a `dropped` reason naming which it was, so
|
|
65
|
+
* the station a `Locations` row names still belongs to the load the file put
|
|
66
|
+
* there. Only the three bounds set `truncated`, since only they mean the file
|
|
67
|
+
* holds more than this reader agreed to walk.
|
|
68
|
+
*/
|
|
69
|
+
export function extractStructuralLoad(extractor, store, expressId) {
|
|
70
|
+
return readLoad(extractor, store, expressId, new Set(), { remaining: MAX_LOAD_NODES }, 0).value;
|
|
71
|
+
}
|
|
72
|
+
function readLoad(extractor, store, expressId, path, budget, depth) {
|
|
73
|
+
if (depth > MAX_LOAD_DEPTH)
|
|
74
|
+
return { dropped: 'depth', truncated: true };
|
|
75
|
+
if (path.has(expressId))
|
|
76
|
+
return { dropped: 'cycle', truncated: true };
|
|
77
|
+
if (budget.remaining <= 0)
|
|
78
|
+
return { dropped: 'budget', truncated: true };
|
|
79
|
+
const ref = store.entityIndex.byId.get(expressId);
|
|
80
|
+
if (!ref)
|
|
81
|
+
return { dropped: 'unresolved', truncated: false };
|
|
82
|
+
const entity = extractor.extractEntity(ref);
|
|
83
|
+
if (!entity)
|
|
84
|
+
return { dropped: 'unreadable', truncated: false };
|
|
85
|
+
budget.remaining--;
|
|
86
|
+
const type = normalizeIfcTypeName(entity.type);
|
|
87
|
+
const attrs = entity.attributes || [];
|
|
88
|
+
if (type.toUpperCase() === 'IFCSTRUCTURALLOADCONFIGURATION') {
|
|
89
|
+
const locations = readLocations(attrs[LOAD_CONFIGURATION_ATTR.Locations]);
|
|
90
|
+
const entries = [];
|
|
91
|
+
let truncated = false;
|
|
92
|
+
const values = attrs[LOAD_CONFIGURATION_ATTR.Values];
|
|
93
|
+
if (Array.isArray(values)) {
|
|
94
|
+
// On this node's path only — removed again below so a sibling that
|
|
95
|
+
// names the same load still reads it.
|
|
96
|
+
path.add(expressId);
|
|
97
|
+
for (let i = 0; i < values.length; i++) {
|
|
98
|
+
const v = values[i];
|
|
99
|
+
const row = locations?.[i];
|
|
100
|
+
const location = row && row.length > 0 ? row : undefined; // empty = placeholder for an unusable row
|
|
101
|
+
const slot = typeof v === 'number' && Number.isInteger(v) && v > 0
|
|
102
|
+
? readLoad(extractor, store, v, path, budget, depth + 1)
|
|
103
|
+
: { dropped: 'invalid-reference', truncated: false };
|
|
104
|
+
if (slot.truncated)
|
|
105
|
+
truncated = true;
|
|
106
|
+
entries.push({ value: slot.value, dropped: slot.dropped, location });
|
|
107
|
+
}
|
|
108
|
+
path.delete(expressId);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
value: {
|
|
112
|
+
expressId,
|
|
113
|
+
type,
|
|
114
|
+
name: asString(attrs[LOAD_CONFIGURATION_ATTR.Name]),
|
|
115
|
+
components: {},
|
|
116
|
+
configuration: { entries, locations, truncated },
|
|
117
|
+
},
|
|
118
|
+
truncated,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
value: {
|
|
123
|
+
expressId,
|
|
124
|
+
type,
|
|
125
|
+
name: asString(attrs[0]),
|
|
126
|
+
components: readNumericComponents(type, attrs),
|
|
127
|
+
},
|
|
128
|
+
truncated: false,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Every attribute the registry names for `type`, except the inherited `Name`,
|
|
133
|
+
* that the record carries a finite number for.
|
|
134
|
+
*/
|
|
135
|
+
function readNumericComponents(type, attrs) {
|
|
136
|
+
const components = {};
|
|
137
|
+
const names = getAttributeNames(type);
|
|
138
|
+
for (let i = 0; i < names.length; i++) {
|
|
139
|
+
const attrName = names[i];
|
|
140
|
+
if (attrName === NAME_ATTR)
|
|
141
|
+
continue;
|
|
142
|
+
const n = asNumber(attrs[i]);
|
|
143
|
+
if (n !== undefined)
|
|
144
|
+
components[attrName] = n;
|
|
145
|
+
}
|
|
146
|
+
return components;
|
|
147
|
+
}
|
|
148
|
+
/** Read one `IfcBoundaryCondition` entity by expressId. */
|
|
149
|
+
export function extractBoundaryCondition(extractor, store, expressId) {
|
|
150
|
+
const ref = store.entityIndex.byId.get(expressId);
|
|
151
|
+
if (!ref)
|
|
152
|
+
return undefined;
|
|
153
|
+
const entity = extractor.extractEntity(ref);
|
|
154
|
+
if (!entity)
|
|
155
|
+
return undefined;
|
|
156
|
+
const type = normalizeIfcTypeName(entity.type);
|
|
157
|
+
const attrs = entity.attributes || [];
|
|
158
|
+
const components = {};
|
|
159
|
+
const names = getAttributeNames(type);
|
|
160
|
+
for (let i = 0; i < names.length; i++) {
|
|
161
|
+
const attrName = names[i];
|
|
162
|
+
if (attrName === NAME_ATTR)
|
|
163
|
+
continue;
|
|
164
|
+
// The stiffness selects admit either a measure or IfcBoolean; read the
|
|
165
|
+
// boolean branch first, since a bare `.T.` would not survive the numeric
|
|
166
|
+
// test and a number is never a valid boolean token.
|
|
167
|
+
const b = asBoolean(attrs[i]);
|
|
168
|
+
if (b !== undefined) {
|
|
169
|
+
components[attrName] = b;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const n = asNumber(attrs[i]);
|
|
173
|
+
if (n !== undefined)
|
|
174
|
+
components[attrName] = n;
|
|
175
|
+
}
|
|
176
|
+
return { expressId, type, name: asString(attrs[0]), components };
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=structural-load-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-load-extractor.js","sourceRoot":"","sources":["../src/structural-load-extractor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiB/D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5E,wFAAwF;AACxF,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;GAIG;AACH,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;CACJ,CAAC;AA8GX;;;GAGG;AACH,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,uEAAuE;IACvE,+CAA+C;IAC/C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YAAE,OAAO,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAE,IAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,CAA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AAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STEP value coercions and schema-derived attribute lookup shared by the
|
|
3
|
+
* structural extractor and its load/boundary-condition reader.
|
|
4
|
+
*
|
|
5
|
+
* Shared rather than duplicated per module on purpose: the two readers walk
|
|
6
|
+
* the same `EntityExtractor` output, so a coercion that disagreed between them
|
|
7
|
+
* — one accepting `.T.` as a boolean, the other not — would be invisible until
|
|
8
|
+
* a file exercised both paths over one value.
|
|
9
|
+
*/
|
|
10
|
+
import type { EntityExtractor } from './entity-extractor.js';
|
|
11
|
+
import type { IfcDataStore } from './columnar-parser.js';
|
|
12
|
+
/**
|
|
13
|
+
* Unwrap a STEP typed value. `EntityExtractor` returns `IFCFORCEMEASURE(-100.)`
|
|
14
|
+
* as `['IFCFORCEMEASURE', -100]`, so every coercion below has to look through
|
|
15
|
+
* that wrapper before testing the value.
|
|
16
|
+
*/
|
|
17
|
+
export declare function unwrapTyped(value: unknown): unknown;
|
|
18
|
+
export declare function asString(value: unknown): string | undefined;
|
|
19
|
+
export declare function asNumber(value: unknown): number | undefined;
|
|
20
|
+
export declare function asBoolean(value: unknown): boolean | undefined;
|
|
21
|
+
/** A STEP enum reaches us as `.GLOBAL_COORDS.`; return the bare label. */
|
|
22
|
+
export declare function asEnum(value: unknown): string | undefined;
|
|
23
|
+
export declare function asRef(value: unknown): number | undefined;
|
|
24
|
+
export declare function asRefList(value: unknown): number[];
|
|
25
|
+
export declare function asNumberList(value: unknown): number[] | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve an attribute's STEP position from the generated registry by its
|
|
28
|
+
* EXPRESS name, rather than writing the index literally. A type whose registry
|
|
29
|
+
* entry does not carry the name answers -1, and {@link readAttr} reports the
|
|
30
|
+
* attribute as absent instead of reading whatever sits at a guessed offset.
|
|
31
|
+
*/
|
|
32
|
+
export declare function attrIndex(type: string, attrName: string): number;
|
|
33
|
+
export declare function readAttr(type: string, attrs: unknown[], attrName: string): unknown;
|
|
34
|
+
/** Push `value` onto `key`'s list without duplicating it. */
|
|
35
|
+
export declare function addUnique(map: Map<number, string[]>, key: number, value: string): void;
|
|
36
|
+
/** One extracted STEP record, reduced to what the structural readers need. */
|
|
37
|
+
export interface RawEntity {
|
|
38
|
+
expressId: number;
|
|
39
|
+
/**
|
|
40
|
+
* Canonical EXPRESS PascalCase. STEP stores type names uppercase, and the
|
|
41
|
+
* house rule is that a user-facing surface carries the exact EXPRESS name,
|
|
42
|
+
* so the raw `IFCSTRUCTURALCURVEMEMBER` is normalized once here rather than
|
|
43
|
+
* at each of the six places that build a public record from it.
|
|
44
|
+
*/
|
|
45
|
+
type: string;
|
|
46
|
+
attrs: unknown[];
|
|
47
|
+
/** Attribute 0 for an IfcRoot descendant; '' when absent or unreadable. */
|
|
48
|
+
globalId: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function readEntities(extractor: EntityExtractor, store: IfcDataStore, expressIds: readonly number[]): RawEntity[];
|
|
51
|
+
//# sourceMappingURL=structural-step-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-step-values.d.ts","sourceRoot":"","sources":["../src/structural-step-values.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKnD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG3D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG3D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAM7D;AAED,0EAA0E;AAC1E,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKzD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAExD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAQlD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAQjE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGlF;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOtF;AAED,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,SAAS,EAAE,CAgBb"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
import { getAttributeNames, normalizeIfcTypeName } from './ifc-schema.js';
|
|
5
|
+
/**
|
|
6
|
+
* Unwrap a STEP typed value. `EntityExtractor` returns `IFCFORCEMEASURE(-100.)`
|
|
7
|
+
* as `['IFCFORCEMEASURE', -100]`, so every coercion below has to look through
|
|
8
|
+
* that wrapper before testing the value.
|
|
9
|
+
*/
|
|
10
|
+
export function unwrapTyped(value) {
|
|
11
|
+
if (Array.isArray(value) && value.length === 2 && typeof value[0] === 'string') {
|
|
12
|
+
return value[1];
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
export function asString(value) {
|
|
17
|
+
const inner = unwrapTyped(value);
|
|
18
|
+
return typeof inner === 'string' && inner.length > 0 ? inner : undefined;
|
|
19
|
+
}
|
|
20
|
+
export function asNumber(value) {
|
|
21
|
+
const inner = unwrapTyped(value);
|
|
22
|
+
return typeof inner === 'number' && Number.isFinite(inner) ? inner : undefined;
|
|
23
|
+
}
|
|
24
|
+
export function asBoolean(value) {
|
|
25
|
+
const inner = unwrapTyped(value);
|
|
26
|
+
if (typeof inner === 'boolean')
|
|
27
|
+
return inner;
|
|
28
|
+
if (inner === '.T.' || inner === 'T')
|
|
29
|
+
return true;
|
|
30
|
+
if (inner === '.F.' || inner === 'F')
|
|
31
|
+
return false;
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
/** A STEP enum reaches us as `.GLOBAL_COORDS.`; return the bare label. */
|
|
35
|
+
export function asEnum(value) {
|
|
36
|
+
const s = asString(value);
|
|
37
|
+
if (!s)
|
|
38
|
+
return undefined;
|
|
39
|
+
const m = s.match(/^\.([A-Za-z0-9_]+)\.$/);
|
|
40
|
+
return m ? m[1] : undefined;
|
|
41
|
+
}
|
|
42
|
+
export function asRef(value) {
|
|
43
|
+
return typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined;
|
|
44
|
+
}
|
|
45
|
+
export function asRefList(value) {
|
|
46
|
+
if (!Array.isArray(value))
|
|
47
|
+
return [];
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const v of value) {
|
|
50
|
+
const id = asRef(v);
|
|
51
|
+
if (id !== undefined)
|
|
52
|
+
out.push(id);
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
export function asNumberList(value) {
|
|
57
|
+
if (!Array.isArray(value))
|
|
58
|
+
return undefined;
|
|
59
|
+
const out = [];
|
|
60
|
+
for (const v of value) {
|
|
61
|
+
const n = asNumber(v);
|
|
62
|
+
if (n !== undefined)
|
|
63
|
+
out.push(n);
|
|
64
|
+
}
|
|
65
|
+
return out.length > 0 ? out : undefined;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve an attribute's STEP position from the generated registry by its
|
|
69
|
+
* EXPRESS name, rather than writing the index literally. A type whose registry
|
|
70
|
+
* entry does not carry the name answers -1, and {@link readAttr} reports the
|
|
71
|
+
* attribute as absent instead of reading whatever sits at a guessed offset.
|
|
72
|
+
*/
|
|
73
|
+
export function attrIndex(type, attrName) {
|
|
74
|
+
return getAttributeNames(type).indexOf(attrName);
|
|
75
|
+
}
|
|
76
|
+
export function readAttr(type, attrs, attrName) {
|
|
77
|
+
const i = attrIndex(type, attrName);
|
|
78
|
+
return i >= 0 ? attrs[i] : undefined;
|
|
79
|
+
}
|
|
80
|
+
/** Push `value` onto `key`'s list without duplicating it. */
|
|
81
|
+
export function addUnique(map, key, value) {
|
|
82
|
+
let list = map.get(key);
|
|
83
|
+
if (!list) {
|
|
84
|
+
list = [];
|
|
85
|
+
map.set(key, list);
|
|
86
|
+
}
|
|
87
|
+
if (!list.includes(value))
|
|
88
|
+
list.push(value);
|
|
89
|
+
}
|
|
90
|
+
export function readEntities(extractor, store, expressIds) {
|
|
91
|
+
const out = [];
|
|
92
|
+
for (const expressId of expressIds) {
|
|
93
|
+
const ref = store.entityIndex.byId.get(expressId);
|
|
94
|
+
if (!ref)
|
|
95
|
+
continue;
|
|
96
|
+
const entity = extractor.extractEntity(ref);
|
|
97
|
+
if (!entity)
|
|
98
|
+
continue;
|
|
99
|
+
const attrs = entity.attributes || [];
|
|
100
|
+
out.push({
|
|
101
|
+
expressId,
|
|
102
|
+
type: normalizeIfcTypeName(entity.type),
|
|
103
|
+
attrs,
|
|
104
|
+
globalId: asString(attrs[0]) ?? '',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return out;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=structural-step-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-step-values.js","sourceRoot":"","sources":["../src/structural-step-values.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAc/D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC/E,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAA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,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAiBD,MAAM,UAAU,YAAY,CAC1B,SAA0B,EAC1B,KAAmB,EACnB,UAA6B;IAE7B,MAAM,GAAG,GAAgB,EAAE,CAAC;IAC5B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QACtC,GAAG,CAAC,IAAI,CAAC;YACP,SAAS;YACT,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC;YACvC,KAAK;YACL,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;SACnC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The public read model for structural analysis — the shapes
|
|
3
|
+
* `extractStructuralOnDemand` returns, held in their own module so the
|
|
4
|
+
* extractor stays orchestration and every later layer (query namespace,
|
|
5
|
+
* properties card, serializer) has one place to import the contract from.
|
|
6
|
+
*
|
|
7
|
+
* Every cross-link is a globalId, not an expressId, matching the schedule
|
|
8
|
+
* extraction's contract: a consumer federating two models is never handed an
|
|
9
|
+
* id it cannot place.
|
|
10
|
+
*/
|
|
11
|
+
import type { BoundaryConditionInfo, StructuralLoadInfo } from './structural-load-extractor.js';
|
|
12
|
+
/** An `IfcStructuralMember` subtype occurrence. */
|
|
13
|
+
export interface StructuralMemberInfo {
|
|
14
|
+
expressId: number;
|
|
15
|
+
globalId: string;
|
|
16
|
+
/** Canonical EXPRESS type name, e.g. `IfcStructuralCurveMember`. */
|
|
17
|
+
type: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
objectType?: string;
|
|
21
|
+
predefinedType?: string;
|
|
22
|
+
/** `IfcStructuralSurfaceMember.Thickness`, when the file carries it. */
|
|
23
|
+
thickness?: number;
|
|
24
|
+
/** Connections this member is joined to, via IfcRelConnectsStructuralMember. */
|
|
25
|
+
connectionGlobalIds: string[];
|
|
26
|
+
/** Activities applied to it, via IfcRelConnectsStructuralActivity. */
|
|
27
|
+
activityGlobalIds: string[];
|
|
28
|
+
/** Analysis models it belongs to, via IfcRelAssignsToGroup. */
|
|
29
|
+
analysisModelGlobalIds: string[];
|
|
30
|
+
}
|
|
31
|
+
/** An `IfcStructuralConnection` subtype occurrence. */
|
|
32
|
+
export interface StructuralConnectionInfo {
|
|
33
|
+
expressId: number;
|
|
34
|
+
globalId: string;
|
|
35
|
+
type: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
objectType?: string;
|
|
39
|
+
/** The support condition, resolved from `AppliedCondition`. */
|
|
40
|
+
appliedCondition?: BoundaryConditionInfo;
|
|
41
|
+
memberGlobalIds: string[];
|
|
42
|
+
activityGlobalIds: string[];
|
|
43
|
+
analysisModelGlobalIds: string[];
|
|
44
|
+
}
|
|
45
|
+
/** An `IfcStructuralActivity` subtype occurrence — an action or a reaction. */
|
|
46
|
+
export interface StructuralActivityInfo {
|
|
47
|
+
expressId: number;
|
|
48
|
+
globalId: string;
|
|
49
|
+
type: string;
|
|
50
|
+
/**
|
|
51
|
+
* Which side of the analysis this is: an applied load (`Action`) or a
|
|
52
|
+
* computed result (`Reaction`). Derived from the inheritance chain, so a
|
|
53
|
+
* subtype outside the two named branches reports `Unknown` rather than being
|
|
54
|
+
* silently filed as a load.
|
|
55
|
+
*/
|
|
56
|
+
kind: 'Action' | 'Reaction' | 'Unknown';
|
|
57
|
+
name?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
objectType?: string;
|
|
60
|
+
predefinedType?: string;
|
|
61
|
+
/** `IfcStructuralActivity.GlobalOrLocal`, e.g. `GLOBAL_COORDS`. */
|
|
62
|
+
globalOrLocal?: string;
|
|
63
|
+
/** `IfcStructuralAction.DestabilizingLoad`; absent on reactions. */
|
|
64
|
+
destabilizingLoad?: boolean;
|
|
65
|
+
/** `IfcStructuralActivity.AppliedLoad`, resolved. */
|
|
66
|
+
appliedLoad?: StructuralLoadInfo;
|
|
67
|
+
/** The member or connection it acts on, via IfcRelConnectsStructuralActivity. */
|
|
68
|
+
appliesToGlobalId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Every structural group this activity is assigned into via
|
|
71
|
+
* IfcRelAssignsToGroup — load groups, result groups **and** analysis models.
|
|
72
|
+
* Unlike a member's `analysisModelGlobalIds`, this one is not narrowed to a
|
|
73
|
+
* single role, because an activity legitimately belongs to several: a load
|
|
74
|
+
* case that owns it and an analysis model it was assigned straight into.
|
|
75
|
+
* Consumers wanting one role must filter by looking the globalId up in the
|
|
76
|
+
* matching collection.
|
|
77
|
+
*/
|
|
78
|
+
groupGlobalIds: string[];
|
|
79
|
+
}
|
|
80
|
+
/** An `IfcStructuralLoadGroup` or `IfcStructuralLoadCase`. */
|
|
81
|
+
export interface StructuralLoadGroupInfo {
|
|
82
|
+
expressId: number;
|
|
83
|
+
globalId: string;
|
|
84
|
+
type: string;
|
|
85
|
+
name?: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
objectType?: string;
|
|
88
|
+
predefinedType?: string;
|
|
89
|
+
actionType?: string;
|
|
90
|
+
actionSource?: string;
|
|
91
|
+
coefficient?: number;
|
|
92
|
+
purpose?: string;
|
|
93
|
+
/** `IfcStructuralLoadCase.SelfWeightCoefficients`, when present. */
|
|
94
|
+
selfWeightCoefficients?: number[];
|
|
95
|
+
activityGlobalIds: string[];
|
|
96
|
+
}
|
|
97
|
+
/** An `IfcStructuralResultGroup`. */
|
|
98
|
+
export interface StructuralResultGroupInfo {
|
|
99
|
+
expressId: number;
|
|
100
|
+
globalId: string;
|
|
101
|
+
name?: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
objectType?: string;
|
|
104
|
+
theoryType?: string;
|
|
105
|
+
isLinear?: boolean;
|
|
106
|
+
resultForLoadGroupGlobalId?: string;
|
|
107
|
+
activityGlobalIds: string[];
|
|
108
|
+
}
|
|
109
|
+
/** An `IfcStructuralAnalysisModel`. */
|
|
110
|
+
export interface StructuralAnalysisModelInfo {
|
|
111
|
+
expressId: number;
|
|
112
|
+
globalId: string;
|
|
113
|
+
name?: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
objectType?: string;
|
|
116
|
+
predefinedType?: string;
|
|
117
|
+
/** `LoadedBy` — load group globalIds. */
|
|
118
|
+
loadGroupGlobalIds: string[];
|
|
119
|
+
/** `HasResults` — result group globalIds. */
|
|
120
|
+
resultGroupGlobalIds: string[];
|
|
121
|
+
/** Members and connections assigned in via IfcRelAssignsToGroup. */
|
|
122
|
+
itemGlobalIds: string[];
|
|
123
|
+
}
|
|
124
|
+
export interface StructuralExtraction {
|
|
125
|
+
analysisModels: StructuralAnalysisModelInfo[];
|
|
126
|
+
members: StructuralMemberInfo[];
|
|
127
|
+
connections: StructuralConnectionInfo[];
|
|
128
|
+
activities: StructuralActivityInfo[];
|
|
129
|
+
loadGroups: StructuralLoadGroupInfo[];
|
|
130
|
+
resultGroups: StructuralResultGroupInfo[];
|
|
131
|
+
/** True if any structural entity was found (empty-state UI). */
|
|
132
|
+
hasStructural: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* True when reading an activity's `AppliedLoad` hit one of the walk's own
|
|
135
|
+
* bounds — the nesting cap, the node budget, or a cycle — and so returned
|
|
136
|
+
* fewer nested loads than the file holds. A consumer showing a load
|
|
137
|
+
* configuration reads this before saying "2 loads": a truncated tree is
|
|
138
|
+
* shaped exactly like a genuinely small one, and reporting the two alike is
|
|
139
|
+
* how silent truncation becomes wrong data. The per-configuration detail is
|
|
140
|
+
* `appliedLoad.configuration.truncated` and the entry-level reason is
|
|
141
|
+
* `configuration.entries[i].dropped`.
|
|
142
|
+
*/
|
|
143
|
+
loadsTruncated: boolean;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=structural-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-types.d.ts","sourceRoot":"","sources":["../src/structural-types.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEhG,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,sEAAsE;IACtE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,+DAA+D;IAC/D,sBAAsB,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,uDAAuD;AACvD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,gBAAgB,CAAC,EAA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file":"structural-types.js","sourceRoot":"","sources":["../src/structural-types.ts"],"names":[],"mappings":"AAAA;;+DAE+D"}
|
package/dist/tokenizer.d.ts
CHANGED
|
@@ -7,11 +7,17 @@ export declare class StepTokenizer {
|
|
|
7
7
|
/** Records the last scan refused for an out-of-contract express id
|
|
8
8
|
* (express-id.ts, #3395). Reset per scan; the caller reports it. */
|
|
9
9
|
get oversizedIdCount(): number;
|
|
10
|
-
/** 0 or 1: whether the last
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
/** 0 or 1: whether the last run DROPPED a record for having no terminator
|
|
11
|
+
* of its own. Never a count of how many: the first is reported and later
|
|
12
|
+
* ones are not accumulated. Nor does it say the scan STOPPED.
|
|
13
|
+
*
|
|
14
|
+
* The two scans DISAGREE about which records exist, and this is where that
|
|
15
|
+
* shows. `scanEntitiesFast` applies the #4179 record-boundary rules, so
|
|
16
|
+
* `#1=IFCA(1);\n#2=IFCB(2)\n#3=IFCC(3);` gives ids [1, 3] and a count of
|
|
17
|
+
* 1: it drops the unterminated #2 and recovers. `scanEntities`
|
|
18
|
+
* (BalancedEntityScan) closes every record on the ')' balancing its '(' and
|
|
19
|
+
* never looks at the ';' at all, so the same input gives [1, 2, 3] and a
|
|
20
|
+
* count of 0. Reset at the start of every scan; the caller reports it. */
|
|
15
21
|
get malformedRecordCount(): number;
|
|
16
22
|
/**
|
|
17
23
|
* Scan for all entity declarations (#EXPRESS_ID = TYPE(...))
|
package/dist/tokenizer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../src/tokenizer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../src/tokenizer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAmBxF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,gBAAgB,CAAa;gBAEzB,MAAM,EAAE,UAAU;IAI9B;yEACqE;IACrE,IAAI,gBAAgB,IAAI,MAAM,CAA8B;IAE5D;;;;;;;;;;+EAU2E;IAC3E,IAAI,oBAAoB,IAAI,MAAM,CAAkC;IAEpE;;;;;;;;OAQG;IACF,YAAY,IAAI,SAAS,CAAC,gBAAgB,CAAC;IAY5C;;;OAGG;IACF,gBAAgB,IAAI,SAAS,CAAC,gBAAgB,CAAC;CA6SjD"}
|