@primmel/primmel 1.17.1 → 1.18.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/src/check.d.ts.map +1 -1
- package/dist/src/check.js +6 -3
- package/dist/src/check.js.map +1 -1
- package/dist/src/ser-des/config/evaluationProfile.d.ts.map +1 -1
- package/dist/src/ser-des/config/evaluationProfile.js +15 -3
- package/dist/src/ser-des/config/evaluationProfile.js.map +1 -1
- package/dist/src/ser-des/config/note.d.ts.map +1 -1
- package/dist/src/ser-des/config/note.js +25 -1
- package/dist/src/ser-des/config/note.js.map +1 -1
- package/dist/src/types/EvaluationProfile.d.ts +5 -3
- package/dist/src/types/EvaluationProfile.d.ts.map +1 -1
- package/dist/src/types/EvaluationProfile.js +14 -4
- package/dist/src/types/EvaluationProfile.js.map +1 -1
- package/dist/src/types/Note.d.ts +8 -0
- package/dist/src/types/Note.d.ts.map +1 -1
- package/dist-browser/index.mjs +22 -10
- package/dist-cli/primmel.mjs +27 -8
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluationProfile.d.ts","sourceRoot":"","sources":["../../../../src/ser-des/config/evaluationProfile.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQ/C,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAE9D,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"evaluationProfile.d.ts","sourceRoot":"","sources":["../../../../src/ser-des/config/evaluationProfile.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQ/C,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAE9D,eAAO,MAAM,sBAAsB,EAAE,MAoCpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,iBAAiB,CAsB3D,CAAC"}
|
|
@@ -16,11 +16,17 @@ const parseEvaluationProfile = (id, data) => {
|
|
|
16
16
|
const profile = { id, dimensions: {}, description: '' };
|
|
17
17
|
(0, parse_block_1.forEachEntry)(data, (keyword, value) => {
|
|
18
18
|
if (keyword === 'dimensions') {
|
|
19
|
-
// The open dimension-keyed map: alternating key/value tokens.
|
|
19
|
+
// The open dimension-keyed map: alternating key/value tokens. A
|
|
20
|
+
// set-cardinality dimension presets to a value LIST — the value
|
|
21
|
+
// arrives as one balanced `{ … }` token (the tokenizer's block
|
|
22
|
+
// rule); a scalar stays a single token.
|
|
20
23
|
const t = (0, tokenize_1.default)((0, tokenize_1.unwrapBlock)(value()));
|
|
21
24
|
for (let i = 0; i + 1 < t.length; i += 2) {
|
|
22
25
|
const k = (0, tokenize_1.stripWrapping)((0, field_parser_1.stripColon)(t[i]));
|
|
23
|
-
const
|
|
26
|
+
const raw = t[i + 1];
|
|
27
|
+
const v = raw.startsWith('{')
|
|
28
|
+
? (0, tokenize_1.default)((0, tokenize_1.unwrapBlock)(raw)).map(tok => (0, tokenize_1.stripWrapping)(tok))
|
|
29
|
+
: (0, tokenize_1.stripWrapping)(raw);
|
|
24
30
|
if (k) {
|
|
25
31
|
profile.dimensions[k] = v;
|
|
26
32
|
}
|
|
@@ -47,7 +53,13 @@ const dumpEvaluationProfile = function (p) {
|
|
|
47
53
|
out +=
|
|
48
54
|
' dimensions { ' +
|
|
49
55
|
keys
|
|
50
|
-
.map(k =>
|
|
56
|
+
.map(k => {
|
|
57
|
+
const v = p.dimensions[k];
|
|
58
|
+
// Set-cardinality presets dump as a value list (`{ co no }`).
|
|
59
|
+
return Array.isArray(v)
|
|
60
|
+
? (0, field_parser_1.dumpBareSafe)(k) + ' { ' + v.map(field_parser_1.dumpBareSafe).join(' ') + ' }'
|
|
61
|
+
: (0, field_parser_1.dumpBareSafe)(k) + ' ' + (0, field_parser_1.dumpBareSafe)(v);
|
|
62
|
+
})
|
|
51
63
|
.join(' ') +
|
|
52
64
|
' }\n';
|
|
53
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluationProfile.js","sourceRoot":"","sources":["../../../../src/ser-des/config/evaluationProfile.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,qEAAqE;AACrE,6DAA6D;AAC7D,iEAAiE;AACjE,qEAAqE;AACrE,kEAAkE;AAClE,SAAS;AACT,wEAAwE;;;AAGxE,0CAIqB;AACrB,gDAA8C;AAC9C,iDAA0D;AAGnD,MAAM,sBAAsB,GAAW,CAAC,EAAU,EAAE,IAAY,EAAE,EAAE;IACzE,MAAM,OAAO,GAAsB,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAE3E,IAAA,0BAAY,EACV,IAAI,EACJ,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACjB,IAAI,OAAO,KAAK,YAAY,EAAE,CAAC;YAC7B,
|
|
1
|
+
{"version":3,"file":"evaluationProfile.js","sourceRoot":"","sources":["../../../../src/ser-des/config/evaluationProfile.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,qEAAqE;AACrE,6DAA6D;AAC7D,iEAAiE;AACjE,qEAAqE;AACrE,kEAAkE;AAClE,SAAS;AACT,wEAAwE;;;AAGxE,0CAIqB;AACrB,gDAA8C;AAC9C,iDAA0D;AAGnD,MAAM,sBAAsB,GAAW,CAAC,EAAU,EAAE,IAAY,EAAE,EAAE;IACzE,MAAM,OAAO,GAAsB,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAE3E,IAAA,0BAAY,EACV,IAAI,EACJ,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACjB,IAAI,OAAO,KAAK,YAAY,EAAE,CAAC;YAC7B,gEAAgE;YAChE,gEAAgE;YAChE,+DAA+D;YAC/D,wCAAwC;YACxC,MAAM,CAAC,GAAG,IAAA,kBAAQ,EAAC,IAA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"file":"note.d.ts","sourceRoot":"","sources":["../../../../src/ser-des/config/note.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAazD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAavD,eAAO,MAAM,SAAS,EAAE,MA2DvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAYtD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,IAAI,CAoBjC,CAAC"}
|
|
@@ -4,6 +4,8 @@ exports.dumpNote = exports.resolveNote = exports.parseNote = void 0;
|
|
|
4
4
|
const tokenize_1 = require("../tokenize");
|
|
5
5
|
const parse_block_1 = require("../parse-block");
|
|
6
6
|
const sourceDiscrepancy_1 = require("./sourceDiscrepancy");
|
|
7
|
+
const field_parser_1 = require("./field-parser");
|
|
8
|
+
const ref_1 = require("./ref");
|
|
7
9
|
const resolve_1 = require("../resolve");
|
|
8
10
|
// EXAMPLE is the legacy (MMEL v2) note type — the corpus carries it.
|
|
9
11
|
const VALID_NOTE_TYPES = [
|
|
@@ -19,12 +21,13 @@ const parseNote = function (id, data) {
|
|
|
19
21
|
type: 'NOTE',
|
|
20
22
|
message: '',
|
|
21
23
|
sourceDiscrepancy: null,
|
|
24
|
+
source: null,
|
|
22
25
|
ref: [],
|
|
23
26
|
_relations: {
|
|
24
27
|
ref: [],
|
|
25
28
|
},
|
|
26
29
|
};
|
|
27
|
-
(0, parse_block_1.forEachEntry)(data, (command, value) => {
|
|
30
|
+
(0, parse_block_1.forEachEntry)(data, (command, value, peek) => {
|
|
28
31
|
if (command === 'type') {
|
|
29
32
|
const v = value();
|
|
30
33
|
if (!VALID_NOTE_TYPES.includes(v)) {
|
|
@@ -38,9 +41,26 @@ const parseNote = function (id, data) {
|
|
|
38
41
|
else if (command === 'source_discrepancy') {
|
|
39
42
|
result.sourceDiscrepancy = (0, sourceDiscrepancy_1.parseSourceDiscrepancy)((0, tokenize_1.unwrapBlock)(value()));
|
|
40
43
|
}
|
|
44
|
+
else if (command === 'source') {
|
|
45
|
+
// The clause-site provenance (the requirement idiom): repeated
|
|
46
|
+
// blocks collect into sourceRefs; source mirrors the first.
|
|
47
|
+
const src = (0, field_parser_1.readSource)((0, tokenize_1.unwrapBlock)(value()));
|
|
48
|
+
if (!result.source) {
|
|
49
|
+
result.source = src;
|
|
50
|
+
}
|
|
51
|
+
(result.sourceRefs ??= []).push(src);
|
|
52
|
+
}
|
|
41
53
|
else if (command === 'reference') {
|
|
54
|
+
// The bibliographic citation channel (the references-collection
|
|
55
|
+
// id list — resolveNote resolves each), never provenance.
|
|
42
56
|
result._relations.ref = (0, tokenize_1.tokenizePackage)(value());
|
|
43
57
|
}
|
|
58
|
+
else if (command === 'ref') {
|
|
59
|
+
// The unified typed reference (spec: docs/primmel/18) — a
|
|
60
|
+
// URN-anchored derives-from folds into the provenance facet.
|
|
61
|
+
const r = (0, ref_1.parseRefFromReaders)(value, peek, tokenize_1.stripWrapping, tokenize_1.unwrapBlock);
|
|
62
|
+
(0, ref_1.foldRefIntoLegacy)(result, r);
|
|
63
|
+
}
|
|
44
64
|
else {
|
|
45
65
|
return false;
|
|
46
66
|
}
|
|
@@ -70,6 +90,10 @@ const dumpNote = function (n) {
|
|
|
70
90
|
if (n.sourceDiscrepancy) {
|
|
71
91
|
out += (0, sourceDiscrepancy_1.dumpSourceDiscrepancy)(n.sourceDiscrepancy, ' ') + '\n';
|
|
72
92
|
}
|
|
93
|
+
for (const src of n.sourceRefs ??
|
|
94
|
+
(n.source && (n.source.doc || n.source.clause) ? [n.source] : [])) {
|
|
95
|
+
out += (0, ref_1.dumpSourceRefAsRef)(src, ' ', tokenize_1.escapeString);
|
|
96
|
+
}
|
|
73
97
|
if (n.ref.length > 0) {
|
|
74
98
|
out += ' reference {\n';
|
|
75
99
|
for (const r of n.ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../../../src/ser-des/config/note.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../../../src/ser-des/config/note.ts"],"names":[],"mappings":";;;AACA,0CAAwF;AACxF,gDAAyD;AACzD,2DAG6B;AAC7B,iDAA4C;AAC5C,+BAIe;AAKf,wCAAgD;AAEhD,qEAAqE;AACrE,MAAM,gBAAgB,GAAe;IACnC,MAAM;IACN,SAAS;IACT,SAAS;IACT,SAAS;IACT,YAAY;CACb,CAAC;AAEK,MAAM,SAAS,GAAW,UAAU,EAAE,EAAE,IAAI;IACjD,MAAM,MAAM,GAAmB;QAC7B,EAAE,EAAE,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,EAAE;QACX,iBAAiB,EAAE,IAAI;QACvB,MAAM,EAAE,IAAI;QACZ,GAAG,EAAE,EAAE;QACP,UAAU,EAAE;YACV,GAAG,EAAE,EAAE;SACR;KACF,CAAC;IAEF,IAAA,0BAAY,EACV,IAAI,EACJ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACvB,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,KAAK,EAAc,CAAC;YAC9B,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CACb,2BAA2B,EAAE,kBAAkB,CAAC,YAAY,gBAAgB,CAAC,IAAI,CAC/E,IAAI,CACL,GAAG,CACL,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;QAClB,CAAC;aAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,CAAC,OAAO,GAAG,IAAA,uBAAS,EAAC,KAAK,CAAC,CAAC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uBAAY,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,GAAG,IAAI,iBAAiB,CAAC;QACzB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;YACtB,GAAG,IAAI,MAAM,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC;QAC9B,CAAC;QACD,GAAG,IAAI,OAAO,CAAC;IACjB,CAAC;IACD,GAAG,IAAI,KAAK,CAAC;IACb,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AApBW,QAAA,QAAQ,YAoBnB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export default interface EvaluationProfile {
|
|
2
2
|
/** Kebab-case profile id (class-a-digital-nh). */
|
|
3
3
|
id: string;
|
|
4
|
-
/** The dimension-value preset: dimension id → value id,
|
|
5
|
-
*
|
|
6
|
-
|
|
4
|
+
/** The dimension-value preset: dimension id → value id, or value-id
|
|
5
|
+
* list for a set-cardinality dimension (r144's measurand_components),
|
|
6
|
+
* in declared order (the byte contract keys dimension ids before
|
|
7
|
+
* description). */
|
|
8
|
+
dimensions: Record<string, string | string[]>;
|
|
7
9
|
/** What the profile selects. */
|
|
8
10
|
description: string;
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvaluationProfile.d.ts","sourceRoot":"","sources":["../../../src/types/EvaluationProfile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EvaluationProfile.d.ts","sourceRoot":"","sources":["../../../src/types/EvaluationProfile.ts"],"names":[],"mappings":"AAiCA,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX;;;wBAGoB;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC9C,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -10,16 +10,26 @@
|
|
|
10
10
|
// description "Class A digital, no humidity test"
|
|
11
11
|
// }
|
|
12
12
|
//
|
|
13
|
+
// A SET-cardinality dimension presets to a value LIST (r144's
|
|
14
|
+
// measurand_components — the extractive-co-nox preset selects several
|
|
15
|
+
// channels at once):
|
|
16
|
+
//
|
|
17
|
+
// evaluation_profile extractive-co-nox-ndir-cld {
|
|
18
|
+
// dimensions { measurand_components { co no } measuring_principle combined }
|
|
19
|
+
// description "Extractive CEMS: NDIR for CO + chemiluminescence for NOx"
|
|
20
|
+
// }
|
|
21
|
+
//
|
|
13
22
|
// The dimensions map keys on DIMENSION ids (profiles select over
|
|
14
23
|
// dimensions) — NOT the evaluation-dimension FIELD names (r60: profile
|
|
15
24
|
// key humidity_class vs field name humidity_symbol); the two namespaces
|
|
16
|
-
// never mix. Optional per package: r91
|
|
25
|
+
// never mix. Optional per package: r91 declares none, and no
|
|
17
26
|
// empty-register requirement exists.
|
|
18
27
|
//
|
|
19
28
|
// C135 evaluation-profile-coherence: every dimensions key resolves to a
|
|
20
|
-
// declared classification dimension and every value
|
|
21
|
-
// dimension's declared values (per-register gated; an
|
|
22
|
-
// accepts any value) — the smart R4/R8 applicability
|
|
29
|
+
// declared classification dimension and every value (each list entry)
|
|
30
|
+
// to one of that dimension's declared values (per-register gated; an
|
|
31
|
+
// OPEN dimension accepts any value) — the smart R4/R8 applicability
|
|
32
|
+
// mirror.
|
|
23
33
|
// ─────────────────────────────────────────────────────────────────────
|
|
24
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
35
|
//# sourceMappingURL=EvaluationProfile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvaluationProfile.js","sourceRoot":"","sources":["../../../src/types/EvaluationProfile.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,6DAA6D;AAC7D,wEAAwE;AACxE,gEAAgE;AAChE,4DAA4D;AAC5D,EAAE;AACF,4CAA4C;AAC5C,2EAA2E;AAC3E,sDAAsD;AACtD,MAAM;AACN,EAAE;AACF,iEAAiE;AACjE,uEAAuE;AACvE,wEAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"EvaluationProfile.js","sourceRoot":"","sources":["../../../src/types/EvaluationProfile.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,6DAA6D;AAC7D,wEAAwE;AACxE,gEAAgE;AAChE,4DAA4D;AAC5D,EAAE;AACF,4CAA4C;AAC5C,2EAA2E;AAC3E,sDAAsD;AACtD,MAAM;AACN,EAAE;AACF,8DAA8D;AAC9D,sEAAsE;AACtE,qBAAqB;AACrB,EAAE;AACF,oDAAoD;AACpD,iFAAiF;AACjF,6EAA6E;AAC7E,MAAM;AACN,EAAE;AACF,iEAAiE;AACjE,uEAAuE;AACvE,wEAAwE;AACxE,6DAA6D;AAC7D,qCAAqC;AACrC,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,qEAAqE;AACrE,oEAAoE;AACpE,UAAU;AACV,wEAAwE"}
|
package/dist/src/types/Note.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Reference from './Reference';
|
|
2
2
|
import Resolvable from './Resolvable';
|
|
3
3
|
import type SourceDiscrepancy from './SourceDiscrepancy';
|
|
4
|
+
import type { SourceRef } from './Subject';
|
|
4
5
|
export type NoteType = 'NOTE' | 'CAUTION' | 'WARNING' | 'EXAMPLE' | 'COMMENTARY';
|
|
5
6
|
interface Note {
|
|
6
7
|
id: string;
|
|
@@ -8,6 +9,13 @@ interface Note {
|
|
|
8
9
|
message: string;
|
|
9
10
|
/** Source-discrepancy annotation attached to this note. */
|
|
10
11
|
sourceDiscrepancy?: SourceDiscrepancy | null;
|
|
12
|
+
/** The clause-site provenance (the requirement idiom: the singular
|
|
13
|
+
mirror of the first source block, the canonical
|
|
14
|
+
`ref derives-from "<urn>#clause-<n>"` spelling on dump). */
|
|
15
|
+
source?: SourceRef | null;
|
|
16
|
+
/** Every provenance block in document order (the first mirrors
|
|
17
|
+
`source`). */
|
|
18
|
+
sourceRefs?: SourceRef[];
|
|
11
19
|
ref: Reference[];
|
|
12
20
|
}
|
|
13
21
|
export default Note;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Note.d.ts","sourceRoot":"","sources":["../../../src/types/Note.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Note.d.ts","sourceRoot":"","sources":["../../../src/types/Note.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,QAAQ,GAClB,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC;AAE5D,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC7C;;mEAE+D;IAC/D,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;qBACiB;IACjB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,GAAG,EAAE,SAAS,EAAE,CAAC;CAClB;AAED,eAAe,IAAI,CAAC;AAEpB,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC"}
|
package/dist-browser/index.mjs
CHANGED
|
@@ -2838,18 +2838,25 @@ var Mn = [
|
|
|
2838
2838
|
type: "NOTE",
|
|
2839
2839
|
message: "",
|
|
2840
2840
|
sourceDiscrepancy: null,
|
|
2841
|
+
source: null,
|
|
2841
2842
|
ref: [],
|
|
2842
2843
|
_relations: { ref: [] }
|
|
2843
2844
|
};
|
|
2844
|
-
return v(t, (t,
|
|
2845
|
+
return v(t, (t, o, s) => {
|
|
2845
2846
|
if (t === "type") {
|
|
2846
|
-
let t =
|
|
2847
|
+
let t = o();
|
|
2847
2848
|
if (!Mn.includes(t)) throw Error(`Parsing error: note. ID ${e}: Unknown type ${t} (valid: ${Mn.join(", ")})`);
|
|
2848
2849
|
n.type = t;
|
|
2849
|
-
} else if (t === "message") n.message = x(
|
|
2850
|
-
else if (t === "source_discrepancy") n.sourceDiscrepancy = A(i(
|
|
2851
|
-
else if (t === "
|
|
2852
|
-
|
|
2850
|
+
} else if (t === "message") n.message = x(o);
|
|
2851
|
+
else if (t === "source_discrepancy") n.sourceDiscrepancy = A(i(o()));
|
|
2852
|
+
else if (t === "source") {
|
|
2853
|
+
let e = I(i(o()));
|
|
2854
|
+
n.source ||= e, (n.sourceRefs ??= []).push(e);
|
|
2855
|
+
} else if (t === "reference") n._relations.ref = r(o());
|
|
2856
|
+
else if (t === "ref") {
|
|
2857
|
+
let e = C(o, s, a, i);
|
|
2858
|
+
T(n, e);
|
|
2859
|
+
} else return !1;
|
|
2853
2860
|
return !0;
|
|
2854
2861
|
}, {
|
|
2855
2862
|
construct: "note",
|
|
@@ -2867,7 +2874,9 @@ var Mn = [
|
|
|
2867
2874
|
};
|
|
2868
2875
|
}, Fn = function(e) {
|
|
2869
2876
|
let t = "note " + e.id + " {\n";
|
|
2870
|
-
|
|
2877
|
+
t += " type " + e.type + "\n", t += " message \"" + s(e.message) + "\"\n", e.sourceDiscrepancy && (t += j(e.sourceDiscrepancy, " ") + "\n");
|
|
2878
|
+
for (let n of e.sourceRefs ?? (e.source && (e.source.doc || e.source.clause) ? [e.source] : [])) t += E(n, " ", s);
|
|
2879
|
+
if (e.ref.length > 0) {
|
|
2871
2880
|
t += " reference {\n";
|
|
2872
2881
|
for (let n of e.ref) t += " " + n.id + "\n";
|
|
2873
2882
|
t += " }\n";
|
|
@@ -7687,8 +7696,8 @@ var ss = {
|
|
|
7687
7696
|
if (e === "dimensions") {
|
|
7688
7697
|
let e = n(i(t()));
|
|
7689
7698
|
for (let t = 0; t + 1 < e.length; t += 2) {
|
|
7690
|
-
let
|
|
7691
|
-
|
|
7699
|
+
let o = a(P(e[t])), s = e[t + 1], c = s.startsWith("{") ? n(i(s)).map((e) => a(e)) : a(s);
|
|
7700
|
+
o && (r.dimensions[o] = c);
|
|
7692
7701
|
}
|
|
7693
7702
|
} else if (e === "description") r.description = a(t());
|
|
7694
7703
|
else return !1;
|
|
@@ -7699,7 +7708,10 @@ var ss = {
|
|
|
7699
7708
|
}), (t) => (t.evaluationProfiles[e] = r, t);
|
|
7700
7709
|
}, Ds = function(e) {
|
|
7701
7710
|
let t = "evaluation_profile " + N(e.id) + " {\n", n = Object.keys(e.dimensions);
|
|
7702
|
-
return n.length > 0 && (t += " dimensions { " + n.map((t) =>
|
|
7711
|
+
return n.length > 0 && (t += " dimensions { " + n.map((t) => {
|
|
7712
|
+
let n = e.dimensions[t];
|
|
7713
|
+
return Array.isArray(n) ? N(t) + " { " + n.map(N).join(" ") + " }" : N(t) + " " + N(n);
|
|
7714
|
+
}).join(" ") + " }\n"), e.description && (t += " description \"" + s(e.description) + "\"\n"), t += "}\n", t;
|
|
7703
7715
|
}, Os = ["mandatory", "optional"];
|
|
7704
7716
|
function ks(e) {
|
|
7705
7717
|
return n(a(e)).map(P).map(a).filter((e) => e.length > 0);
|
package/dist-cli/primmel.mjs
CHANGED
|
@@ -5255,6 +5255,7 @@ var parseNote = function(id, data) {
|
|
|
5255
5255
|
type: "NOTE",
|
|
5256
5256
|
message: "",
|
|
5257
5257
|
sourceDiscrepancy: null,
|
|
5258
|
+
source: null,
|
|
5258
5259
|
ref: [],
|
|
5259
5260
|
_relations: {
|
|
5260
5261
|
ref: []
|
|
@@ -5262,7 +5263,7 @@ var parseNote = function(id, data) {
|
|
|
5262
5263
|
};
|
|
5263
5264
|
forEachEntry(
|
|
5264
5265
|
data,
|
|
5265
|
-
(command, value) => {
|
|
5266
|
+
(command, value, peek) => {
|
|
5266
5267
|
if (command === "type") {
|
|
5267
5268
|
const v = value();
|
|
5268
5269
|
if (!VALID_NOTE_TYPES.includes(v)) {
|
|
@@ -5277,8 +5278,17 @@ var parseNote = function(id, data) {
|
|
|
5277
5278
|
result.message = unwrapped(value);
|
|
5278
5279
|
} else if (command === "source_discrepancy") {
|
|
5279
5280
|
result.sourceDiscrepancy = parseSourceDiscrepancy(unwrapBlock(value()));
|
|
5281
|
+
} else if (command === "source") {
|
|
5282
|
+
const src = readSource(unwrapBlock(value()));
|
|
5283
|
+
if (!result.source) {
|
|
5284
|
+
result.source = src;
|
|
5285
|
+
}
|
|
5286
|
+
(result.sourceRefs ??= []).push(src);
|
|
5280
5287
|
} else if (command === "reference") {
|
|
5281
5288
|
result._relations.ref = tokenizePackage(value());
|
|
5289
|
+
} else if (command === "ref") {
|
|
5290
|
+
const r = parseRefFromReaders(value, peek, stripWrapping, unwrapBlock);
|
|
5291
|
+
foldRefIntoLegacy(result, r);
|
|
5282
5292
|
} else {
|
|
5283
5293
|
return false;
|
|
5284
5294
|
}
|
|
@@ -5308,6 +5318,9 @@ var dumpNote = function(n) {
|
|
|
5308
5318
|
if (n.sourceDiscrepancy) {
|
|
5309
5319
|
out += dumpSourceDiscrepancy(n.sourceDiscrepancy, " ") + "\n";
|
|
5310
5320
|
}
|
|
5321
|
+
for (const src of n.sourceRefs ?? (n.source && (n.source.doc || n.source.clause) ? [n.source] : [])) {
|
|
5322
|
+
out += dumpSourceRefAsRef(src, " ", escapeString);
|
|
5323
|
+
}
|
|
5311
5324
|
if (n.ref.length > 0) {
|
|
5312
5325
|
out += " reference {\n";
|
|
5313
5326
|
for (const r of n.ref) {
|
|
@@ -14759,7 +14772,8 @@ var parseEvaluationProfile = (id, data) => {
|
|
|
14759
14772
|
const t = tokenize(unwrapBlock(value()));
|
|
14760
14773
|
for (let i = 0; i + 1 < t.length; i += 2) {
|
|
14761
14774
|
const k = stripWrapping(stripColon(t[i]));
|
|
14762
|
-
const
|
|
14775
|
+
const raw = t[i + 1];
|
|
14776
|
+
const v = raw.startsWith("{") ? tokenize(unwrapBlock(raw)).map((tok) => stripWrapping(tok)) : stripWrapping(raw);
|
|
14763
14777
|
if (k) {
|
|
14764
14778
|
profile.dimensions[k] = v;
|
|
14765
14779
|
}
|
|
@@ -14782,7 +14796,10 @@ var dumpEvaluationProfile = function(p) {
|
|
|
14782
14796
|
let out = "evaluation_profile " + dumpBareSafe(p.id) + " {\n";
|
|
14783
14797
|
const keys = Object.keys(p.dimensions);
|
|
14784
14798
|
if (keys.length > 0) {
|
|
14785
|
-
out += " dimensions { " + keys.map((k) =>
|
|
14799
|
+
out += " dimensions { " + keys.map((k) => {
|
|
14800
|
+
const v = p.dimensions[k];
|
|
14801
|
+
return Array.isArray(v) ? dumpBareSafe(k) + " { " + v.map(dumpBareSafe).join(" ") + " }" : dumpBareSafe(k) + " " + dumpBareSafe(v);
|
|
14802
|
+
}).join(" ") + " }\n";
|
|
14786
14803
|
}
|
|
14787
14804
|
if (p.description) {
|
|
14788
14805
|
out += ' description "' + escapeString(p.description) + '"\n';
|
|
@@ -27478,11 +27495,13 @@ function checkPackage(dir, options = {}) {
|
|
|
27478
27495
|
continue;
|
|
27479
27496
|
}
|
|
27480
27497
|
const values = dimIds.get(dim);
|
|
27481
|
-
|
|
27482
|
-
|
|
27483
|
-
|
|
27484
|
-
|
|
27485
|
-
|
|
27498
|
+
for (const v of Array.isArray(value) ? value : [value]) {
|
|
27499
|
+
if (values && values.size > 0 && !values.has(v)) {
|
|
27500
|
+
err(
|
|
27501
|
+
"C135",
|
|
27502
|
+
`${where}: dimensions entry "${dim}" names value "${v}", which the dimension does not declare (evaluation-profile-coherence)`
|
|
27503
|
+
);
|
|
27504
|
+
}
|
|
27486
27505
|
}
|
|
27487
27506
|
}
|
|
27488
27507
|
}
|
package/package.json
CHANGED