@pubid/pubid 0.1.3 → 0.1.4
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/artifact/corpus.json.gz +0 -0
- package/dist/conformance/cli.js +5 -1
- package/dist/flavors/amca/grammar.d.ts +4 -0
- package/dist/flavors/amca/grammar.js +87 -0
- package/dist/flavors/amca/index.d.ts +4 -0
- package/dist/flavors/amca/index.js +76 -0
- package/dist/flavors/amca/model.d.ts +29 -0
- package/dist/flavors/amca/model.js +146 -0
- package/dist/flavors/ansi/index.d.ts +24 -0
- package/dist/flavors/ansi/index.js +147 -0
- package/dist/flavors/api/grammar.d.ts +4 -0
- package/dist/flavors/api/grammar.js +79 -0
- package/dist/flavors/api/index.d.ts +4 -0
- package/dist/flavors/api/index.js +71 -0
- package/dist/flavors/api/model.d.ts +27 -0
- package/dist/flavors/api/model.js +114 -0
- package/dist/flavors/ashrae/grammar.d.ts +2 -0
- package/dist/flavors/ashrae/grammar.js +667 -0
- package/dist/flavors/ashrae/index.d.ts +4 -0
- package/dist/flavors/ashrae/index.js +306 -0
- package/dist/flavors/ashrae/model.d.ts +87 -0
- package/dist/flavors/ashrae/model.js +335 -0
- package/dist/flavors/ashrae/preprocessor.d.ts +7 -0
- package/dist/flavors/ashrae/preprocessor.js +44 -0
- package/dist/flavors/asme/grammar.d.ts +2 -0
- package/dist/flavors/asme/grammar.js +200 -0
- package/dist/flavors/asme/index.d.ts +4 -0
- package/dist/flavors/asme/index.js +138 -0
- package/dist/flavors/asme/model.d.ts +34 -0
- package/dist/flavors/asme/model.js +123 -0
- package/dist/flavors/astm/grammar.d.ts +2 -0
- package/dist/flavors/astm/grammar.js +110 -0
- package/dist/flavors/astm/index.d.ts +2 -0
- package/dist/flavors/astm/index.js +127 -0
- package/dist/flavors/astm/model.d.ts +42 -0
- package/dist/flavors/astm/model.js +263 -0
- package/dist/flavors/bipm/index.d.ts +30 -0
- package/dist/flavors/bipm/index.js +434 -0
- package/dist/flavors/bsi/grammar.d.ts +4 -0
- package/dist/flavors/bsi/grammar.js +535 -0
- package/dist/flavors/bsi/index.d.ts +4 -0
- package/dist/flavors/bsi/index.js +941 -0
- package/dist/flavors/bsi/model.d.ts +127 -0
- package/dist/flavors/bsi/model.js +863 -0
- package/dist/flavors/calconnect/index.d.ts +21 -0
- package/dist/flavors/calconnect/index.js +113 -0
- package/dist/flavors/cen_cenelec/grammar.d.ts +4 -0
- package/dist/flavors/cen_cenelec/grammar.js +107 -0
- package/dist/flavors/cen_cenelec/index.d.ts +5 -0
- package/dist/flavors/cen_cenelec/index.js +263 -0
- package/dist/flavors/cen_cenelec/model.d.ts +45 -0
- package/dist/flavors/cen_cenelec/model.js +490 -0
- package/dist/flavors/cie/grammar.d.ts +5 -0
- package/dist/flavors/cie/grammar.js +127 -0
- package/dist/flavors/cie/index.d.ts +2 -0
- package/dist/flavors/cie/index.js +311 -0
- package/dist/flavors/cie/model.d.ts +122 -0
- package/dist/flavors/cie/model.js +464 -0
- package/dist/flavors/csa/grammar.d.ts +6 -0
- package/dist/flavors/csa/grammar.js +239 -0
- package/dist/flavors/csa/index.d.ts +2 -0
- package/dist/flavors/csa/index.js +634 -0
- package/dist/flavors/csa/model.d.ts +33 -0
- package/dist/flavors/csa/model.js +505 -0
- package/dist/flavors/doi/index.d.ts +13 -0
- package/dist/flavors/doi/index.js +65 -0
- package/dist/flavors/easc/index.d.ts +4 -0
- package/dist/flavors/easc/index.js +107 -0
- package/dist/flavors/ecma/index.d.ts +4 -0
- package/dist/flavors/ecma/index.js +117 -0
- package/dist/flavors/etsi/index.d.ts +14 -0
- package/dist/flavors/etsi/index.js +307 -0
- package/dist/flavors/evs/grammar.d.ts +2 -0
- package/dist/flavors/evs/grammar.js +22 -0
- package/dist/flavors/evs/index.d.ts +2 -0
- package/dist/flavors/evs/index.js +24 -0
- package/dist/flavors/evs/model.d.ts +19 -0
- package/dist/flavors/evs/model.js +36 -0
- package/dist/flavors/gb/index.d.ts +24 -0
- package/dist/flavors/gb/index.js +111 -0
- package/dist/flavors/gost/grammar.d.ts +2 -0
- package/dist/flavors/gost/grammar.js +46 -0
- package/dist/flavors/gost/index.d.ts +2 -0
- package/dist/flavors/gost/index.js +165 -0
- package/dist/flavors/gost/model.d.ts +61 -0
- package/dist/flavors/gost/model.js +147 -0
- package/dist/flavors/gost/prefix_routes.d.ts +15 -0
- package/dist/flavors/gost/prefix_routes.js +192 -0
- package/dist/flavors/iala/index.d.ts +32 -0
- package/dist/flavors/iala/index.js +300 -0
- package/dist/flavors/iana/index.d.ts +19 -0
- package/dist/flavors/iana/index.js +71 -0
- package/dist/flavors/idf/grammar.d.ts +2 -0
- package/dist/flavors/idf/grammar.js +71 -0
- package/dist/flavors/idf/index.d.ts +2 -0
- package/dist/flavors/idf/index.js +100 -0
- package/dist/flavors/idf/model.d.ts +54 -0
- package/dist/flavors/idf/model.js +359 -0
- package/dist/flavors/iec/grammar.d.ts +3 -0
- package/dist/flavors/iec/grammar.js +187 -0
- package/dist/flavors/iec/index.d.ts +4 -0
- package/dist/flavors/iec/index.js +507 -0
- package/dist/flavors/iec/model.d.ts +54 -0
- package/dist/flavors/iec/model.js +437 -0
- package/dist/flavors/ieee/grammar.d.ts +2 -0
- package/dist/flavors/ieee/grammar.js +626 -0
- package/dist/flavors/ieee/index.d.ts +3 -0
- package/dist/flavors/ieee/index.js +1186 -0
- package/dist/flavors/ieee/model.d.ts +142 -0
- package/dist/flavors/ieee/model.js +1148 -0
- package/dist/flavors/ieee/preprocessor.d.ts +8 -0
- package/dist/flavors/ieee/preprocessor.js +410 -0
- package/dist/flavors/ieee/update_codes.d.ts +8 -0
- package/dist/flavors/ieee/update_codes.js +191 -0
- package/dist/flavors/ietf/index.d.ts +30 -0
- package/dist/flavors/ietf/index.js +151 -0
- package/dist/flavors/iho/index.d.ts +4 -0
- package/dist/flavors/iho/index.js +126 -0
- package/dist/flavors/index.d.ts +9 -0
- package/dist/flavors/index.js +136 -0
- package/dist/flavors/isbn/index.d.ts +13 -0
- package/dist/flavors/isbn/index.js +97 -0
- package/dist/flavors/iso/grammar.d.ts +2 -0
- package/dist/flavors/iso/grammar.js +207 -0
- package/dist/flavors/iso/index.d.ts +2 -0
- package/dist/flavors/iso/index.js +343 -0
- package/dist/flavors/iso/model.d.ts +159 -0
- package/dist/flavors/iso/model.js +802 -0
- package/dist/flavors/iso/stages.generated.d.ts +13 -0
- package/dist/flavors/iso/stages.generated.js +391 -0
- package/dist/flavors/itu/grammar.d.ts +4 -0
- package/dist/flavors/itu/grammar.js +205 -0
- package/dist/flavors/itu/index.d.ts +2 -0
- package/dist/flavors/itu/index.js +224 -0
- package/dist/flavors/itu/model.d.ts +184 -0
- package/dist/flavors/itu/model.js +599 -0
- package/dist/flavors/jcgm/index.d.ts +7 -0
- package/dist/flavors/jcgm/index.js +300 -0
- package/dist/flavors/jis/index.d.ts +4 -0
- package/dist/flavors/jis/index.js +267 -0
- package/dist/flavors/nist/grammar.d.ts +2 -0
- package/dist/flavors/nist/grammar.js +287 -0
- package/dist/flavors/nist/index.d.ts +2 -0
- package/dist/flavors/nist/index.js +1244 -0
- package/dist/flavors/nist/model.d.ts +155 -0
- package/dist/flavors/nist/model.js +823 -0
- package/dist/flavors/nist/preprocessor.d.ts +11 -0
- package/dist/flavors/nist/preprocessor.js +281 -0
- package/dist/flavors/oasis/index.d.ts +23 -0
- package/dist/flavors/oasis/index.js +110 -0
- package/dist/flavors/ogc/index.d.ts +20 -0
- package/dist/flavors/ogc/index.js +75 -0
- package/dist/flavors/oiml/grammar.d.ts +2 -0
- package/dist/flavors/oiml/grammar.js +180 -0
- package/dist/flavors/oiml/implementation.d.ts +9 -0
- package/dist/flavors/oiml/implementation.js +16 -0
- package/dist/flavors/oiml/model.d.ts +4 -0
- package/dist/flavors/oiml/model.js +462 -0
- package/dist/flavors/omg/index.d.ts +14 -0
- package/dist/flavors/omg/index.js +73 -0
- package/dist/flavors/plateau/index.d.ts +4 -0
- package/dist/flavors/plateau/index.js +97 -0
- package/dist/flavors/tgpp/index.d.ts +4 -0
- package/dist/flavors/tgpp/index.js +122 -0
- package/dist/flavors/un/index.d.ts +13 -0
- package/dist/flavors/un/index.js +90 -0
- package/dist/flavors/w3c/index.d.ts +14 -0
- package/dist/flavors/w3c/index.js +148 -0
- package/dist/flavors/xsf/index.d.ts +18 -0
- package/dist/flavors/xsf/index.js +65 -0
- package/dist/grammar/engine.d.ts +78 -0
- package/dist/grammar/engine.js +351 -0
- package/dist/model/attribute.d.ts +54 -0
- package/dist/model/attribute.js +53 -0
- package/dist/model/builder.d.ts +39 -0
- package/dist/model/builder.js +124 -0
- package/dist/model/component.d.ts +70 -0
- package/dist/model/component.js +170 -0
- package/dist/model/identifier.d.ts +83 -0
- package/dist/model/identifier.js +270 -0
- package/dist/model/urn-generator.d.ts +27 -0
- package/dist/model/urn-generator.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { BaseIdentifier, registerType } from "../../model/identifier.js";
|
|
2
|
+
import { keyValue, extendAttributes } from "../../model/attribute.js";
|
|
3
|
+
import { PubidDate } from "../../model/component.js";
|
|
4
|
+
import { BaseUrnGenerator } from "../../model/urn-generator.js";
|
|
5
|
+
/**
|
|
6
|
+
* Port of lib/pubid/ashrae: the two single-document leaves (Standard,
|
|
7
|
+
* Guideline), the five supplement types (Addendum, CombinedAddenda,
|
|
8
|
+
* AddendaPackage, Errata, Interpretation), the renderer and the URN
|
|
9
|
+
* generator.
|
|
10
|
+
*/
|
|
11
|
+
const MONTH_NAMES = [
|
|
12
|
+
"January", "February", "March", "April", "May", "June", "July",
|
|
13
|
+
"August", "September", "October", "November", "December",
|
|
14
|
+
];
|
|
15
|
+
// The document number lives on the two leaves only (never on the
|
|
16
|
+
// shared base, mirroring the gem's deliberate leaf-only declaration);
|
|
17
|
+
// the renderer and URN reach it through this accessor or #root.
|
|
18
|
+
function numberOf(id) {
|
|
19
|
+
return id.number;
|
|
20
|
+
}
|
|
21
|
+
// Addendum/CombinedAddenda/AddendaPackage override #copublisher to
|
|
22
|
+
// delegate to base (Errata/Interpretation do not).
|
|
23
|
+
function copublisherOf(id) {
|
|
24
|
+
if (id instanceof Addendum || id instanceof CombinedAddenda || id instanceof AddendaPackage) {
|
|
25
|
+
return id.base?.copublisher;
|
|
26
|
+
}
|
|
27
|
+
return id.copublisher;
|
|
28
|
+
}
|
|
29
|
+
/** mr_sanitize: lowercase, fold out-of-charset runs to "-", trim the
|
|
30
|
+
* edges; an all-out-of-charset value collapses to undefined. */
|
|
31
|
+
function mrSanitize(value) {
|
|
32
|
+
if (value === undefined || value === "")
|
|
33
|
+
return undefined;
|
|
34
|
+
const sanitized = value.toLowerCase().replace(/[^a-z0-9.-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
35
|
+
return sanitized === "" ? undefined : sanitized;
|
|
36
|
+
}
|
|
37
|
+
/** The supplement marker segment (mr_supplement_suffix): the same
|
|
38
|
+
* marker the MR slug uses, appended to the base's URN. */
|
|
39
|
+
function mrSupplementMarker(id) {
|
|
40
|
+
const rec = id;
|
|
41
|
+
const has = (k) => rec[k] !== undefined;
|
|
42
|
+
if (has("addendum_code")) {
|
|
43
|
+
const code = rec["addendum_code"];
|
|
44
|
+
const lower = code.toLowerCase();
|
|
45
|
+
return lower === "" ? "add" : `add.${lower}`;
|
|
46
|
+
}
|
|
47
|
+
if (id instanceof CombinedAddenda)
|
|
48
|
+
return ["adds", mrSanitize(rec["addendum_codes"])].filter(Boolean).join(".");
|
|
49
|
+
if (has("package_description"))
|
|
50
|
+
return ["pkg", mrSanitize(rec["package_description"])].filter(Boolean).join(".");
|
|
51
|
+
if (id instanceof Interpretation)
|
|
52
|
+
return "interp";
|
|
53
|
+
if (id instanceof Errata) {
|
|
54
|
+
const d = rec["date"];
|
|
55
|
+
const slug = d === undefined ? undefined : [d.year, d.month, d.day].filter(Boolean).join("-");
|
|
56
|
+
return ["errata", mrSanitize(slug)].filter(Boolean).join(".");
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
class AshraeUrnGenerator extends BaseUrnGenerator {
|
|
61
|
+
generate() {
|
|
62
|
+
const id = this.identifier;
|
|
63
|
+
// A supplement's URN is the URN of its base plus the one marker
|
|
64
|
+
// segment naming the supplement (the same marker the MR slug uses).
|
|
65
|
+
if (id instanceof SupplementIdentifier && id.base !== undefined) {
|
|
66
|
+
const marker = mrSupplementMarker(id);
|
|
67
|
+
return marker === undefined || marker === ""
|
|
68
|
+
? id.base.toUrn()
|
|
69
|
+
: `${id.base.toUrn()}:${marker}`;
|
|
70
|
+
}
|
|
71
|
+
// A supplement carries no number of its own — the two leaves declare
|
|
72
|
+
// one — so reach it through #root, which walks `base`.
|
|
73
|
+
const number = numberOf(id) ?? numberOf(id.root());
|
|
74
|
+
const parts = ["urn", "ashrae"];
|
|
75
|
+
if (number !== undefined && number !== "")
|
|
76
|
+
parts.push(number);
|
|
77
|
+
if (id.year !== undefined)
|
|
78
|
+
parts.push(id.year);
|
|
79
|
+
if (id.type !== undefined)
|
|
80
|
+
parts.push(id.type.toLowerCase());
|
|
81
|
+
if (id.suffix !== undefined)
|
|
82
|
+
parts.push(id.suffix.toLowerCase());
|
|
83
|
+
if (id.amendment !== undefined)
|
|
84
|
+
parts.push(`amd.${id.amendment}`);
|
|
85
|
+
if (id.reaffirmed !== undefined)
|
|
86
|
+
parts.push(`reaff.${id.reaffirmed}`);
|
|
87
|
+
// The copublisher segment lowercases but keeps its slashes
|
|
88
|
+
// ("copub.ansi/ashrae").
|
|
89
|
+
const copublisher = copublisherOf(id);
|
|
90
|
+
if (copublisher !== undefined)
|
|
91
|
+
parts.push(`copub.${copublisher.toLowerCase()}`);
|
|
92
|
+
if (id.publisher !== undefined)
|
|
93
|
+
parts[1] = id.publisher.toLowerCase();
|
|
94
|
+
const addendum = id.addendum;
|
|
95
|
+
if (addendum !== undefined)
|
|
96
|
+
parts.push(`add.${addendum}`);
|
|
97
|
+
return parts.join(":");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export class AshraeIdentifier extends BaseIdentifier {
|
|
101
|
+
static attributes = extendAttributes(BaseIdentifier, {
|
|
102
|
+
publisher: { type: "string", default: "ASHRAE" },
|
|
103
|
+
year: { type: "string" },
|
|
104
|
+
type: { type: "string" },
|
|
105
|
+
suffix: { type: "string" },
|
|
106
|
+
amendment: { type: "string" },
|
|
107
|
+
reaffirmed: { type: "string" },
|
|
108
|
+
copublisher: { type: "string" },
|
|
109
|
+
});
|
|
110
|
+
static mappings = keyValue({ wire: "publisher", to: "publisher" }, { wire: "copublisher", to: "copublisher" }, { wire: "type", to: "type" }, { wire: "suffix", to: "suffix" }, { wire: "amendment", to: "amendment" }, { wire: "reaffirmed", to: "reaffirmed" }, { wire: "year", to: "year" });
|
|
111
|
+
// The supplement types reach the document through #root (base walk).
|
|
112
|
+
root() {
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function renderSingle(id) {
|
|
117
|
+
let result = [id.publisher ?? "", id.type ?? ""].filter((s) => s !== "").join(" ");
|
|
118
|
+
if (result.length > 0)
|
|
119
|
+
result += " ";
|
|
120
|
+
result += id.number !== undefined ? id.number : "";
|
|
121
|
+
if (id.year !== undefined)
|
|
122
|
+
result += `-${id.year}`;
|
|
123
|
+
if (id.amendment !== undefined)
|
|
124
|
+
result += ` (${id.amendment})`;
|
|
125
|
+
if (id.suffix !== undefined)
|
|
126
|
+
result += id.suffix;
|
|
127
|
+
if (id.reaffirmed !== undefined)
|
|
128
|
+
result += ` (RA${id.reaffirmed})`;
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
export class Standard extends AshraeIdentifier {
|
|
132
|
+
static polymorphicName = "pubid:ashrae:standard";
|
|
133
|
+
static urnGenerator = AshraeUrnGenerator;
|
|
134
|
+
static attributes = extendAttributes(AshraeIdentifier, {
|
|
135
|
+
number: { type: "string" },
|
|
136
|
+
type: { type: "string", default: "Standard" },
|
|
137
|
+
});
|
|
138
|
+
static mappings = [
|
|
139
|
+
...AshraeIdentifier.mappings,
|
|
140
|
+
{ wire: "number", to: "number" },
|
|
141
|
+
];
|
|
142
|
+
constructor(attrs = {}) {
|
|
143
|
+
super(attrs);
|
|
144
|
+
const self = this;
|
|
145
|
+
if (self["publisher"] === undefined)
|
|
146
|
+
self["publisher"] = "ASHRAE";
|
|
147
|
+
if (self["type"] === undefined)
|
|
148
|
+
self["type"] = "Standard";
|
|
149
|
+
}
|
|
150
|
+
render() {
|
|
151
|
+
return renderSingle(this);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export class Guideline extends AshraeIdentifier {
|
|
155
|
+
static polymorphicName = "pubid:ashrae:guideline";
|
|
156
|
+
static urnGenerator = AshraeUrnGenerator;
|
|
157
|
+
static attributes = extendAttributes(AshraeIdentifier, {
|
|
158
|
+
number: { type: "string" },
|
|
159
|
+
type: { type: "string", default: "Guideline" },
|
|
160
|
+
});
|
|
161
|
+
static mappings = [
|
|
162
|
+
...AshraeIdentifier.mappings,
|
|
163
|
+
{ wire: "number", to: "number" },
|
|
164
|
+
];
|
|
165
|
+
constructor(attrs = {}) {
|
|
166
|
+
super(attrs);
|
|
167
|
+
const self = this;
|
|
168
|
+
if (self["publisher"] === undefined)
|
|
169
|
+
self["publisher"] = "ASHRAE";
|
|
170
|
+
if (self["type"] === undefined)
|
|
171
|
+
self["type"] = "Guideline";
|
|
172
|
+
}
|
|
173
|
+
render() {
|
|
174
|
+
return renderSingle(this);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
export class SupplementIdentifier extends AshraeIdentifier {
|
|
178
|
+
static attributes = extendAttributes(AshraeIdentifier, {
|
|
179
|
+
base: { type: AshraeIdentifier },
|
|
180
|
+
});
|
|
181
|
+
static mappings = [
|
|
182
|
+
...AshraeIdentifier.mappings,
|
|
183
|
+
{ wire: "base", to: "base" },
|
|
184
|
+
];
|
|
185
|
+
root() {
|
|
186
|
+
return this.base?.root() ?? this;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// The delegated base copublisher rides the wrapper's wire through the
|
|
190
|
+
// compactHash hook (Ruby serializes through the overridden getter).
|
|
191
|
+
function delegatedCopublisher(model, hash) {
|
|
192
|
+
const base = model.base;
|
|
193
|
+
if (base?.copublisher !== undefined)
|
|
194
|
+
hash["copublisher"] = base.copublisher;
|
|
195
|
+
}
|
|
196
|
+
export class Addendum extends SupplementIdentifier {
|
|
197
|
+
static polymorphicName = "pubid:ashrae:addendum";
|
|
198
|
+
static urnGenerator = AshraeUrnGenerator;
|
|
199
|
+
static attributes = extendAttributes(SupplementIdentifier, {
|
|
200
|
+
addendum_code: { type: "string" },
|
|
201
|
+
addendum_date: { type: "string" },
|
|
202
|
+
});
|
|
203
|
+
static mappings = [
|
|
204
|
+
...SupplementIdentifier.mappings,
|
|
205
|
+
{ wire: "addendum_code", to: "addendum_code" },
|
|
206
|
+
{ wire: "addendum_date", to: "addendum_date" },
|
|
207
|
+
];
|
|
208
|
+
static compactHash = delegatedCopublisher;
|
|
209
|
+
render() {
|
|
210
|
+
if (this.base === undefined)
|
|
211
|
+
return "";
|
|
212
|
+
const copublisher = this.base.copublisher;
|
|
213
|
+
let result;
|
|
214
|
+
if (copublisher !== undefined) {
|
|
215
|
+
result = `${copublisher} Addendum ${this.addendum_code ?? ""} to ${this.base.toHuman()}`;
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
const baseType = this.base.type ?? "Standard";
|
|
219
|
+
result = `ASHRAE Addendum ${this.addendum_code ?? ""} to ${baseType} ${numberOf(this.base) ?? ""}`;
|
|
220
|
+
if (this.base.year !== undefined)
|
|
221
|
+
result += `-${this.base.year}`;
|
|
222
|
+
}
|
|
223
|
+
if (this.addendum_date !== undefined)
|
|
224
|
+
result += ` (${this.addendum_date})`;
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
export class CombinedAddenda extends SupplementIdentifier {
|
|
229
|
+
static polymorphicName = "pubid:ashrae:combined-addenda";
|
|
230
|
+
static urnGenerator = AshraeUrnGenerator;
|
|
231
|
+
static attributes = extendAttributes(SupplementIdentifier, {
|
|
232
|
+
addendum_codes: { type: "string" },
|
|
233
|
+
connector: { type: "string" },
|
|
234
|
+
});
|
|
235
|
+
static mappings = [
|
|
236
|
+
...SupplementIdentifier.mappings,
|
|
237
|
+
{ wire: "addendum_codes", to: "addendum_codes" },
|
|
238
|
+
{ wire: "connector", to: "connector" },
|
|
239
|
+
];
|
|
240
|
+
static compactHash = delegatedCopublisher;
|
|
241
|
+
render() {
|
|
242
|
+
if (this.base === undefined)
|
|
243
|
+
return "";
|
|
244
|
+
const baseType = this.base.type ?? "Standard";
|
|
245
|
+
let result;
|
|
246
|
+
if (this.addendum_codes !== undefined) {
|
|
247
|
+
result = `ASHRAE Addenda ${this.addendum_codes} to ${baseType} ${numberOf(this.base) ?? ""}`;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
result = `ASHRAE Addenda to ${baseType} ${numberOf(this.base) ?? ""}`;
|
|
251
|
+
}
|
|
252
|
+
if (this.base.year !== undefined)
|
|
253
|
+
result += `-${this.base.year}`;
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
export class AddendaPackage extends SupplementIdentifier {
|
|
258
|
+
static polymorphicName = "pubid:ashrae:addenda-package";
|
|
259
|
+
static urnGenerator = AshraeUrnGenerator;
|
|
260
|
+
static attributes = extendAttributes(SupplementIdentifier, {
|
|
261
|
+
package_description: { type: "string" },
|
|
262
|
+
});
|
|
263
|
+
static mappings = [
|
|
264
|
+
...SupplementIdentifier.mappings,
|
|
265
|
+
{ wire: "package_description", to: "package_description" },
|
|
266
|
+
];
|
|
267
|
+
static compactHash = delegatedCopublisher;
|
|
268
|
+
render() {
|
|
269
|
+
if (this.base === undefined)
|
|
270
|
+
return "";
|
|
271
|
+
let result = `ASHRAE ${this.base.type ?? "Standard"} ${numberOf(this.base) ?? ""}`;
|
|
272
|
+
if (this.base.year !== undefined)
|
|
273
|
+
result += `-${this.base.year}`;
|
|
274
|
+
if (this.package_description !== undefined)
|
|
275
|
+
result += `: Addenda ${this.package_description}`;
|
|
276
|
+
return result;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
export class Errata extends SupplementIdentifier {
|
|
280
|
+
static polymorphicName = "pubid:ashrae:errata";
|
|
281
|
+
static urnGenerator = AshraeUrnGenerator;
|
|
282
|
+
static attributes = extendAttributes(SupplementIdentifier, {
|
|
283
|
+
date: { type: PubidDate },
|
|
284
|
+
});
|
|
285
|
+
static mappings = [
|
|
286
|
+
...SupplementIdentifier.mappings,
|
|
287
|
+
{ wire: "date", to: "date" },
|
|
288
|
+
];
|
|
289
|
+
render() {
|
|
290
|
+
if (this.base === undefined)
|
|
291
|
+
return "";
|
|
292
|
+
let result = `${this.base.toHuman()} Errata`;
|
|
293
|
+
const date = longDate(this.date);
|
|
294
|
+
if (date !== undefined)
|
|
295
|
+
result += ` (${date})`;
|
|
296
|
+
return result;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
export class Interpretation extends SupplementIdentifier {
|
|
300
|
+
static polymorphicName = "pubid:ashrae:interpretation";
|
|
301
|
+
static urnGenerator = AshraeUrnGenerator;
|
|
302
|
+
render() {
|
|
303
|
+
if (this.base === undefined)
|
|
304
|
+
return "";
|
|
305
|
+
const baseType = this.base.type ?? "Standard";
|
|
306
|
+
let result = `Interpretations for ${baseType} ${numberOf(this.base) ?? ""}`;
|
|
307
|
+
if (this.base.year !== undefined)
|
|
308
|
+
result += `-${this.base.year}`;
|
|
309
|
+
return result;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function longDate(date) {
|
|
313
|
+
if (date === undefined)
|
|
314
|
+
return undefined;
|
|
315
|
+
if (date.month === undefined)
|
|
316
|
+
return date.year?.toString();
|
|
317
|
+
const month = MONTH_NAMES[Number(date.month) - 1];
|
|
318
|
+
if (month === undefined)
|
|
319
|
+
return date.render();
|
|
320
|
+
if (date.day === undefined)
|
|
321
|
+
return `${month} ${date.year ?? ""}`.trim();
|
|
322
|
+
const day = `${month} ${Number(date.day)}`;
|
|
323
|
+
return date.year !== undefined ? `${day}, ${date.year}` : day;
|
|
324
|
+
}
|
|
325
|
+
for (const klass of [
|
|
326
|
+
Standard,
|
|
327
|
+
Guideline,
|
|
328
|
+
Addendum,
|
|
329
|
+
CombinedAddenda,
|
|
330
|
+
AddendaPackage,
|
|
331
|
+
Errata,
|
|
332
|
+
Interpretation,
|
|
333
|
+
]) {
|
|
334
|
+
registerType(klass);
|
|
335
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of the ashrae parser's self.parse normalization — strip, the
|
|
3
|
+
* !original!canonical fixture format, whitespace/RA/dash normalization,
|
|
4
|
+
* trailing punctuation cleanup, paren balancing, and the "and"-in-
|
|
5
|
+
* addenda-code-list preprocessing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function preprocessAshrae(input: string): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of the ashrae parser's self.parse normalization — strip, the
|
|
3
|
+
* !original!canonical fixture format, whitespace/RA/dash normalization,
|
|
4
|
+
* trailing punctuation cleanup, paren balancing, and the "and"-in-
|
|
5
|
+
* addenda-code-list preprocessing.
|
|
6
|
+
*/
|
|
7
|
+
export function preprocessAshrae(input) {
|
|
8
|
+
let cleaned = input.trim();
|
|
9
|
+
if (cleaned.startsWith("!")) {
|
|
10
|
+
const parts = cleaned.split("!");
|
|
11
|
+
if (parts.length >= 3)
|
|
12
|
+
cleaned = parts[1];
|
|
13
|
+
}
|
|
14
|
+
cleaned = cleaned.replaceAll(/\s+/g, " ");
|
|
15
|
+
cleaned = cleaned.replaceAll(/\(RA\s+(\d{4})\)/g, "(RA $1)");
|
|
16
|
+
cleaned = cleaned.replaceAll(/RA\s+(\d{4})/g, "RA $1");
|
|
17
|
+
cleaned = cleaned.replace(/[,.]$/, "");
|
|
18
|
+
cleaned = cleaned.replaceAll("))", ")");
|
|
19
|
+
const open = (cleaned.match(/\(/g) ?? []).length;
|
|
20
|
+
const close = (cleaned.match(/\)/g) ?? []).length;
|
|
21
|
+
if (open > close)
|
|
22
|
+
cleaned = cleaned + ")".repeat(open - close);
|
|
23
|
+
cleaned = cleaned.replaceAll(/-\s+/g, "-");
|
|
24
|
+
cleaned = cleaned.replaceAll(/\s+/g, " ");
|
|
25
|
+
if (/\bAddenda\s+/.test(cleaned) || /\bAddendum\s+/.test(cleaned)) {
|
|
26
|
+
const boundary = /\s+(?:to|for|\()/;
|
|
27
|
+
const match = cleaned.match(boundary);
|
|
28
|
+
if (match !== null && match.index !== undefined) {
|
|
29
|
+
const pos = cleaned.indexOf(match[0]);
|
|
30
|
+
const before = cleaned.slice(0, pos);
|
|
31
|
+
const after = cleaned.slice(pos);
|
|
32
|
+
cleaned =
|
|
33
|
+
before.replaceAll(/,\s+and\s+/gi, ", ").replaceAll(/\s+and\s+/gi, ", ") +
|
|
34
|
+
after;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
cleaned = cleaned
|
|
38
|
+
.replaceAll(/,\s+and\s+/gi, ", ")
|
|
39
|
+
.replaceAll(/\s+and\s+/gi, ", ");
|
|
40
|
+
}
|
|
41
|
+
cleaned = cleaned.replaceAll(/\bAddendum\s+([a-z]+)\s*,\s*/gi, (_m, code) => `Addenda ${code}, `);
|
|
42
|
+
}
|
|
43
|
+
return cleaned;
|
|
44
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { match, ref, str } from "../../grammar/engine.js";
|
|
2
|
+
/**
|
|
3
|
+
* Port of lib/pubid/asme/parser.rb — 1:1. Root: identifier.
|
|
4
|
+
*
|
|
5
|
+
* Branch order: CSA/ASME, API/ASME, ISO/ASME, ASME/ANS, standard.
|
|
6
|
+
*/
|
|
7
|
+
const alt = (tokens) => tokens.map((t) => str(t)).reduce((a, b) => a.or(b));
|
|
8
|
+
function buildRules() {
|
|
9
|
+
const rules = {};
|
|
10
|
+
const rule = (name, build) => {
|
|
11
|
+
rules[name] = build();
|
|
12
|
+
};
|
|
13
|
+
rule("space", () => str(" "));
|
|
14
|
+
rule("dash", () => str("-").or(str("–")).or(str("—")));
|
|
15
|
+
rule("slash", () => str("/"));
|
|
16
|
+
rule("dot", () => str("."));
|
|
17
|
+
rule("digit", () => match("[0-9]"));
|
|
18
|
+
rule("digits", () => ref(rules, "digit").repeat(1, Infinity));
|
|
19
|
+
rule("letter", () => match("[A-Z]"));
|
|
20
|
+
rule("letters", () => ref(rules, "letter").repeat(1, Infinity));
|
|
21
|
+
rule("underscore", () => str("_"));
|
|
22
|
+
rule("roman_numeral", () => alt(["XIII", "XII", "XI", "VIII", "VII", "VI", "IV", "IX", "X", "III", "II", "V", "I"]));
|
|
23
|
+
rule("bpvc_letter_code", () => alt(["NCA", "NCD", "SSC", "BPV", "NUC", "NB", "NC", "ND", "NE", "NF", "NG"])
|
|
24
|
+
.or(ref(rules, "letter")));
|
|
25
|
+
rule("bpvc_subdivision", () => str("BPVC")
|
|
26
|
+
.then((ref(rules, "space").then(str("COMPLETE CODE BIND")).as("special")
|
|
27
|
+
.or(ref(rules, "dash").then(str("CC")).then(ref(rules, "dash"))
|
|
28
|
+
.then(ref(rules, "bpvc_letter_code").as("case_code")))
|
|
29
|
+
.or(ref(rules, "dot").then(
|
|
30
|
+
// SSC with complex subdivision: BPVC.SSC.XI.II.V.IX,
|
|
31
|
+
// or the bare catalogue form BPVC.SSC.
|
|
32
|
+
str("SSC")
|
|
33
|
+
.then((ref(rules, "dot")
|
|
34
|
+
.then(ref(rules, "roman_numeral")
|
|
35
|
+
.then((ref(rules, "dot").then(ref(rules, "roman_numeral"))).repeat(0, Infinity))
|
|
36
|
+
.as("ssc_sections"))).maybe())
|
|
37
|
+
.then(ref(rules, "dot").maybe())
|
|
38
|
+
.as("ssc_code")
|
|
39
|
+
// CC = Case Code: BPVC.CC.BPV or BPVC.CC.NC.XI; the
|
|
40
|
+
// catalogue prints the sub-code with its own leading
|
|
41
|
+
// dot (BPVC.CC.BPV..I)
|
|
42
|
+
.or(str("CC").then(ref(rules, "dot"))
|
|
43
|
+
.then(ref(rules, "bpvc_letter_code").as("case_code"))
|
|
44
|
+
.then((ref(rules, "dot").then(ref(rules, "dot").maybe())
|
|
45
|
+
.then(ref(rules, "roman_numeral").or(ref(rules, "bpvc_letter_code")).as("case_sub"))).maybe()))
|
|
46
|
+
.or(ref(rules, "roman_numeral").as("section")
|
|
47
|
+
.then((ref(rules, "dot")
|
|
48
|
+
.then((ref(rules, "digits").or(ref(rules, "bpvc_letter_code"))).as("subsection"))).maybe())
|
|
49
|
+
.then((ref(rules, "dot").then(ref(rules, "bpvc_letter_code").as("sub_subsection"))).maybe())
|
|
50
|
+
.then((ref(rules, "underscore").then(ref(rules, "letters").as("lang_suffix"))).maybe()))).as("subdivision"))).as("bpvc_code")));
|
|
51
|
+
rule("multi_char_code", () => alt([
|
|
52
|
+
"PVHO", "PASE", "PTC", "PTB", "PDS", "PCC",
|
|
53
|
+
"V&V", "V V", "VVUQ",
|
|
54
|
+
"TDP", "RTP", "RT",
|
|
55
|
+
"RA-S", "RA",
|
|
56
|
+
"QME", "QAI", "QEI",
|
|
57
|
+
"NUM", "NQA", "NML",
|
|
58
|
+
"OM",
|
|
59
|
+
"HST", "HRT",
|
|
60
|
+
"FFS",
|
|
61
|
+
"TES",
|
|
62
|
+
"TR",
|
|
63
|
+
"STS",
|
|
64
|
+
"CSD", "CA",
|
|
65
|
+
"BTH", "BPE",
|
|
66
|
+
"ANDE", "AED",
|
|
67
|
+
"AG",
|
|
68
|
+
"NM",
|
|
69
|
+
"EA",
|
|
70
|
+
]));
|
|
71
|
+
rule("asme_publisher", () => str("ASME"));
|
|
72
|
+
rule("csa_publisher", () => str("CSA"));
|
|
73
|
+
rule("api_publisher", () => str("API"));
|
|
74
|
+
rule("iso_publisher", () => str("ISO"));
|
|
75
|
+
rule("ans_publisher", () => str("ANS"));
|
|
76
|
+
rule("iso_asme_publisher", () => str("ISO/ASME").as("joint_publisher").then(ref(rules, "space").maybe()));
|
|
77
|
+
rule("asme_ans_publisher", () => str("ASME/ANS").as("joint_publisher").then(ref(rules, "space")));
|
|
78
|
+
rule("csa_asme_publisher", () => ref(rules, "csa_publisher").as("first_publisher")
|
|
79
|
+
.then(ref(rules, "space"))
|
|
80
|
+
.then(match("[A-Z0-9.]").repeat(1, Infinity).as("first_code"))
|
|
81
|
+
.then(ref(rules, "space").maybe())
|
|
82
|
+
.then(ref(rules, "slash"))
|
|
83
|
+
.then(ref(rules, "asme_publisher").as("second_publisher"))
|
|
84
|
+
.then(ref(rules, "space")));
|
|
85
|
+
rule("api_asme_publisher", () => ref(rules, "api_publisher").as("first_publisher")
|
|
86
|
+
.then(ref(rules, "space"))
|
|
87
|
+
.then(match("[0-9-]").repeat(1, Infinity).as("first_code"))
|
|
88
|
+
.then(ref(rules, "space").maybe())
|
|
89
|
+
.then(ref(rules, "slash"))
|
|
90
|
+
.then(ref(rules, "asme_publisher").as("second_publisher"))
|
|
91
|
+
.then(ref(rules, "space")));
|
|
92
|
+
rule("publisher", () => ref(rules, "asme_publisher").then(ref(rules, "space")));
|
|
93
|
+
rule("designator", () => (ref(rules, "bpvc_subdivision")
|
|
94
|
+
.or(ref(rules, "multi_char_code"))
|
|
95
|
+
.or(str("ISO"))
|
|
96
|
+
.or(str("CSA"))
|
|
97
|
+
.or(str("API"))
|
|
98
|
+
.or(str("ANS"))
|
|
99
|
+
.or(ref(rules, "letters"))).as("designator"));
|
|
100
|
+
// A trailing edition year ("-2021", "-20XX") and nothing after it.
|
|
101
|
+
// `number_part` must not read it as a dash-separated number: a
|
|
102
|
+
// designator with no number ("BPVC.I-2021", "BPE-2012") then stored
|
|
103
|
+
// the year as its number, and the year itself was lost.
|
|
104
|
+
rule("trailing_year", () => ref(rules, "dash")
|
|
105
|
+
.then(str("20XX").or(str("202X"))
|
|
106
|
+
.or(str("20").then(ref(rules, "digit")).then(str("X")))
|
|
107
|
+
.or(ref(rules, "digit").repeat(4, 4)))
|
|
108
|
+
.then(match("[0-9A-Z.]").absent()));
|
|
109
|
+
// Number part - can start with dot (NM.1), be dotted (16.5), OR dash-separated (BTH-1)
|
|
110
|
+
rule("number_part", () => ((ref(rules, "dot").then(match("[0-9A-Z]").repeat(1, Infinity))
|
|
111
|
+
.then((ref(rules, "dot").then(match("[0-9A-Z]").repeat(1, Infinity))).repeat(0, Infinity)))
|
|
112
|
+
.or(ref(rules, "trailing_year").absent()
|
|
113
|
+
.then(ref(rules, "dash")).then(match("[0-9A-Z]").repeat(1, Infinity))
|
|
114
|
+
.then((ref(rules, "dot").then(match("[0-9A-Z]").repeat(1, Infinity))).repeat(0, Infinity)))
|
|
115
|
+
.or(match("[0-9A-Z]").repeat(1, Infinity)
|
|
116
|
+
.then((ref(rules, "dot").then(match("[0-9A-Z]").repeat(1, Infinity))).repeat(0, Infinity)))).as("number"));
|
|
117
|
+
// PTC special: space-separated number with optional suffix; the
|
|
118
|
+
// renderer glues the designator to the number (PTC 19.3 TW and
|
|
119
|
+
// PTC19.3 TW are the same document)
|
|
120
|
+
rule("ptc_number", () => ref(rules, "space").maybe()
|
|
121
|
+
.then(match("[0-9]").repeat(1, Infinity)
|
|
122
|
+
.then((ref(rules, "dot").then(match("[0-9]").repeat(1, Infinity))).repeat(0, Infinity))
|
|
123
|
+
.as("number"))
|
|
124
|
+
.then((ref(rules, "space").then(ref(rules, "letters").as("ptc_suffix"))).maybe()));
|
|
125
|
+
// TR special: space-separated number (like "ASME TR A17.1-8.4-2013");
|
|
126
|
+
// the rendered form glues the designator (TRA17.1-8.4)
|
|
127
|
+
rule("tr_number", () => ref(rules, "space").maybe()
|
|
128
|
+
.then(match("[A-Z0-9]").repeat(1, Infinity)
|
|
129
|
+
.then((ref(rules, "dot").then(match("[0-9A-Z]").repeat(1, Infinity))).repeat(0, Infinity))
|
|
130
|
+
.then((ref(rules, "dash").then(match("[0-9]").repeat(1, Infinity))
|
|
131
|
+
.then((ref(rules, "dot").then(match("[0-9]").repeat(1, Infinity))).repeat(0, Infinity))).maybe())
|
|
132
|
+
.as("number")));
|
|
133
|
+
rule("spaced_number_part", () => ref(rules, "space").maybe().then(ref(rules, "number_part")));
|
|
134
|
+
rule("year_4digit", () => ref(rules, "digit").repeat(4, 4).as("year"));
|
|
135
|
+
rule("draft_year", () => str("20XX").or(str("202X"))
|
|
136
|
+
.or(str("20").then(ref(rules, "digit")).then(str("X")))
|
|
137
|
+
.as("draft_year"));
|
|
138
|
+
rule("reaffirmation", () => ref(rules, "space").then(str("(R")).then(ref(rules, "year_4digit").as("reaffirmation")).then(str(")")));
|
|
139
|
+
rule("csa_portion", () => ref(rules, "slash").then(str("CSA")).then(ref(rules, "space"))
|
|
140
|
+
.then((ref(rules, "letter").then(match("[0-9.]").repeat(1, Infinity))).as("csa_number")));
|
|
141
|
+
rule("parenthetical_revision", () => ref(rules, "space").then(str("("))
|
|
142
|
+
.then(str("Proposed revision of").or(str("Revision of")))
|
|
143
|
+
.then(ref(rules, "space"))
|
|
144
|
+
.then(match("[^)]").repeat(1, Infinity).as("ref_standard"))
|
|
145
|
+
.then(str(")")));
|
|
146
|
+
rule("revision_note", () => ref(rules, "space").then(str("["))
|
|
147
|
+
.then(match("[^\\]]").repeat(1, Infinity).as("revision_note"))
|
|
148
|
+
.then(str("]")));
|
|
149
|
+
rule("language", () => ref(rules, "space").then(str("(")).then(ref(rules, "letters").as("language")).then(str(")")));
|
|
150
|
+
rule("handbook_keyword", () => (ref(rules, "space").then(str("Handbook"))).as("handbook"));
|
|
151
|
+
const yearSuffix = () => (ref(rules, "dash").then(ref(rules, "draft_year").or(ref(rules, "year_4digit")))).maybe();
|
|
152
|
+
const trailingTails = () => ref(rules, "language").maybe()
|
|
153
|
+
.then(ref(rules, "reaffirmation").maybe());
|
|
154
|
+
rule("csa_asme_identifier", () => ref(rules, "csa_asme_publisher")
|
|
155
|
+
.then(ref(rules, "designator"))
|
|
156
|
+
.then(ref(rules, "number_part").maybe())
|
|
157
|
+
.then(yearSuffix())
|
|
158
|
+
.then(trailingTails()));
|
|
159
|
+
rule("api_asme_identifier", () => ref(rules, "api_asme_publisher")
|
|
160
|
+
.then(ref(rules, "designator"))
|
|
161
|
+
.then(ref(rules, "number_part").maybe())
|
|
162
|
+
.then(yearSuffix())
|
|
163
|
+
.then(trailingTails()));
|
|
164
|
+
rule("iso_asme_identifier", () => ref(rules, "iso_asme_publisher")
|
|
165
|
+
.then(ref(rules, "number_part").maybe())
|
|
166
|
+
.then(yearSuffix())
|
|
167
|
+
.then(trailingTails()));
|
|
168
|
+
rule("asme_ans_identifier", () => ref(rules, "asme_ans_publisher")
|
|
169
|
+
.then(ref(rules, "designator"))
|
|
170
|
+
.then(ref(rules, "number_part").maybe())
|
|
171
|
+
.then(yearSuffix())
|
|
172
|
+
.then(trailingTails()));
|
|
173
|
+
rule("standard", () => ref(rules, "publisher")
|
|
174
|
+
.then(str("PTC").as("designator")
|
|
175
|
+
.then(ref(rules, "ptc_number"))
|
|
176
|
+
.then(yearSuffix())
|
|
177
|
+
.or(str("TR").as("designator")
|
|
178
|
+
.then(ref(rules, "tr_number"))
|
|
179
|
+
.then(yearSuffix()))
|
|
180
|
+
.or(ref(rules, "designator")
|
|
181
|
+
.then(ref(rules, "spaced_number_part").maybe())
|
|
182
|
+
.then((ref(rules, "csa_portion").then(ref(rules, "handbook_keyword").maybe())
|
|
183
|
+
.or(ref(rules, "handbook_keyword"))).maybe())
|
|
184
|
+
.then(ref(rules, "language").maybe())
|
|
185
|
+
.then(yearSuffix())
|
|
186
|
+
.then(ref(rules, "language").maybe())))
|
|
187
|
+
.then(ref(rules, "parenthetical_revision").maybe())
|
|
188
|
+
.then(ref(rules, "reaffirmation").maybe())
|
|
189
|
+
.then(ref(rules, "revision_note").maybe()));
|
|
190
|
+
rule("identifier", () => ref(rules, "csa_asme_identifier")
|
|
191
|
+
.or(ref(rules, "api_asme_identifier"))
|
|
192
|
+
.or(ref(rules, "iso_asme_identifier"))
|
|
193
|
+
.or(ref(rules, "asme_ans_identifier"))
|
|
194
|
+
.or(ref(rules, "standard")));
|
|
195
|
+
return rules;
|
|
196
|
+
}
|
|
197
|
+
export const asmeGrammar = {
|
|
198
|
+
rules: buildRules(),
|
|
199
|
+
root: "identifier",
|
|
200
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Tree } from "../../grammar/engine.js";
|
|
2
|
+
import type { FlavorImplementation, Identifier } from "../../conformance/implementation.js";
|
|
3
|
+
export declare function buildAsmeIdentifier(tree: Tree): Identifier;
|
|
4
|
+
export declare function asmeGrammarImplementation(): FlavorImplementation;
|