@ifc-lite/export 4.11.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anonymize-placement.d.ts +0 -34
- package/dist/anonymize-placement.d.ts.map +1 -1
- package/dist/anonymize-placement.js +58 -27
- package/dist/anonymize-placement.js.map +1 -1
- package/dist/declared-property-type.d.ts.map +1 -1
- package/dist/declared-property-type.js +3 -2
- package/dist/declared-property-type.js.map +1 -1
- package/dist/effective-index.d.ts.map +1 -1
- package/dist/effective-index.js +12 -5
- package/dist/effective-index.js.map +1 -1
- package/dist/ifc5-exporter.d.ts.map +1 -1
- package/dist/ifc5-exporter.js +5 -4
- package/dist/ifc5-exporter.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lod-geometry-types.d.ts +5 -0
- package/dist/lod-geometry-types.d.ts.map +1 -1
- package/dist/lod0-generator.d.ts.map +1 -1
- package/dist/lod0-generator.js +52 -18
- package/dist/lod0-generator.js.map +1 -1
- package/dist/lod1-generator.d.ts.map +1 -1
- package/dist/lod1-generator.js +4 -1
- package/dist/lod1-generator.js.map +1 -1
- package/dist/merged-empty-containers-refs.d.ts.map +1 -1
- package/dist/merged-empty-containers-refs.js +5 -3
- package/dist/merged-empty-containers-refs.js.map +1 -1
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +31 -31
- package/dist/merged-exporter.js.map +1 -1
- package/dist/merged-remap.d.ts +0 -8
- package/dist/merged-remap.d.ts.map +1 -1
- package/dist/merged-remap.js +7 -17
- package/dist/merged-remap.js.map +1 -1
- package/dist/obj.d.ts +8 -8
- package/dist/obj.js +8 -8
- package/dist/parquet-exporter.d.ts.map +1 -1
- package/dist/parquet-exporter.js +14 -2
- package/dist/parquet-exporter.js.map +1 -1
- package/dist/property-value-serialization.d.ts.map +1 -1
- package/dist/property-value-serialization.js +7 -3
- package/dist/property-value-serialization.js.map +1 -1
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +17 -16
- package/dist/reference-collector.js.map +1 -1
- package/dist/retype.d.ts.map +1 -1
- package/dist/retype.js +12 -11
- package/dist/retype.js.map +1 -1
- package/dist/schema-conversion-loss-report.d.ts +2 -1
- package/dist/schema-conversion-loss-report.d.ts.map +1 -1
- package/dist/schema-conversion-loss-report.js +20 -11
- package/dist/schema-conversion-loss-report.js.map +1 -1
- package/dist/schema-converter-mep.d.ts +2 -0
- package/dist/schema-converter-mep.d.ts.map +1 -0
- package/dist/schema-converter-mep.js +9 -0
- package/dist/schema-converter-mep.js.map +1 -0
- package/dist/schema-converter-mep.json +96 -0
- package/dist/schema-converter-product-proxy.d.ts +25 -0
- package/dist/schema-converter-product-proxy.d.ts.map +1 -0
- package/dist/schema-converter-product-proxy.js +33 -0
- package/dist/schema-converter-product-proxy.js.map +1 -0
- package/dist/schema-converter-renames.d.ts +32 -0
- package/dist/schema-converter-renames.d.ts.map +1 -0
- package/dist/schema-converter-renames.js +60 -0
- package/dist/schema-converter-renames.js.map +1 -0
- package/dist/schema-converter.d.ts +8 -16
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +44 -71
- package/dist/schema-converter.js.map +1 -1
- package/dist/schema-style-flatten.d.ts +82 -0
- package/dist/schema-style-flatten.d.ts.map +1 -0
- package/dist/schema-style-flatten.js +245 -0
- package/dist/schema-style-flatten.js.map +1 -0
- package/dist/step-argument-parser.d.ts +7 -2
- package/dist/step-argument-parser.d.ts.map +1 -1
- package/dist/step-argument-parser.js +69 -62
- package/dist/step-argument-parser.js.map +1 -1
- package/dist/step-attribute-mutations.d.ts.map +1 -1
- package/dist/step-attribute-mutations.js +21 -22
- package/dist/step-attribute-mutations.js.map +1 -1
- package/dist/step-export-contexts.d.ts +1 -1
- package/dist/step-export-contexts.d.ts.map +1 -1
- package/dist/step-export-contexts.js +4 -1
- package/dist/step-export-contexts.js.map +1 -1
- package/dist/step-export-types.d.ts +2 -0
- package/dist/step-export-types.d.ts.map +1 -1
- package/dist/step-export-types.js.map +1 -1
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +13 -13
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-outer-args.d.ts +10 -0
- package/dist/step-outer-args.d.ts.map +1 -1
- package/dist/step-outer-args.js +29 -12
- package/dist/step-outer-args.js.map +1 -1
- package/dist/step-overlay-entities.d.ts +2 -0
- package/dist/step-overlay-entities.d.ts.map +1 -1
- package/dist/step-overlay-entities.js +43 -11
- package/dist/step-overlay-entities.js.map +1 -1
- package/dist/step-pass-builder.d.ts.map +1 -1
- package/dist/step-pass-builder.js +2 -0
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-property-set-index.d.ts.map +1 -1
- package/dist/step-property-set-index.js +8 -3
- package/dist/step-property-set-index.js.map +1 -1
- package/dist/step-property-set-readers.d.ts +6 -0
- package/dist/step-property-set-readers.d.ts.map +1 -1
- package/dist/step-property-set-readers.js +53 -14
- package/dist/step-property-set-readers.js.map +1 -1
- package/dist/step-property-sets.d.ts +14 -0
- package/dist/step-property-sets.d.ts.map +1 -1
- package/dist/step-property-sets.js +25 -8
- package/dist/step-property-sets.js.map +1 -1
- package/dist/step-record-frame.d.ts +69 -0
- package/dist/step-record-frame.d.ts.map +1 -0
- package/dist/step-record-frame.js +136 -0
- package/dist/step-record-frame.js.map +1 -0
- package/dist/step-ref-scan.d.ts +8 -0
- package/dist/step-ref-scan.d.ts.map +1 -1
- package/dist/step-ref-scan.js +29 -8
- package/dist/step-ref-scan.js.map +1 -1
- package/dist/step-serialization.d.ts +16 -4
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +39 -13
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-slot-grammar.d.ts +21 -18
- package/dist/step-slot-grammar.d.ts.map +1 -1
- package/dist/step-slot-grammar.js +210 -177
- package/dist/step-slot-grammar.js.map +1 -1
- package/dist/step-source-iteration.d.ts +1 -1
- package/dist/step-source-iteration.d.ts.map +1 -1
- package/dist/step-source-iteration.js +27 -3
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/unit-normalize.d.ts.map +1 -1
- package/dist/unit-normalize.js +13 -20
- package/dist/unit-normalize.js.map +1 -1
- package/dist/zero-content.d.ts +21 -3
- package/dist/zero-content.d.ts.map +1 -1
- package/dist/zero-content.js +35 -3
- package/dist/zero-content.js.map +1 -1
- package/package.json +8 -8
|
@@ -28,6 +28,12 @@ import type { SourceLineMutations } from './step-exporter.js';
|
|
|
28
28
|
* neither of which has a pass in hand. Both readers are built by
|
|
29
29
|
* `createSourceRefReader` over the same `dataStore.source`.
|
|
30
30
|
*/
|
|
31
|
+
/**
|
|
32
|
+
* `allocateExpressId`'s bound (#7682, EXPORT-STEP-9): an id past `u32::MAX` is
|
|
33
|
+
* one no ifc-lite reader can hold, so allocating it refuses the export, as the
|
|
34
|
+
* Rust writer does, rather than write a record that cannot be read back.
|
|
35
|
+
*/
|
|
36
|
+
export declare function allocatedExpressId(id: number): number;
|
|
31
37
|
export interface PropertySetContext {
|
|
32
38
|
readonly dataStore: IfcDataStore;
|
|
33
39
|
readonly entityExtractor: EntityExtractor | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-property-set-readers.d.ts","sourceRoot":"","sources":["../src/step-property-set-readers.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAqB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"step-property-set-readers.d.ts","sourceRoot":"","sources":["../src/step-property-set-readers.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAqB,eAAe,EAAE,MAAM,kBAAkB,CA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,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,GAAG,MAAM,GAAG,IAAI,CAEpH"}
|
|
@@ -1,13 +1,33 @@
|
|
|
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 { generateIfcGuid } from '@ifc-lite/encoding';
|
|
4
|
+
import { generateIfcGuid, stepStringLiteralEnd } from '@ifc-lite/encoding';
|
|
5
5
|
import { decodeRange } from './source-ref-bounds.js';
|
|
6
6
|
import { findLengthUnitReference, normalizeMapUnitName } from './step-map-unit.js';
|
|
7
7
|
import { authoredEntityRefs } from './effective-index.js';
|
|
8
8
|
import { HAS_PROPERTY_SETS_SLOT } from './type-owned-psets.js';
|
|
9
9
|
import { firstWrittenOwnerHistoryRef } from './schema-converter-owner-history.js';
|
|
10
10
|
import { nativeSetLine, decodeNativeSetLine } from './step-native-set-record.js';
|
|
11
|
+
import { frameArgs, stepRecordFrame, stepRecordHead } from './step-record-frame.js';
|
|
12
|
+
/**
|
|
13
|
+
* The exporter state these phases cannot read off the {@link ExportPass}.
|
|
14
|
+
*
|
|
15
|
+
* `isReadableSourceRef` is the exporter's OWN reader rather than the pass's:
|
|
16
|
+
* the byte readers below are also reached from
|
|
17
|
+
* {@link buildRelDefinesByPropertiesIndex} and from `retainSharedAtoms`,
|
|
18
|
+
* neither of which has a pass in hand. Both readers are built by
|
|
19
|
+
* `createSourceRefReader` over the same `dataStore.source`.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* `allocateExpressId`'s bound (#7682, EXPORT-STEP-9): an id past `u32::MAX` is
|
|
23
|
+
* one no ifc-lite reader can hold, so allocating it refuses the export, as the
|
|
24
|
+
* Rust writer does, rather than write a record that cannot be read back.
|
|
25
|
+
*/
|
|
26
|
+
export function allocatedExpressId(id) {
|
|
27
|
+
if (id > 0xffffffff)
|
|
28
|
+
throw new RangeError(`express id ${id} cannot be allocated: the file has spent the id space`);
|
|
29
|
+
return id;
|
|
30
|
+
}
|
|
11
31
|
/** `OwnerHistory` is slot 1 on every `IfcRoot` subtype, all schemas. */
|
|
12
32
|
const OWNER_HISTORY_SLOT = 1;
|
|
13
33
|
/**
|
|
@@ -80,10 +100,22 @@ export function getPropertySetName(ctx, psetId) {
|
|
|
80
100
|
if (entityText === null)
|
|
81
101
|
return null;
|
|
82
102
|
// Parse: IFCPROPERTYSET('guid',$,'Name',$,...) - Name is 3rd argument
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
103
|
+
return rawThirdLiteral(entityText, /IFCPROPERTYSET\s*\([^,]*,[^,]*,'/gi);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The raw text of the literal opening where `prefix` (global, ending at the
|
|
107
|
+
* opening `'`) first matches with a literal that closes. Read whole by the
|
|
108
|
+
* shared rule, so `''` and a `\S\'` PAGE operand do not cut the name short
|
|
109
|
+
* (#7589).
|
|
110
|
+
*/
|
|
111
|
+
function rawThirdLiteral(entityText, prefix) {
|
|
112
|
+
for (const match of entityText.matchAll(prefix)) {
|
|
113
|
+
const open = match.index + match[0].length - 1;
|
|
114
|
+
const end = stepStringLiteralEnd(entityText, open);
|
|
115
|
+
if (end !== -1)
|
|
116
|
+
return entityText.slice(open + 1, end - 1);
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
87
119
|
}
|
|
88
120
|
/**
|
|
89
121
|
* Get the name of an element quantity set by parsing the entity
|
|
@@ -93,10 +125,7 @@ export function getElementQuantityName(ctx, entityId) {
|
|
|
93
125
|
if (entityText === null)
|
|
94
126
|
return null;
|
|
95
127
|
// Parse: IFCELEMENTQUANTITY('guid',$,'Name',...) - Name is 3rd argument
|
|
96
|
-
|
|
97
|
-
if (!match)
|
|
98
|
-
return null;
|
|
99
|
-
return match[1];
|
|
128
|
+
return rawThirdLiteral(entityText, /IFCELEMENTQUANTITY\s*\([^,]*,[^,]*,'/gi);
|
|
100
129
|
}
|
|
101
130
|
/**
|
|
102
131
|
* Get IDs of properties in a property set
|
|
@@ -105,8 +134,10 @@ export function getPropertyIdsInSet(ctx, psetId) {
|
|
|
105
134
|
const entityText = entityLineText(ctx, psetId);
|
|
106
135
|
if (entityText === null)
|
|
107
136
|
return [];
|
|
108
|
-
// Parse: IFCPROPERTYSET(...,(#prop1,#prop2,...)); - Last argument is properties
|
|
109
|
-
|
|
137
|
+
// Parse: IFCPROPERTYSET(...,(#prop1,#prop2,...)); - Last argument is properties
|
|
138
|
+
// list, read up to the record's own close (`stepRecordFrame`, #7682).
|
|
139
|
+
const frame = stepRecordFrame(entityText);
|
|
140
|
+
const match = frame === null ? null : frameArgs(entityText, frame).match(/\(\s*(#[^)]+)\s*\)\s*$/);
|
|
110
141
|
if (!match)
|
|
111
142
|
return [];
|
|
112
143
|
const propsList = match[1];
|
|
@@ -209,9 +240,17 @@ function getOwnerHistoryRefOfEntity(ctx, entityId) {
|
|
|
209
240
|
// but the gates in this file agree on one predicate now.
|
|
210
241
|
if (entityRef && ctx.isReadableSourceRef(entityRef)) {
|
|
211
242
|
const entityText = decodeRange(ctx.dataStore.source, entityRef.byteOffset, entityRef.byteOffset + entityRef.byteLength);
|
|
212
|
-
// #ID=IFCWALL('GlobalId',#owner,...): GlobalId is a quoted STEP string
|
|
213
|
-
//
|
|
214
|
-
|
|
243
|
+
// #ID=IFCWALL('GlobalId',#owner,...): GlobalId is a quoted STEP string,
|
|
244
|
+
// read to its end by the shared rule (#7589); OwnerHistory follows it.
|
|
245
|
+
// The record's head (`stepRecordHead`, #7682), an `IFC\w+` type, then the literal.
|
|
246
|
+
const head = stepRecordHead(entityText);
|
|
247
|
+
const quote = head !== null && /^IFC\w+$/i.test(entityText.slice(head.typeStart, head.typeEnd))
|
|
248
|
+
? /^\s*'/.exec(entityText.slice(head.open + 1))
|
|
249
|
+
: null;
|
|
250
|
+
const end = head !== null && quote !== null
|
|
251
|
+
? stepStringLiteralEnd(entityText, head.open + quote[0].length)
|
|
252
|
+
: -1;
|
|
253
|
+
const match = end === -1 ? null : /^\s*,\s*#(\d+)/.exec(entityText.slice(end));
|
|
215
254
|
if (match)
|
|
216
255
|
result = `#${match[1]}`;
|
|
217
256
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-property-set-readers.js","sourceRoot":"","sources":["../src/step-property-set-readers.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmB/D,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"step-property-set-readers.js","sourceRoot":"","sources":["../src/step-property-set-readers.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmB/D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAqB,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAyB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAA6B,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGpF;;;;;;;;GAQG;AACH;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAC3C,IAAI,EAAE,GAAG,UAAU;QAAE,MAAM,IAAI,UAAU,CAAC,cAAc,EAA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AqB;IACpD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,GAAuB,EAAE,QAAgB,EAAE,SAA+B;IACnG,OAAO,uBAAuB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC;AAChJ,CAAC"}
|
|
@@ -9,5 +9,19 @@ import type { ExportPass, StepExportOptions } from './step-exporter.js';
|
|
|
9
9
|
* HasPropertySets must name the replacement IDs from both generators (#7355).
|
|
10
10
|
* The caller flushes rewrittenEntityLines only after this function returns.
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* The one emit path for every record this export APPENDS after the source
|
|
14
|
+
* pass: generated property and quantity sets, the type-object lines whose
|
|
15
|
+
* `HasPropertySets` is repointed, and the georeferencing records (#7682,
|
|
16
|
+
* EXPORT-STEP-3). Each is written in the SOURCE schema's layout, so when the
|
|
17
|
+
* export converts it goes through `convertStepLine` exactly as a source
|
|
18
|
+
* record does: renamed (`IFCDOORTYPE` to `IFCDOORSTYLE`), re-laid-out (a
|
|
19
|
+
* quantity's `Formula` trimmed for IFC2X3, #7378), and through the IFC2X3
|
|
20
|
+
* slot fill and its counters. It used to run for generated quantities only,
|
|
21
|
+
* so the others reached an IFC2X3 file in IFC4 shape. The Rust writer's
|
|
22
|
+
* `write_line` is the twin. A record the target cannot represent is a refusal
|
|
23
|
+
* here, never an omission: other appended records name it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function convertAppendedLines(pass: ExportPass, options: StepExportOptions, lines: readonly string[]): string[];
|
|
12
26
|
export declare function generatePropertyAndQuantitySetEntities(pass: ExportPass, options: StepExportOptions, ctx: PropertySetContext): void;
|
|
13
27
|
//# sourceMappingURL=step-property-sets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-property-sets.d.ts","sourceRoot":"","sources":["../src/step-property-sets.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,gCAAgC,CAAC;AAE7F,OAAO,KAAK,EAAE,UAAU,EAAuB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAM7F;;;;;;;;GAQG;AACH,wBAAgB,sCAAsC,CACpD,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,kBAAkB,GACtB,IAAI,
|
|
1
|
+
{"version":3,"file":"step-property-sets.d.ts","sourceRoot":"","sources":["../src/step-property-sets.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,gCAAgC,CAAC;AAE7F,OAAO,KAAK,EAAE,UAAU,EAAuB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAM7F;;;;;;;;GAQG;AACH;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAQrH;AAED,wBAAgB,sCAAsC,CACpD,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,kBAAkB,GACtB,IAAI,CAsNN"}
|
|
@@ -40,6 +40,29 @@ import { convertStepLine } from './schema-converter.js';
|
|
|
40
40
|
* HasPropertySets must name the replacement IDs from both generators (#7355).
|
|
41
41
|
* The caller flushes rewrittenEntityLines only after this function returns.
|
|
42
42
|
*/
|
|
43
|
+
/**
|
|
44
|
+
* The one emit path for every record this export APPENDS after the source
|
|
45
|
+
* pass: generated property and quantity sets, the type-object lines whose
|
|
46
|
+
* `HasPropertySets` is repointed, and the georeferencing records (#7682,
|
|
47
|
+
* EXPORT-STEP-3). Each is written in the SOURCE schema's layout, so when the
|
|
48
|
+
* export converts it goes through `convertStepLine` exactly as a source
|
|
49
|
+
* record does: renamed (`IFCDOORTYPE` to `IFCDOORSTYLE`), re-laid-out (a
|
|
50
|
+
* quantity's `Formula` trimmed for IFC2X3, #7378), and through the IFC2X3
|
|
51
|
+
* slot fill and its counters. It used to run for generated quantities only,
|
|
52
|
+
* so the others reached an IFC2X3 file in IFC4 shape. The Rust writer's
|
|
53
|
+
* `write_line` is the twin. A record the target cannot represent is a refusal
|
|
54
|
+
* here, never an omission: other appended records name it.
|
|
55
|
+
*/
|
|
56
|
+
export function convertAppendedLines(pass, options, lines) {
|
|
57
|
+
if (!pass.converting)
|
|
58
|
+
return [...lines];
|
|
59
|
+
return lines.map((line) => {
|
|
60
|
+
const converted = convertStepLine(line, pass.sourceSchema, pass.schema, options.guidRandom, pass.slotFill, pass.withheldRefIds, pass.ifc4Slots, pass.enums);
|
|
61
|
+
if (converted === null)
|
|
62
|
+
throw new Error('Generated record is unsupported in the target schema');
|
|
63
|
+
return converted;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
43
66
|
export function generatePropertyAndQuantitySetEntities(pass, options, ctx) {
|
|
44
67
|
// Generate new property entities for mutations (these REPLACE the skipped ones)
|
|
45
68
|
const generatedTypeOwnedPsetIds = new Map();
|
|
@@ -52,7 +75,7 @@ export function generatePropertyAndQuantitySetEntities(pass, options, ctx) {
|
|
|
52
75
|
if (!pass.willBeEmitted(entityId))
|
|
53
76
|
continue;
|
|
54
77
|
const newEntities = generatePropertySetEntities(ctx, entityId, psets, pass.willBeEmitted, pass.effective, pass.typeOwnedPsetNamesByEntity.get(entityId), options.guidRandom, sourceMembers, canReferenceSourceMember);
|
|
55
|
-
pass.entities.push(...newEntities.lines);
|
|
78
|
+
pass.entities.push(...convertAppendedLines(pass, options, newEntities.lines));
|
|
56
79
|
pass.newEntityCount += newEntities.count;
|
|
57
80
|
// Replacement content for this host actually landed, so a delta really
|
|
58
81
|
// does carry its PROPERTY-SET modification — and only that one (#2462).
|
|
@@ -72,13 +95,7 @@ export function generatePropertyAndQuantitySetEntities(pass, options, ctx) {
|
|
|
72
95
|
: generateQuantitySetEntities(ctx, entityId, [qset], pass.willBeEmitted, pass.effective, options.guidRandom, typeOwned);
|
|
73
96
|
// Generated quantity records are written in the source schema's layout.
|
|
74
97
|
// One conversion site serves occurrence, new Type and copied Type sets (#7378).
|
|
75
|
-
|
|
76
|
-
const converted = convertStepLine(line, pass.sourceSchema, pass.schema, options.guidRandom, pass.slotFill, pass.withheldRefIds, pass.ifc4Slots, pass.enums);
|
|
77
|
-
if (converted === null)
|
|
78
|
-
throw new Error('Generated quantity definition is unsupported in the target schema');
|
|
79
|
-
return converted;
|
|
80
|
-
}) : generated.lines;
|
|
81
|
-
pass.entities.push(...lines);
|
|
98
|
+
pass.entities.push(...convertAppendedLines(pass, options, generated.lines));
|
|
82
99
|
pass.newEntityCount += generated.count;
|
|
83
100
|
if (generated.lines.length > 0)
|
|
84
101
|
pass.modifications.recordEmitted(entityId, 'quantity-set');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-property-sets.js","sourceRoot":"","sources":["../src/step-property-sets.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAA2B,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAE7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,O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E,CAAC;YAC1C,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,+DAA+D;QAC/D,oEAAoE;QACpE,uEAAuE;QACvE,kEAAkE;QAClE,sEAAsE;QACtE,yCAAyC;QACzC,IAAI,OAAO,EAAE,CAAC;YACZ,wBAAwB,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAChE,oEAAoE;YACpE,wEAAwE;YACxE,6BAA6B,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;AAGH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a `#id=TYPE(args);` record's parts sit in its text: the one reader
|
|
3
|
+
* every STEP writer in this package frames a record with before it edits one
|
|
4
|
+
* (#7682, EXPORT-STEP-1).
|
|
5
|
+
*
|
|
6
|
+
* ISO 10303-21 allows trivia (whitespace, including vertical tab and form
|
|
7
|
+
* feed, and `/* ... */` comments) wherever whitespace may go, so
|
|
8
|
+
* `#5=IFCWALL(...) ;` and `#5=IFCWALL(...) /* c */;` are records like any
|
|
9
|
+
* other. The writers used to find the frame each their own way, and the ones
|
|
10
|
+
* that looked for a literal `');'` read those records as no record at all:
|
|
11
|
+
* every named, positional and retype edit on them was dropped and nothing
|
|
12
|
+
* reported it.
|
|
13
|
+
*
|
|
14
|
+
* This is the matched half of `rust/export/src/step_record_frame.rs`; the two
|
|
15
|
+
* are changed together and pinned by the shared parity vectors in
|
|
16
|
+
* `rust/export/tests/fixtures/step_log_parity_vectors.json`. Trivia follows
|
|
17
|
+
* core's `skip_step_trivia` / `is_step_space` (`skipTrivia` / `isSpaceByte` in
|
|
18
|
+
* `@ifc-lite/parser`'s `step-lexing.ts`): ASCII whitespace only, and an
|
|
19
|
+
* unterminated comment ends the scan with nothing found.
|
|
20
|
+
*
|
|
21
|
+
* The close is found from the END, the way the writers found it before: the
|
|
22
|
+
* last `)` that only trivia and one `;` follow. A forward scan would have to
|
|
23
|
+
* trust the record's string literals, and a record with an undoubled
|
|
24
|
+
* apostrophe would then have no frame at all, where it now has one whose
|
|
25
|
+
* argument list the slot splitter refuses and the caller reports as
|
|
26
|
+
* unreadable. The candidate found walking back is then checked forward, so a
|
|
27
|
+
* frame returned is always one the forward trivia rule agrees with.
|
|
28
|
+
*/
|
|
29
|
+
/** `#id=TYPE(`: everything a record's head says, as string offsets. */
|
|
30
|
+
export interface StepRecordHead {
|
|
31
|
+
/** The `=` after the instance name. */
|
|
32
|
+
readonly eq: number;
|
|
33
|
+
/** The type keyword, `typeStart..typeEnd`. */
|
|
34
|
+
readonly typeStart: number;
|
|
35
|
+
readonly typeEnd: number;
|
|
36
|
+
/** The `(` that opens the argument list. */
|
|
37
|
+
readonly open: number;
|
|
38
|
+
}
|
|
39
|
+
/** A whole record: its head, the `)` closing the argument list, and the `;`. */
|
|
40
|
+
export interface StepRecordFrame {
|
|
41
|
+
readonly head: StepRecordHead;
|
|
42
|
+
readonly close: number;
|
|
43
|
+
readonly semi: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* `#digits TRIVIA =`: the line declares an entity instance, whatever follows
|
|
47
|
+
* the `=`. Trivia, comments included, sits before the `=` as core's scanner
|
|
48
|
+
* reads it: `#48/* c */=(IFCA(..)IFCB(..));` is a record. A scanner indexes records {@link stepRecordHead} does not read (a
|
|
49
|
+
* complex instance `#N=(IFCA(..)IFCB(..));`, a non-ASCII character after the
|
|
50
|
+
* `=` or before the `(`), so a line that opens like this and has no frame is an
|
|
51
|
+
* UNREADABLE record, never "no record": an edit queued for it is reported, not
|
|
52
|
+
* passed over (#7682 review).
|
|
53
|
+
*/
|
|
54
|
+
export declare function opensStepRecord(text: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The record's head, or null when `text` does not open as
|
|
57
|
+
* `#digits = KEYWORD (`, trivia allowed around the `=` and before the `(`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function stepRecordHead(text: string): StepRecordHead | null;
|
|
60
|
+
/**
|
|
61
|
+
* The record's frame, or null when `text` is not one whole record:
|
|
62
|
+
* {@link stepRecordHead}, then a `)` that only trivia, one `;` and trivia follow.
|
|
63
|
+
*/
|
|
64
|
+
export declare function stepRecordFrame(text: string): StepRecordFrame | null;
|
|
65
|
+
/** The text between the argument list's parentheses. */
|
|
66
|
+
export declare function frameArgs(text: string, frame: StepRecordFrame): string;
|
|
67
|
+
/** `text` with its argument list replaced, every other character kept. */
|
|
68
|
+
export declare function withFrameArgs(text: string, frame: StepRecordFrame, args: string): string;
|
|
69
|
+
//# sourceMappingURL=step-record-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-record-frame.d.ts","sourceRoot":"","sources":["../src/step-record-frame.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASrD;AAMD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAiBlE;AAwCD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAIpE;AAED,wDAAwD;AACxD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAEtE;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAExF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
/** `is_step_space`: space, tab, LF, CR, vertical tab, form feed. */
|
|
5
|
+
function isStepSpace(code) {
|
|
6
|
+
return code === 0x20 || code === 0x09 || code === 0x0a || code === 0x0d || code === 0x0b || code === 0x0c;
|
|
7
|
+
}
|
|
8
|
+
/** `skip_step_trivia`: the first index at or after `i` that is not trivia, or -1 when a comment never closes. */
|
|
9
|
+
function skipTrivia(text, i) {
|
|
10
|
+
let p = i;
|
|
11
|
+
for (;;) {
|
|
12
|
+
while (p < text.length && isStepSpace(text.charCodeAt(p)))
|
|
13
|
+
p++;
|
|
14
|
+
if (!(text[p] === '/' && text[p + 1] === '*'))
|
|
15
|
+
return p;
|
|
16
|
+
const end = text.indexOf('*/', p + 2);
|
|
17
|
+
if (end === -1)
|
|
18
|
+
return -1;
|
|
19
|
+
p = end + 2;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `#digits TRIVIA =`: the line declares an entity instance, whatever follows
|
|
24
|
+
* the `=`. Trivia, comments included, sits before the `=` as core's scanner
|
|
25
|
+
* reads it: `#48/* c */=(IFCA(..)IFCB(..));` is a record. A scanner indexes records {@link stepRecordHead} does not read (a
|
|
26
|
+
* complex instance `#N=(IFCA(..)IFCB(..));`, a non-ASCII character after the
|
|
27
|
+
* `=` or before the `(`), so a line that opens like this and has no frame is an
|
|
28
|
+
* UNREADABLE record, never "no record": an edit queued for it is reported, not
|
|
29
|
+
* passed over (#7682 review).
|
|
30
|
+
*/
|
|
31
|
+
export function opensStepRecord(text) {
|
|
32
|
+
let i = skipTrivia(text, 0);
|
|
33
|
+
if (i === -1 || text[i] !== '#')
|
|
34
|
+
return false;
|
|
35
|
+
i++;
|
|
36
|
+
const digits = i;
|
|
37
|
+
while (i < text.length && text[i] >= '0' && text[i] <= '9')
|
|
38
|
+
i++;
|
|
39
|
+
if (i === digits)
|
|
40
|
+
return false;
|
|
41
|
+
const eq = skipTrivia(text, i);
|
|
42
|
+
return eq !== -1 && text[eq] === '=';
|
|
43
|
+
}
|
|
44
|
+
function isKeywordChar(c) {
|
|
45
|
+
return c !== undefined && /[A-Za-z0-9_]/.test(c);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The record's head, or null when `text` does not open as
|
|
49
|
+
* `#digits = KEYWORD (`, trivia allowed around the `=` and before the `(`.
|
|
50
|
+
*/
|
|
51
|
+
export function stepRecordHead(text) {
|
|
52
|
+
let i = skipTrivia(text, 0);
|
|
53
|
+
if (i === -1 || text[i] !== '#')
|
|
54
|
+
return null;
|
|
55
|
+
i++;
|
|
56
|
+
const digits = i;
|
|
57
|
+
while (i < text.length && text[i] >= '0' && text[i] <= '9')
|
|
58
|
+
i++;
|
|
59
|
+
if (i === digits)
|
|
60
|
+
return null;
|
|
61
|
+
const eq = skipTrivia(text, i);
|
|
62
|
+
if (eq === -1 || text[eq] !== '=')
|
|
63
|
+
return null;
|
|
64
|
+
const typeStart = skipTrivia(text, eq + 1);
|
|
65
|
+
if (typeStart === -1)
|
|
66
|
+
return null;
|
|
67
|
+
let typeEnd = typeStart;
|
|
68
|
+
while (isKeywordChar(text[typeEnd]))
|
|
69
|
+
typeEnd++;
|
|
70
|
+
if (typeEnd === typeStart)
|
|
71
|
+
return null;
|
|
72
|
+
const open = skipTrivia(text, typeEnd);
|
|
73
|
+
if (open === -1 || text[open] !== '(')
|
|
74
|
+
return null;
|
|
75
|
+
return { eq, typeStart, typeEnd, open };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Where a trailing comment that ends just before `end` (with `*/`) starts. A
|
|
79
|
+
* comment cannot hold `*/`, so it opens at one of the `/*` after the previous
|
|
80
|
+
* `*/`: the nearest one unless the comment itself holds a `/*`, else the first
|
|
81
|
+
* one unless a string in the record body holds a `*/` and a `/*`. Neither
|
|
82
|
+
* guess is trusted: {@link stepRecordFrame} tries both and keeps the one the
|
|
83
|
+
* forward check confirms.
|
|
84
|
+
*/
|
|
85
|
+
function commentStart(text, end, nearest) {
|
|
86
|
+
const body = text.slice(0, end);
|
|
87
|
+
if (nearest)
|
|
88
|
+
return body.lastIndexOf('/*');
|
|
89
|
+
const prev = body.lastIndexOf('*/');
|
|
90
|
+
const floor = prev === -1 ? 0 : prev + 2;
|
|
91
|
+
return body.indexOf('/*', floor);
|
|
92
|
+
}
|
|
93
|
+
/** Walk back over trivia ending just before `k`. */
|
|
94
|
+
function triviaBack(text, k, nearest) {
|
|
95
|
+
for (;;) {
|
|
96
|
+
while (k > 0 && isStepSpace(text.charCodeAt(k - 1)))
|
|
97
|
+
k--;
|
|
98
|
+
if (k < 4 || text[k - 2] !== '*' || text[k - 1] !== '/')
|
|
99
|
+
return k;
|
|
100
|
+
const start = commentStart(text, k - 2, nearest);
|
|
101
|
+
if (start === -1)
|
|
102
|
+
return k;
|
|
103
|
+
k = start;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function frameWith(text, head, nearest) {
|
|
107
|
+
const semi = triviaBack(text, text.length, nearest) - 1;
|
|
108
|
+
if (semi < 0 || text[semi] !== ';')
|
|
109
|
+
return null;
|
|
110
|
+
const close = triviaBack(text, semi, nearest) - 1;
|
|
111
|
+
if (close <= head.open || text[close] !== ')')
|
|
112
|
+
return null;
|
|
113
|
+
// The walk back is a guess about where the trailing comments begin; the
|
|
114
|
+
// forward trivia rule is what decides it.
|
|
115
|
+
const verified = skipTrivia(text, close + 1) === semi && skipTrivia(text, semi + 1) === text.length;
|
|
116
|
+
return verified ? { head, close, semi } : null;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The record's frame, or null when `text` is not one whole record:
|
|
120
|
+
* {@link stepRecordHead}, then a `)` that only trivia, one `;` and trivia follow.
|
|
121
|
+
*/
|
|
122
|
+
export function stepRecordFrame(text) {
|
|
123
|
+
const head = stepRecordHead(text);
|
|
124
|
+
if (head === null)
|
|
125
|
+
return null;
|
|
126
|
+
return frameWith(text, head, true) ?? frameWith(text, head, false);
|
|
127
|
+
}
|
|
128
|
+
/** The text between the argument list's parentheses. */
|
|
129
|
+
export function frameArgs(text, frame) {
|
|
130
|
+
return text.slice(frame.head.open + 1, frame.close);
|
|
131
|
+
}
|
|
132
|
+
/** `text` with its argument list replaced, every other character kept. */
|
|
133
|
+
export function withFrameArgs(text, frame, args) {
|
|
134
|
+
return `${text.slice(0, frame.head.open + 1)}${args}${text.slice(frame.close)}`;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=step-record-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-record-frame.js","sourceRoot":"","sources":["../src/step-record-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiD/D,oEAAoE;AACpE,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC;AAC5G,CAAC;AAED,iHAAiH;AACjH,SAAS,UAAU,CAAC,IAAY,EAAE,CAAS;IACzC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,SAAS,C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AC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;AAClF,CAAC"}
|
package/dist/step-ref-scan.d.ts
CHANGED
|
@@ -3,4 +3,12 @@
|
|
|
3
3
|
* Short-circuits rather than collecting every reference the text contains.
|
|
4
4
|
*/
|
|
5
5
|
export declare function referencesAnyExpressId(attrsRaw: string, ids: ReadonlySet<number>): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Byte twin of `stepStringLiteralEnd` (`@ifc-lite/encoding`) for walkers that
|
|
8
|
+
* scan a source buffer without decoding it (#7589): the index just past the
|
|
9
|
+
* apostrophe closing the literal that opens at `open`, or `-1` when it does not
|
|
10
|
+
* close before `end`. Same rule, tested in the same order: a `\S\` PAGE
|
|
11
|
+
* operand is text, then `''` is an escaped quote.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stepBytesLiteralEnd(bytes: Uint8Array, open: number, end: number): number;
|
|
6
14
|
//# sourceMappingURL=step-ref-scan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-ref-scan.d.ts","sourceRoot":"","sources":["../src/step-ref-scan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step-ref-scan.d.ts","sourceRoot":"","sources":["../src/step-ref-scan.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CA2B1F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQxF"}
|
package/dist/step-ref-scan.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* caller only ever asks "does this record touch one of these ids", never
|
|
13
13
|
* which slot.
|
|
14
14
|
*/
|
|
15
|
+
import { stepStringLiteralEnd } from '@ifc-lite/encoding';
|
|
15
16
|
import { skipStepComment } from './step-comment-skip.js';
|
|
16
17
|
/**
|
|
17
18
|
* True as soon as any `#id` found in `attrsRaw` is a member of `ids`.
|
|
@@ -20,22 +21,21 @@ import { skipStepComment } from './step-comment-skip.js';
|
|
|
20
21
|
export function referencesAnyExpressId(attrsRaw, ids) {
|
|
21
22
|
if (ids.size === 0)
|
|
22
23
|
return false;
|
|
23
|
-
let inString = false;
|
|
24
24
|
for (let i = 0; i < attrsRaw.length; i++) {
|
|
25
25
|
const ch = attrsRaw[i];
|
|
26
|
-
if (
|
|
26
|
+
if (ch === '/' && attrsRaw[i + 1] === '*') {
|
|
27
27
|
i = skipStepComment(attrsRaw, i) - 1;
|
|
28
28
|
continue;
|
|
29
29
|
}
|
|
30
30
|
if (ch === '\'') {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
// The shared rule for where a literal ends (#7589); unterminated: the rest.
|
|
32
|
+
const end = stepStringLiteralEnd(attrsRaw, i);
|
|
33
|
+
if (end === -1)
|
|
34
|
+
return false;
|
|
35
|
+
i = end - 1;
|
|
36
36
|
continue;
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
38
|
+
if (ch === '#') {
|
|
39
39
|
let j = i + 1;
|
|
40
40
|
let digits = '';
|
|
41
41
|
while (j < attrsRaw.length && attrsRaw[j] >= '0' && attrsRaw[j] <= '9') {
|
|
@@ -49,4 +49,25 @@ export function referencesAnyExpressId(attrsRaw, ids) {
|
|
|
49
49
|
}
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Byte twin of `stepStringLiteralEnd` (`@ifc-lite/encoding`) for walkers that
|
|
54
|
+
* scan a source buffer without decoding it (#7589): the index just past the
|
|
55
|
+
* apostrophe closing the literal that opens at `open`, or `-1` when it does not
|
|
56
|
+
* close before `end`. Same rule, tested in the same order: a `\S\` PAGE
|
|
57
|
+
* operand is text, then `''` is an escaped quote.
|
|
58
|
+
*/
|
|
59
|
+
export function stepBytesLiteralEnd(bytes, open, end) {
|
|
60
|
+
for (let p = open + 1; p < end; p++) {
|
|
61
|
+
if (bytes[p] !== 0x27)
|
|
62
|
+
continue;
|
|
63
|
+
if (p >= 3 && bytes[p - 1] === 0x5c && bytes[p - 2] === 0x53 && bytes[p - 3] === 0x5c)
|
|
64
|
+
continue;
|
|
65
|
+
if (p + 1 < end && bytes[p + 1] === 0x27) {
|
|
66
|
+
p++;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
return p + 1;
|
|
70
|
+
}
|
|
71
|
+
return -1;
|
|
72
|
+
}
|
|
52
73
|
//# sourceMappingURL=step-ref-scan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-ref-scan.js","sourceRoot":"","sources":["../src/step-ref-scan.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB,EAAE,GAAwB;IAC/E,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACjC,
|
|
1
|
+
{"version":3,"file":"step-ref-scan.js","sourceRoot":"","sources":["../src/step-ref-scan.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;GAUG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB,EAAE,GAAwB;IAC/E,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACjC,KAAK,IA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