@pubid/pubid 0.1.71 → 0.1.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/artifact/corpus.json.gz +0 -0
  2. package/dist/flavors/ansi/generated/substrate.d.ts +78 -0
  3. package/dist/flavors/ansi/generated/substrate.js +105 -0
  4. package/dist/flavors/ansi/implementation.d.ts +5 -0
  5. package/dist/flavors/ansi/implementation.js +125 -0
  6. package/dist/flavors/ansi/index.js +14 -117
  7. package/dist/flavors/api/generated/substrate.d.ts +78 -0
  8. package/dist/flavors/api/generated/substrate.js +105 -0
  9. package/dist/flavors/api/grammar.worker.d.ts +6 -0
  10. package/dist/flavors/api/{grammar.js → grammar.worker.js} +60 -16
  11. package/dist/flavors/api/implementation.d.ts +11 -0
  12. package/dist/flavors/api/implementation.js +106 -0
  13. package/dist/flavors/api/index.d.ts +1 -3
  14. package/dist/flavors/api/index.js +14 -98
  15. package/dist/flavors/arxiv/generated/substrate.d.ts +75 -0
  16. package/dist/flavors/arxiv/generated/substrate.js +102 -0
  17. package/dist/flavors/arxiv/index.js +17 -11
  18. package/dist/flavors/ashrae/generated/substrate.d.ts +78 -0
  19. package/dist/flavors/ashrae/generated/substrate.js +105 -0
  20. package/dist/flavors/ashrae/grammar.worker.d.ts +6 -0
  21. package/dist/flavors/ashrae/{grammar.js → grammar.worker.js} +76 -39
  22. package/dist/flavors/ashrae/implementation.d.ts +7 -0
  23. package/dist/flavors/ashrae/implementation.js +316 -0
  24. package/dist/flavors/ashrae/index.d.ts +1 -3
  25. package/dist/flavors/ashrae/index.js +14 -304
  26. package/dist/flavors/asme/generated/substrate.d.ts +78 -0
  27. package/dist/flavors/asme/generated/substrate.js +105 -0
  28. package/dist/flavors/asme/grammar.worker.d.ts +6 -0
  29. package/dist/flavors/asme/{grammar.js → grammar.worker.js} +41 -2
  30. package/dist/flavors/asme/implementation.d.ts +7 -0
  31. package/dist/flavors/asme/implementation.js +152 -0
  32. package/dist/flavors/asme/index.d.ts +1 -3
  33. package/dist/flavors/asme/index.js +14 -136
  34. package/dist/flavors/astm/generated/substrate.d.ts +78 -0
  35. package/dist/flavors/astm/generated/substrate.js +105 -0
  36. package/dist/flavors/astm/grammar.worker.d.ts +6 -0
  37. package/dist/flavors/astm/{grammar.js → grammar.worker.js} +39 -5
  38. package/dist/flavors/astm/implementation.d.ts +6 -0
  39. package/dist/flavors/astm/implementation.js +135 -0
  40. package/dist/flavors/astm/index.js +14 -125
  41. package/dist/flavors/bipm/generated/substrate.d.ts +78 -0
  42. package/dist/flavors/bipm/generated/substrate.js +105 -0
  43. package/dist/flavors/bipm/grammar.worker.d.ts +6 -0
  44. package/dist/flavors/bipm/grammar.worker.js +180 -0
  45. package/dist/flavors/bipm/implementation.d.ts +6 -0
  46. package/dist/flavors/bipm/implementation.js +244 -0
  47. package/dist/flavors/bipm/index.d.ts +1 -28
  48. package/dist/flavors/bipm/index.js +16 -650
  49. package/dist/flavors/bipm/model.d.ts +80 -0
  50. package/dist/flavors/bipm/model.js +271 -0
  51. package/dist/flavors/bipm/worker.d.ts +2 -0
  52. package/dist/flavors/bipm/worker.js +19 -0
  53. package/dist/flavors/bsi/generated/substrate.d.ts +78 -0
  54. package/dist/flavors/bsi/generated/substrate.js +105 -0
  55. package/dist/flavors/bsi/grammar.worker.d.ts +6 -0
  56. package/dist/flavors/bsi/{grammar.js → grammar.worker.js} +36 -7
  57. package/dist/flavors/bsi/implementation.d.ts +12 -0
  58. package/dist/flavors/bsi/implementation.js +967 -0
  59. package/dist/flavors/bsi/index.d.ts +1 -3
  60. package/dist/flavors/bsi/index.js +15 -940
  61. package/dist/flavors/bsi/model.js +16 -0
  62. package/dist/flavors/bsi/worker.js +11 -4
  63. package/dist/flavors/bsi_pfs/index.d.ts +25 -0
  64. package/dist/flavors/bsi_pfs/index.js +73 -10
  65. package/dist/flavors/calconnect/generated/substrate.d.ts +75 -0
  66. package/dist/flavors/calconnect/generated/substrate.js +102 -0
  67. package/dist/flavors/calconnect/grammar.worker.d.ts +6 -0
  68. package/dist/flavors/calconnect/grammar.worker.js +60 -0
  69. package/dist/flavors/calconnect/implementation.d.ts +6 -0
  70. package/dist/flavors/calconnect/implementation.js +69 -0
  71. package/dist/flavors/calconnect/index.d.ts +1 -19
  72. package/dist/flavors/calconnect/index.js +15 -111
  73. package/dist/flavors/calconnect/model.d.ts +26 -0
  74. package/dist/flavors/calconnect/model.js +52 -0
  75. package/dist/flavors/ccsds/generated/substrate.d.ts +75 -0
  76. package/dist/flavors/ccsds/generated/substrate.js +102 -0
  77. package/dist/flavors/ccsds/implementation.d.ts +5 -0
  78. package/dist/flavors/ccsds/implementation.js +67 -0
  79. package/dist/flavors/ccsds/index.js +13 -57
  80. package/dist/flavors/cen_cenelec/generated/substrate.d.ts +78 -0
  81. package/dist/flavors/cen_cenelec/generated/substrate.js +105 -0
  82. package/dist/flavors/cen_cenelec/grammar.worker.d.ts +6 -0
  83. package/dist/flavors/cen_cenelec/{grammar.js → grammar.worker.js} +41 -13
  84. package/dist/flavors/cen_cenelec/implementation.d.ts +15 -0
  85. package/dist/flavors/cen_cenelec/implementation.js +322 -0
  86. package/dist/flavors/cen_cenelec/index.d.ts +2 -4
  87. package/dist/flavors/cen_cenelec/index.js +16 -286
  88. package/dist/flavors/cen_cenelec/model.js +16 -1
  89. package/dist/flavors/cen_cenelec/worker.js +10 -4
  90. package/dist/flavors/cen_pfs/index.d.ts +5 -0
  91. package/dist/flavors/cen_pfs/index.js +28 -2
  92. package/dist/flavors/cie/generated/substrate.d.ts +78 -0
  93. package/dist/flavors/cie/generated/substrate.js +105 -0
  94. package/dist/flavors/cie/grammar.worker.d.ts +6 -0
  95. package/dist/flavors/cie/{grammar.js → grammar.worker.js} +71 -18
  96. package/dist/flavors/cie/implementation.d.ts +9 -0
  97. package/dist/flavors/cie/implementation.js +331 -0
  98. package/dist/flavors/cie/index.js +14 -309
  99. package/dist/flavors/csa/generated/substrate.d.ts +78 -0
  100. package/dist/flavors/csa/generated/substrate.js +105 -0
  101. package/dist/flavors/csa/grammar.worker.d.ts +12 -0
  102. package/dist/flavors/csa/{grammar.js → grammar.worker.js} +143 -27
  103. package/dist/flavors/csa/implementation.d.ts +9 -0
  104. package/dist/flavors/csa/implementation.js +661 -0
  105. package/dist/flavors/csa/index.js +14 -631
  106. package/dist/flavors/csa/worker.js +10 -4
  107. package/dist/flavors/easc/generated/substrate.d.ts +75 -0
  108. package/dist/flavors/easc/generated/substrate.js +102 -0
  109. package/dist/flavors/easc/grammar.worker.d.ts +6 -0
  110. package/dist/flavors/easc/grammar.worker.js +66 -0
  111. package/dist/flavors/easc/implementation.d.ts +6 -0
  112. package/dist/flavors/easc/implementation.js +58 -0
  113. package/dist/flavors/easc/index.d.ts +1 -2
  114. package/dist/flavors/easc/index.js +15 -105
  115. package/dist/flavors/easc/model.d.ts +10 -0
  116. package/dist/flavors/easc/model.js +43 -0
  117. package/dist/flavors/ecma/generated/substrate.d.ts +75 -0
  118. package/dist/flavors/ecma/generated/substrate.js +102 -0
  119. package/dist/flavors/ecma/grammar.worker.d.ts +6 -0
  120. package/dist/flavors/ecma/grammar.worker.js +63 -0
  121. package/dist/flavors/ecma/implementation.d.ts +6 -0
  122. package/dist/flavors/ecma/implementation.js +95 -0
  123. package/dist/flavors/ecma/index.d.ts +1 -2
  124. package/dist/flavors/ecma/index.js +15 -152
  125. package/dist/flavors/ecma/model.d.ts +10 -0
  126. package/dist/flavors/ecma/model.js +61 -0
  127. package/dist/flavors/etsi/generated/substrate.d.ts +75 -0
  128. package/dist/flavors/etsi/generated/substrate.js +102 -0
  129. package/dist/flavors/etsi/grammar.worker.d.ts +6 -0
  130. package/dist/flavors/etsi/grammar.worker.js +86 -0
  131. package/dist/flavors/etsi/implementation.d.ts +6 -0
  132. package/dist/flavors/etsi/implementation.js +110 -0
  133. package/dist/flavors/etsi/index.d.ts +2 -12
  134. package/dist/flavors/etsi/index.js +16 -305
  135. package/dist/flavors/etsi/model.d.ts +37 -0
  136. package/dist/flavors/etsi/model.js +169 -0
  137. package/dist/flavors/eu/generated/substrate.d.ts +75 -0
  138. package/dist/flavors/eu/generated/substrate.js +102 -0
  139. package/dist/flavors/eu/implementation.d.ts +7 -0
  140. package/dist/flavors/eu/implementation.js +150 -0
  141. package/dist/flavors/eu/index.js +14 -141
  142. package/dist/flavors/evs/generated/substrate.d.ts +78 -0
  143. package/dist/flavors/evs/generated/substrate.js +105 -0
  144. package/dist/flavors/evs/grammar.worker.d.ts +6 -0
  145. package/dist/flavors/evs/grammar.worker.js +98 -0
  146. package/dist/flavors/evs/implementation.d.ts +7 -0
  147. package/dist/flavors/evs/implementation.js +114 -0
  148. package/dist/flavors/evs/index.d.ts +1 -1
  149. package/dist/flavors/evs/index.js +14 -89
  150. package/dist/flavors/evs/worker.js +10 -4
  151. package/dist/flavors/gb/generated/substrate.d.ts +75 -0
  152. package/dist/flavors/gb/generated/substrate.js +102 -0
  153. package/dist/flavors/gb/grammar.worker.d.ts +6 -0
  154. package/dist/flavors/gb/grammar.worker.js +73 -0
  155. package/dist/flavors/gb/implementation.d.ts +6 -0
  156. package/dist/flavors/gb/implementation.js +87 -0
  157. package/dist/flavors/gb/index.d.ts +1 -29
  158. package/dist/flavors/gb/index.js +15 -157
  159. package/dist/flavors/gb/model.d.ts +36 -0
  160. package/dist/flavors/gb/model.js +79 -0
  161. package/dist/flavors/gost/generated/substrate.d.ts +78 -0
  162. package/dist/flavors/gost/generated/substrate.js +105 -0
  163. package/dist/flavors/gost/grammar.worker.d.ts +6 -0
  164. package/dist/flavors/gost/grammar.worker.js +82 -0
  165. package/dist/flavors/gost/implementation.d.ts +7 -0
  166. package/dist/flavors/gost/implementation.js +177 -0
  167. package/dist/flavors/gost/index.js +14 -162
  168. package/dist/flavors/gost/worker.js +12 -5
  169. package/dist/flavors/iala/generated/substrate.d.ts +78 -0
  170. package/dist/flavors/iala/generated/substrate.js +105 -0
  171. package/dist/flavors/iala/grammar.worker.d.ts +6 -0
  172. package/dist/flavors/iala/grammar.worker.js +127 -0
  173. package/dist/flavors/iala/implementation.d.ts +6 -0
  174. package/dist/flavors/iala/implementation.js +250 -0
  175. package/dist/flavors/iala/index.d.ts +1 -56
  176. package/dist/flavors/iala/index.js +17 -484
  177. package/dist/flavors/iala/model.d.ts +93 -0
  178. package/dist/flavors/iala/model.js +194 -0
  179. package/dist/flavors/iana/generated/substrate.d.ts +75 -0
  180. package/dist/flavors/iana/generated/substrate.js +102 -0
  181. package/dist/flavors/iana/grammar.worker.d.ts +6 -0
  182. package/dist/flavors/iana/grammar.worker.js +51 -0
  183. package/dist/flavors/iana/implementation.d.ts +6 -0
  184. package/dist/flavors/iana/implementation.js +47 -0
  185. package/dist/flavors/iana/index.d.ts +1 -17
  186. package/dist/flavors/iana/index.js +15 -69
  187. package/dist/flavors/iana/model.d.ts +22 -0
  188. package/dist/flavors/iana/model.js +33 -0
  189. package/dist/flavors/idf/generated/substrate.d.ts +78 -0
  190. package/dist/flavors/idf/generated/substrate.js +105 -0
  191. package/dist/flavors/idf/grammar.worker.d.ts +6 -0
  192. package/dist/flavors/idf/{grammar.js → grammar.worker.js} +58 -2
  193. package/dist/flavors/idf/implementation.d.ts +6 -0
  194. package/dist/flavors/idf/implementation.js +129 -0
  195. package/dist/flavors/idf/index.js +14 -98
  196. package/dist/flavors/iec/generated/substrate.d.ts +78 -0
  197. package/dist/flavors/iec/generated/substrate.js +105 -0
  198. package/dist/flavors/iec/grammar.worker.d.ts +6 -0
  199. package/dist/flavors/iec/grammar.worker.js +231 -0
  200. package/dist/flavors/iec/implementation.d.ts +15 -0
  201. package/dist/flavors/iec/implementation.js +956 -0
  202. package/dist/flavors/iec/index.d.ts +1 -2
  203. package/dist/flavors/iec/index.js +16 -869
  204. package/dist/flavors/iec/model.js +13 -1
  205. package/dist/flavors/iec/worker.d.ts +2 -0
  206. package/dist/flavors/iec/worker.js +19 -0
  207. package/dist/flavors/ieee/generated/substrate.d.ts +78 -0
  208. package/dist/flavors/ieee/generated/substrate.js +105 -0
  209. package/dist/flavors/ieee/implementation.d.ts +4 -0
  210. package/dist/flavors/ieee/implementation.js +48 -10
  211. package/dist/flavors/ieee/index.d.ts +3 -2
  212. package/dist/flavors/ieee/index.js +30 -12
  213. package/dist/flavors/ieee/model.js +3 -0
  214. package/dist/flavors/ieee/preprocessor.js +10 -10
  215. package/dist/flavors/ieee/worker.js +33 -11
  216. package/dist/flavors/ietf/generated/substrate.d.ts +75 -0
  217. package/dist/flavors/ietf/generated/substrate.js +102 -0
  218. package/dist/flavors/ietf/grammar.worker.d.ts +6 -0
  219. package/dist/flavors/ietf/grammar.worker.js +63 -0
  220. package/dist/flavors/ietf/implementation.d.ts +6 -0
  221. package/dist/flavors/ietf/implementation.js +60 -0
  222. package/dist/flavors/ietf/index.d.ts +1 -28
  223. package/dist/flavors/ietf/index.js +15 -149
  224. package/dist/flavors/ietf/model.d.ts +47 -0
  225. package/dist/flavors/ietf/model.js +92 -0
  226. package/dist/flavors/iho/generated/substrate.d.ts +78 -0
  227. package/dist/flavors/iho/generated/substrate.js +105 -0
  228. package/dist/flavors/iho/grammar.worker.d.ts +6 -0
  229. package/dist/flavors/iho/grammar.worker.js +150 -0
  230. package/dist/flavors/iho/implementation.d.ts +6 -0
  231. package/dist/flavors/iho/implementation.js +221 -0
  232. package/dist/flavors/iho/index.d.ts +1 -2
  233. package/dist/flavors/iho/index.js +15 -619
  234. package/dist/flavors/iho/model.d.ts +11 -0
  235. package/dist/flavors/iho/model.js +315 -0
  236. package/dist/flavors/index.js +3 -0
  237. package/dist/flavors/iso/generated/substrate.d.ts +93 -0
  238. package/dist/flavors/iso/generated/substrate.js +133 -0
  239. package/dist/flavors/iso/grammar.worker.d.ts +7 -0
  240. package/dist/flavors/iso/grammar.worker.js +406 -0
  241. package/dist/flavors/iso/implementation.d.ts +4 -0
  242. package/dist/flavors/iso/implementation.js +880 -0
  243. package/dist/flavors/iso/index.js +16 -706
  244. package/dist/flavors/iso/model.js +21 -2
  245. package/dist/flavors/iso/worker.d.ts +2 -0
  246. package/dist/flavors/iso/worker.js +19 -0
  247. package/dist/flavors/itu/generated/substrate.d.ts +78 -0
  248. package/dist/flavors/itu/generated/substrate.js +105 -0
  249. package/dist/flavors/itu/grammar.worker.d.ts +6 -0
  250. package/dist/flavors/itu/grammar.worker.js +306 -0
  251. package/dist/flavors/itu/implementation.d.ts +10 -0
  252. package/dist/flavors/itu/implementation.js +285 -0
  253. package/dist/flavors/itu/index.js +15 -246
  254. package/dist/flavors/itu/worker.d.ts +2 -0
  255. package/dist/flavors/itu/worker.js +19 -0
  256. package/dist/flavors/jcgm/generated/substrate.d.ts +78 -0
  257. package/dist/flavors/jcgm/generated/substrate.js +105 -0
  258. package/dist/flavors/jcgm/grammar.worker.d.ts +6 -0
  259. package/dist/flavors/jcgm/grammar.worker.js +98 -0
  260. package/dist/flavors/jcgm/implementation.d.ts +6 -0
  261. package/dist/flavors/jcgm/implementation.js +187 -0
  262. package/dist/flavors/jcgm/index.d.ts +1 -5
  263. package/dist/flavors/jcgm/index.js +16 -364
  264. package/dist/flavors/jcgm/model.d.ts +43 -0
  265. package/dist/flavors/jcgm/model.js +168 -0
  266. package/dist/flavors/jis/generated/substrate.d.ts +78 -0
  267. package/dist/flavors/jis/generated/substrate.js +105 -0
  268. package/dist/flavors/jis/grammar.worker.d.ts +6 -0
  269. package/dist/flavors/jis/grammar.worker.js +132 -0
  270. package/dist/flavors/jis/implementation.d.ts +6 -0
  271. package/dist/flavors/jis/implementation.js +129 -0
  272. package/dist/flavors/jis/index.d.ts +0 -2
  273. package/dist/flavors/jis/index.js +15 -390
  274. package/dist/flavors/jis/model.d.ts +30 -0
  275. package/dist/flavors/jis/model.js +205 -0
  276. package/dist/flavors/jis/worker.d.ts +2 -0
  277. package/dist/flavors/jis/worker.js +19 -0
  278. package/dist/flavors/nist/generated/substrate.d.ts +78 -0
  279. package/dist/flavors/nist/generated/substrate.js +105 -0
  280. package/dist/flavors/nist/index.js +18 -11
  281. package/dist/flavors/nist/worker.js +8 -4
  282. package/dist/flavors/oasis/generated/substrate.d.ts +75 -0
  283. package/dist/flavors/oasis/generated/substrate.js +102 -0
  284. package/dist/flavors/oasis/grammar.worker.d.ts +6 -0
  285. package/dist/flavors/oasis/grammar.worker.js +50 -0
  286. package/dist/flavors/oasis/implementation.d.ts +6 -0
  287. package/dist/flavors/oasis/implementation.js +80 -0
  288. package/dist/flavors/oasis/index.d.ts +1 -21
  289. package/dist/flavors/oasis/index.js +16 -108
  290. package/dist/flavors/oasis/model.d.ts +27 -0
  291. package/dist/flavors/oasis/model.js +34 -0
  292. package/dist/flavors/ogc/generated/substrate.d.ts +75 -0
  293. package/dist/flavors/ogc/generated/substrate.js +102 -0
  294. package/dist/flavors/ogc/grammar.worker.d.ts +6 -0
  295. package/dist/flavors/ogc/grammar.worker.js +55 -0
  296. package/dist/flavors/ogc/implementation.d.ts +6 -0
  297. package/dist/flavors/ogc/implementation.js +49 -0
  298. package/dist/flavors/ogc/index.d.ts +1 -18
  299. package/dist/flavors/ogc/index.js +15 -73
  300. package/dist/flavors/ogc/model.d.ts +23 -0
  301. package/dist/flavors/ogc/model.js +32 -0
  302. package/dist/flavors/oiml/generated/substrate.d.ts +78 -0
  303. package/dist/flavors/oiml/generated/substrate.js +105 -0
  304. package/dist/flavors/oiml/grammar.worker.d.ts +6 -0
  305. package/dist/flavors/oiml/grammar.worker.js +239 -0
  306. package/dist/flavors/oiml/implementation.d.ts +2 -1
  307. package/dist/flavors/oiml/implementation.js +16 -7
  308. package/dist/flavors/oiml/index.js +15 -6
  309. package/dist/flavors/oiml/model.js +19 -19
  310. package/dist/flavors/oiml/worker.js +14 -6
  311. package/dist/flavors/omg/generated/substrate.d.ts +78 -0
  312. package/dist/flavors/omg/generated/substrate.js +105 -0
  313. package/dist/flavors/omg/grammar.worker.d.ts +6 -0
  314. package/dist/flavors/omg/grammar.worker.js +64 -0
  315. package/dist/flavors/omg/implementation.d.ts +7 -0
  316. package/dist/flavors/omg/implementation.js +33 -0
  317. package/dist/flavors/omg/index.d.ts +1 -12
  318. package/dist/flavors/omg/index.js +15 -71
  319. package/dist/flavors/omg/model.d.ts +16 -0
  320. package/dist/flavors/omg/model.js +26 -0
  321. package/dist/flavors/plateau/generated/substrate.d.ts +78 -0
  322. package/dist/flavors/plateau/generated/substrate.js +105 -0
  323. package/dist/flavors/plateau/grammar.worker.d.ts +6 -0
  324. package/dist/flavors/plateau/grammar.worker.js +78 -0
  325. package/dist/flavors/plateau/implementation.d.ts +6 -0
  326. package/dist/flavors/plateau/implementation.js +74 -0
  327. package/dist/flavors/plateau/index.d.ts +1 -2
  328. package/dist/flavors/plateau/index.js +18 -114
  329. package/dist/flavors/plateau/model.d.ts +11 -0
  330. package/dist/flavors/plateau/model.js +51 -0
  331. package/dist/flavors/register-types.d.ts +20 -19
  332. package/dist/flavors/register-types.js +44 -19
  333. package/dist/flavors/sae/generated/substrate.d.ts +75 -0
  334. package/dist/flavors/sae/generated/substrate.js +102 -0
  335. package/dist/flavors/sae/grammar.worker.d.ts +6 -0
  336. package/dist/flavors/sae/grammar.worker.js +84 -0
  337. package/dist/flavors/sae/implementation.d.ts +11 -0
  338. package/dist/flavors/sae/implementation.js +109 -0
  339. package/dist/flavors/sae/index.d.ts +3 -0
  340. package/dist/flavors/sae/index.js +19 -0
  341. package/dist/flavors/sae/model.d.ts +86 -0
  342. package/dist/flavors/sae/model.js +185 -0
  343. package/dist/flavors/tgpp/generated/substrate.d.ts +78 -0
  344. package/dist/flavors/tgpp/generated/substrate.js +105 -0
  345. package/dist/flavors/tgpp/grammar.worker.d.ts +6 -0
  346. package/dist/flavors/tgpp/grammar.worker.js +69 -0
  347. package/dist/flavors/tgpp/implementation.d.ts +8 -0
  348. package/dist/flavors/tgpp/implementation.js +56 -0
  349. package/dist/flavors/tgpp/index.d.ts +1 -2
  350. package/dist/flavors/tgpp/index.js +15 -120
  351. package/dist/flavors/tgpp/model.d.ts +13 -0
  352. package/dist/flavors/tgpp/model.js +52 -0
  353. package/dist/flavors/w3c/generated/substrate.d.ts +78 -0
  354. package/dist/flavors/w3c/generated/substrate.js +105 -0
  355. package/dist/flavors/w3c/grammar.worker.d.ts +6 -0
  356. package/dist/flavors/w3c/grammar.worker.js +55 -0
  357. package/dist/flavors/w3c/implementation.d.ts +7 -0
  358. package/dist/flavors/w3c/implementation.js +49 -0
  359. package/dist/flavors/w3c/index.d.ts +1 -12
  360. package/dist/flavors/w3c/index.js +15 -146
  361. package/dist/flavors/w3c/model.d.ts +15 -0
  362. package/dist/flavors/w3c/model.js +103 -0
  363. package/dist/flavors/wmo/generated/substrate.d.ts +78 -0
  364. package/dist/flavors/wmo/generated/substrate.js +105 -0
  365. package/dist/flavors/wmo/implementation.d.ts +5 -0
  366. package/dist/flavors/wmo/implementation.js +79 -0
  367. package/dist/flavors/wmo/index.js +14 -68
  368. package/dist/flavors/worker-registry.js +246 -68
  369. package/dist/flavors/xsf/generated/substrate.d.ts +75 -0
  370. package/dist/flavors/xsf/generated/substrate.js +102 -0
  371. package/dist/flavors/xsf/grammar.worker.d.ts +6 -0
  372. package/dist/flavors/xsf/grammar.worker.js +53 -0
  373. package/dist/flavors/xsf/implementation.d.ts +6 -0
  374. package/dist/flavors/xsf/implementation.js +34 -0
  375. package/dist/flavors/xsf/index.d.ts +1 -16
  376. package/dist/flavors/xsf/index.js +16 -63
  377. package/dist/flavors/xsf/model.d.ts +20 -0
  378. package/dist/flavors/xsf/model.js +26 -0
  379. package/dist/model/identifier.d.ts +13 -1
  380. package/dist/model/identifier.js +71 -9
  381. package/dist/model/relation.d.ts +36 -0
  382. package/dist/model/relation.js +93 -0
  383. package/dist/parg/artifacts/ieee.d.ts +1 -1
  384. package/dist/parg/artifacts/ieee.js +1 -1
  385. package/dist/parg/worker.d.ts +4 -2
  386. package/dist/parg/worker.js +5 -3
  387. package/dist/parse-surface.js +4 -2
  388. package/dist/pubid-urn/decoder.d.ts +8 -0
  389. package/dist/pubid-urn/decoder.js +43 -0
  390. package/dist/pubid-urn/encoder.js +31 -0
  391. package/dist/pubid-urn/schema.d.ts +1 -1
  392. package/dist/pubid-urn/schema.js +1 -1
  393. package/dist/pubid-urn/schemas/bsi.js +1 -0
  394. package/dist/pubid-urn/schemas/bsi_pfs.js +9 -7
  395. package/dist/pubid-urn/schemas/cen_pfs.js +1 -0
  396. package/dist/pubid-urn/schemas/cencenelec.js +1 -0
  397. package/dist/pubid-urn/schemas/iec.js +1 -0
  398. package/dist/pubid-urn/schemas/ieee.js +1 -0
  399. package/dist/pubid-urn/schemas/iso.js +1 -0
  400. package/package.json +1 -1
  401. package/vendor/parg/bsi_pfs.json +1 -1
  402. package/vendor/parg/calconnect_pfs.json +1 -1
  403. package/vendor/parg/cen_pfs.json +1 -1
  404. package/vendor/parg/doi_pfs.json +1 -1
  405. package/vendor/parg/etsi_pfs.json +1 -1
  406. package/vendor/parg/ieee.json +1 -1
  407. package/vendor/parg/iho.json +1 -1
  408. package/vendor/parg/plateau.json +1 -1
  409. package/dist/flavors/api/grammar.d.ts +0 -4
  410. package/dist/flavors/ashrae/grammar.d.ts +0 -2
  411. package/dist/flavors/asme/grammar.d.ts +0 -2
  412. package/dist/flavors/astm/grammar.d.ts +0 -2
  413. package/dist/flavors/bsi/grammar.d.ts +0 -4
  414. package/dist/flavors/cen_cenelec/grammar.d.ts +0 -4
  415. package/dist/flavors/cie/grammar.d.ts +0 -5
  416. package/dist/flavors/csa/grammar.d.ts +0 -6
  417. package/dist/flavors/evs/grammar.d.ts +0 -2
  418. package/dist/flavors/evs/grammar.js +0 -68
  419. package/dist/flavors/gost/grammar.d.ts +0 -2
  420. package/dist/flavors/gost/grammar.js +0 -46
  421. package/dist/flavors/idf/grammar.d.ts +0 -2
  422. package/dist/flavors/iec/grammar.d.ts +0 -3
  423. package/dist/flavors/iec/grammar.js +0 -234
  424. package/dist/flavors/ieee/grammar.d.ts +0 -2
  425. package/dist/flavors/ieee/grammar.js +0 -777
  426. package/dist/flavors/iso/grammar.d.ts +0 -7
  427. package/dist/flavors/iso/grammar.js +0 -282
  428. package/dist/flavors/itu/grammar.d.ts +0 -4
  429. package/dist/flavors/itu/grammar.js +0 -276
  430. package/dist/flavors/nist/grammar.d.ts +0 -2
  431. package/dist/flavors/nist/grammar.js +0 -342
  432. package/dist/flavors/oiml/grammar.d.ts +0 -2
  433. package/dist/flavors/oiml/grammar.js +0 -206
  434. package/vendor/parg/csv.json +0 -1
  435. package/vendor/parg/ini.json +0 -1
  436. package/vendor/parg/json.json +0 -1
  437. package/vendor/parg/lua.json +0 -1
  438. package/vendor/parg/toml.json +0 -1
@@ -1,777 +0,0 @@
1
- import { match, ref, str } from "../../grammar/engine.js";
2
- /**
3
- * Port of lib/pubid/ieee/parser.rb (and the aiee/ire/nesc sub-parsers),
4
- * 1:1. The identifier alternation order is load-bearing.
5
-
6
- * Parslet notes preserved from the Ruby: sequences fold strings away when a
7
- * capture appears; `.as()` wraps the whole then-chain it closes; duplicate
8
- * capture keys in one sequence raise ("Duplicate subtrees"), which the Ruby
9
- * grammar avoids by design (distinct :trailing_year vs :year keys etc.).
10
- */
11
- const MONTHS = [
12
- "Sept.", "Oct.", "Nov.", "Dec.", "Jan.", "Feb.", "Mar.", "Apr.",
13
- "Jun.", "Jul.", "Aug.",
14
- "January", "February", "March", "April", "May", "June", "July",
15
- "August", "September", "October", "November", "December",
16
- "Jan", "Feb", "Mar", "Apr", "Jun", "Jul", "Aug", "Sep", "Sept",
17
- "Oct", "Nov", "Dec",
18
- ];
19
- function literalAlternation(tokens) {
20
- const sorted = [...new Set(tokens)].sort((a, b) => b.length - a.length);
21
- return sorted.map((t) => str(t)).reduce((a, b) => a.or(b));
22
- }
23
- function buildRules() {
24
- const rules = {};
25
- const rule = (name, build) => {
26
- rules[name] = build();
27
- };
28
- // Forward-safe rule read (mirrors parslet's named-rule indirection).
29
- const R = (name) => ref(rules, name);
30
- const space = str(" ");
31
- const dash = str("-");
32
- const dot = str(".");
33
- const slash = str("/");
34
- const comma = str(", ");
35
- // The artifact's date tails use the bare "," literal with an optional
36
- // space ("," [space]) / space), which accepts the glued "D3.0,May 2008"
37
- // spellings the comma rule (", ") cannot see.
38
- const commaGlued = () => str(",").then(spaceMaybe()).or(comma).or(space);
39
- const digit = match("[0-9]");
40
- const digits = digit.repeat(1, Infinity);
41
- const upper = match("[A-Z]");
42
- const lower = match("[a-z]");
43
- const letter = match("[A-Za-z]");
44
- const anyChar = match("[\\s\\S]");
45
- const spaceMaybe = () => space.maybe();
46
- const dashMaybe = () => dash.maybe();
47
- const monthName = () => literalAlternation(MONTHS);
48
- const absent = (p) => p.absent();
49
- // The ISO/IEC draft-stage vocabulary of the D= notation
50
- // (docs/IEEE-DRAFT-STAGES.md §1.2). Ordered so the longest token wins
51
- // ("FDIS" over "DIS").
52
- const stageVocab = () => literalAlternation(["FDIS", "CDV", "PWI", "DIS", "WD", "NP", "CD"]);
53
- rule("year_digits", () => str("19").or(str("20")).then(digit.repeat(2, 2)).then(lower.repeat(0, 2)).then(absent(digits)));
54
- rule("month_numeric", () => str("0").then(match("[1-9]")).or(str("1").then(match("[0-2]"))));
55
- rule("date_with_month_text", () => monthName().as("month").then(space).then(R("year_digits").as("year")));
56
- rule("date_with_month_numeric", () => R("year_digits").as("year").then(dash).then(R("month_numeric").as("month")));
57
- rule("date_standalone", () => ref(rules, "date_with_month_text")
58
- .or(ref(rules, "date_with_month_numeric"))
59
- .or(R("year_digits").as("year")));
60
- rule("trailing_month_year", () => (commaGlued()
61
- .then(monthName().as("trailing_month"))
62
- .then(space)
63
- .then(R("year_digits").as("trailing_year"))).or(str(",").or(space)
64
- .then(R("month_numeric").as("trailing_month"))
65
- .then(space.or(dash))
66
- .then(R("year_digits").as("trailing_year"))));
67
- rule("organization", () => literalAlternation([
68
- "IEEE", "AIEE", "ANSI", "ASA", "ANS", "IEC", "ISO", "ASTM", "CSA",
69
- "ASME", "NACE", "NSF", "ASHRAE", "NCTA", "AESC", "EIA",
70
- "USEMCSC", "AMPP", "USAS", "EAB", "MPAI",
71
- ]));
72
- rule("complex_org_prefix", () => str("ANSI/IEEE-ANS").or(str("ANSI/IEEE")).or(str("ANSI")));
73
- rule("characteristic_ieee_number", () => (str("C").then(digit.repeat(2, 2)).then(dot).then(digits).then(match("[a-z]").repeat(0, Infinity).maybe())).or(str("802").then(dot).then(digits).then(match("[a-z]").repeat(0, Infinity).maybe())).or(str("P").then(digits.repeat(1, Infinity))));
74
- rule("publisher", () => R("complex_org_prefix").or(R("organization")).as("publisher"));
75
- rule("copublisher", () => str("/ISO/IEC").as("copublisher")
76
- .or(str("/IEC/ISO").as("copublisher"))
77
- .or(slash.then(spaceMaybe()).then(R("organization").as("copublisher"))));
78
- rule("conformance", () => (spaceMaybe().then(slash)
79
- .then(str("Conformance"))
80
- .then(match("[0-9]").repeat(1, Infinity).as("conf_number"))
81
- .then(dash)
82
- .then(R("year_digits").as("conf_year"))).as("conformance"));
83
- rule("ashrae_copub", () => (slash.then(str("ASHRAE")).then(space)
84
- .then(str("Guideline").then(space).maybe())
85
- .then(digits.as("ashrae_number"))
86
- .then(dash.then(R("year_digits").as("ashrae_year")).maybe())).as("ashrae_copub"));
87
- rule("ieee_crossref", () => (slash.then(str("C")).then(digits).then(dot).then(digits).then(dot).then(digits)
88
- .then(dash).then(R("year_digits"))).as("ieee_crossref"));
89
- rule("ipcea_copub", () => (slash.then(str("IPCEA")).then(space)
90
- .then(match("[A-Za-z0-9.\\-]").repeat(1, Infinity))).as("ipcea_copub"));
91
- rule("s_designation", () => (R("publisher").then(space).maybe()).maybe()
92
- .then((ref(rules, "type_word").as("type").then(spaceMaybe()).maybe()).maybe())
93
- .then(str("S").then(dash).then(digits).as("s_number"))
94
- .then(ref(rules, "ipcea_copub").maybe())
95
- .then(ref(rules, "parenthetical").maybe()));
96
- rule("number", () => (str("P").maybe()
97
- .then(upper.repeat(0, Infinity)).then(digits).then(digits.or(upper).repeat(0, Infinity))
98
- .then(lower.maybe())).as("number"));
99
- rule("type_word", () => str("Draft Std")
100
- .or(str("STD"))
101
- .or(str("Standard"))
102
- .or(str("Std No."))
103
- .or(str("Std"))
104
- .or(str("PTC"))
105
- .or(match("[Nn]").then(str("o.")))
106
- .or(match("[Nn]").then(str("o")))
107
- .or(str("No")));
108
- rule("part", () => (dot.or(dash)).as("part_sep")
109
- .then(absent(str("REV").or(str("Rev")).or(str("rev"))
110
- .then(spaceMaybe())
111
- .then(match("[0-9A-Za-z]")))
112
- .then(match("[0-9A-Za-z]"))
113
- .repeat(1, Infinity)
114
- .as("part")));
115
- rule("subpart", () => (dot.or(dash).or(str("_"))).then((str("REV").or(str("Rev")).maybe()
116
- .then(match("[0-9a-z]").repeat(1, Infinity))
117
- .then(dot.then(digits).maybe())).as("subpart")));
118
- rule("year", () => dot.or(dash).then(ref(rules, "date_standalone")).then(str("(E)").maybe()));
119
- rule("draft_status", () => literalAlternation([
120
- "Active Unapproved", "Active Approved", "Unapproved", "Approved", "Active",
121
- ]).then(space));
122
- rule("draft_prefix", () => spaceMaybe().then(slash.or(str("_")).or(dash).or(space)));
123
- rule("draft_version", () => absent(str("R").then(dash))
124
- .then(str("D").then(absent(str("IS"))).maybe())
125
- .then((match("[0-9]").repeat(1, 2).then(dot).then(match("[0-9]").repeat(1, 2)).then(lower.maybe())).or(dot.then(digits))
126
- // The artifact's dot-led version: "." + non-year alnum/dot run
127
- // (the ".D" of "/Ddraft.D=FDIS").
128
- .or(dot.then(absent(R("year_digits"))).then(match("[0-9A-Za-z.]").repeat(1, Infinity)))
129
- .or(digits.then(str("+")).then(digits))
130
- .or(digits.then(dot.maybe()).then(str("e")).then(digits))
131
- .or(str("-").maybe()
132
- .then(match("[0-9A-Za-z]").repeat(1, Infinity))
133
- .then(str("-d").or(str("_").then(match("[0-9A-Za-z]").repeat(0, Infinity))).maybe())).as("draft_version")));
134
- rule("draft_date", () => (
135
- // The canonical forced-comma render (", Feb, 2011") comma-joins
136
- // the month and year, matching the joint tails.
137
- commaGlued().then(monthName().as("month")).then(space.or(comma)).then(R("year_digits").as("year"))).or(
138
- // Space-separated bare year after the draft designator
139
- // ("IEEE Draft Std P14764/D1 2004, Nov 2004" - the "D1 2004" draft
140
- // carries its own year, with the print date still trailing).
141
- space.then(R("year_digits").as("year"))).or(str(",").or(space).then(R("month_numeric").as("month")).then(space.or(dash)).then(R("year_digits").as("year"))).or((spaceMaybe().then(comma).then(spaceMaybe()).or(space)).then(monthName().as("month")).then((space.then(digits.as("day")).then(comma.or(space).or(dash)).then(R("year_digits").as("year"))).or(space.then(digits.as("day")).maybe().then(comma).then(R("year_digits").as("year"))).or(comma.then(spaceMaybe()).then(R("year_digits").as("year")))
142
- .or(space.then(R("year_digits").as("year"))))));
143
- rule("fdraft", () => (slash.or(str("_"))
144
- .then(literalAlternation(["FDIS", "CDV", "CD", "WD", "PWI", "NP"]))
145
- .then((commaGlued().then(monthName().as("month")).then(space).then(R("year_digits").as("year"))).or(comma.or(space).then(R("year_digits").as("year"))).maybe())
146
- .then(ref(rules, "parenthetical").maybe())).as("fdraft"));
147
- rule("draft", () => (ref(rules, "draft_prefix")
148
- .then(ref(rules, "draft_version").repeat(1, 2))
149
- .then(dot.then(digits.as("revision")).maybe())
150
- .then(
151
- // The compound both-systems form (docs/IEEE-DRAFT-STAGES.md
152
- // §1.3): "=DDIS.3" - IEEE draft ordinal = draft of the ISO/IEC
153
- // stage, with its iteration. The glued "=DDIS3" / "=DDIS-3"
154
- // spellings are accepted aliases of "=DDIS.3".
155
- str("=")
156
- .then(str("D").then(stageVocab().as("draft_iso_stage"))
157
- .or(stageVocab().as("draft_iso_stage")))
158
- .then((dot.or(dash)).maybe().then(digits.as("draft_iso_iteration")).maybe())
159
- .maybe())
160
- .then(ref(rules, "draft_date").maybe())).as("draft"));
161
- rule("revision_suffix", () => slash.then(str("R")).then(dash).then(match("[0-9A-Za-z]").repeat(1, Infinity).as("revision")));
162
- rule("edition", () => (comma.then(R("year_digits").as("edition_year")).then(str(" Edition"))).or(space.or(dash)
163
- .then(str("Edition "))
164
- .then((digits.then(dot).then(digits)).as("edition"))
165
- .then(str(" - ").or(space).or(dash))
166
- .then(R("year_digits").as("edition_year"))
167
- .then(dash.then(digit.repeat(2, 2).as("edition_month")).maybe())));
168
- rule("part_subpart_year", () => (ref(rules, "part").then(ref(rules, "subpart").repeat(1, 2)).then(ref(rules, "year"))).or(ref(rules, "part").then(ref(rules, "subpart")).then(ref(rules, "year")))
169
- .or(ref(rules, "part").then(ref(rules, "year")))
170
- .or(ref(rules, "part").then(ref(rules, "subpart")))
171
- .or(ref(rules, "year"))
172
- .or(ref(rules, "part")));
173
- rule("corrigendum", () => (str("_").or(slash).or(dash).or(space)
174
- .then(str("Corrigendum").or(str("Cor")))
175
- .then(dash.or(dot).or(space).maybe())
176
- .then(spaceMaybe())
177
- .then(digits.as("cor_number").maybe())
178
- .then((dash.or(str(":")).or(space)).then(R("year_digits").as("cor_year")).maybe())).as("corrigendum"));
179
- rule("amendment", () => (str("_").or(slash).or(dash).or(space)
180
- .then(str("Amendment").or(str("Amd")))
181
- .then(dash.or(dot).or(space).maybe())
182
- .then(spaceMaybe())
183
- .then(digits.as("amd_number").maybe())
184
- .then((dash.or(str(":")).or(space)).then(R("year_digits").as("amd_year")).maybe())).as("amendment"));
185
- rule("interpretation", () => (slash.then(str("INT")).then((dash.or(str(":")).or(space)).then(R("year_digits").as("int_year")).maybe())).as("interpretation"));
186
- rule("reaffirmed", () => (str("Reaffirmed ").then(R("year_digits").as("year"))).or(space.maybe().then(str("(R")).then(R("year_digits").as("year")).then(str(")"))).as("reaffirmed"));
187
- rule("redline", () => (space.then(dash.then(space).maybe())
188
- .then(literalAlternation(["Redline", "REDLINE", "redline"]))).as("redline"));
189
- rule("book_nickname", () => space.then(str("[")).then(match("[^\\]]").repeat(1, Infinity).as("nickname")).then(str("]")));
190
- const relationshipType = () => literalAlternation([
191
- "Draft Amendment to ", "DRAFT Amendment to ", "Draft Revision of ",
192
- "Previously designated as ", "Reaffirmation of ", "Redesignation of ",
193
- "redesignated as ", "Supersedes ", "Supercedes ", "Includes ",
194
- "Revision of ", "Revison of ", "Amendment to ", "Corrigendum to ",
195
- "Corrigenda to ", "incorporates ", "Incorporating ", "Incorporates ",
196
- "Adoption of ", "Supplement to ",
197
- ]);
198
- rule("relationship_type", () => (literalAlternation(["Draft Amendment to ", "DRAFT Amendment to "]).as("draft_amendment_to")).or(str("Draft Revision of ").as("draft_revision_of"))
199
- .or(str("Previously designated as ").as("previously_designated_as"))
200
- .or(str("Reaffirmation of ").as("reaffirmation_of"))
201
- .or(literalAlternation(["Redesignation of ", "redesignated as "]).as("redesignation_of"))
202
- .or(literalAlternation(["Supersedes ", "Supercedes "]).as("supersedes"))
203
- .or(str("Includes ").as("includes"))
204
- .or(literalAlternation(["Revision of ", "Revison of "]).as("revision_of"))
205
- .or(str("Amendment to ").as("amendment_to"))
206
- .or(literalAlternation(["Corrigendum to ", "Corrigenda to "]).as("corrigendum_to"))
207
- .or(literalAlternation(["incorporates ", "Incorporating ", "Incorporates "]).as("incorporates"))
208
- .or(str("Adoption of ").as("adoption_of"))
209
- .or(str("Supplement to ").as("supplement_to")));
210
- rule("relationship_separator", () => space.maybe().then(slash).then(space.maybe()).or(space.maybe().then(str(";")).then(space.maybe())).or(space.maybe().then(dash).then(space.maybe())));
211
- rule("relationship_break", () => ref(rules, "relationship_separator").then(spaceMaybe()).then(ref(rules, "relationship_type")));
212
- rule("identifier_string", () => (absent(str(", and "))
213
- .then(absent(str(" and ")))
214
- .then(absent(str(", ")))
215
- .then(absent(str(" as amended by ")))
216
- .then(absent(ref(rules, "relationship_break")))
217
- .then(absent(str(")")))
218
- .then(anyChar)).repeat(1, Infinity));
219
- rule("identifier_list", () => ref(rules, "identifier_string").as("id").then((str(", and ").or(str(" and ")).or(str(", ")).then(ref(rules, "identifier_string").as("id"))).repeat(0, Infinity)));
220
- rule("as_amended_by_clause", () => str(" as amended by IEEE's ").then(ref(rules, "identifier_list").as("amendments"))
221
- .or(str(" as amended by ").then(ref(rules, "identifier_list").as("amendments")))
222
- .or(str(" and its approved amendments").as("approved_amendments")));
223
- rule("relationship_clause", () => spaceMaybe().then(str("("))
224
- .then(ref(rules, "relationship_type").as("relationship_type"))
225
- .then(ref(rules, "identifier_list").as("related_ids"))
226
- .then(ref(rules, "as_amended_by_clause").maybe())
227
- .then((ref(rules, "relationship_separator")
228
- .then(ref(rules, "relationship_type").as("relationship_type"))
229
- .then(ref(rules, "identifier_list").as("related_ids"))
230
- .then(ref(rules, "as_amended_by_clause").maybe())).repeat(0, Infinity).as("additional_rels"))
231
- .then(str(")")));
232
- rule("title_portion", () => str(":").then(space).then(match("[^\\n]").repeat(1, Infinity).as("title")));
233
- rule("approved_draft_suffix", () => space.then(str("- (Approved Draft)")).or(space.then(str("(Approved Draft)"))));
234
- rule("additional_parameters", () => (spaceMaybe().then(str("(")).then(ref(rules, "reaffirmed")
235
- .or(str("Revision of IEEE Std ").then(spaceMaybe())
236
- .then(match("[^)]").repeat(1, Infinity).as("revision_of")))
237
- .or(str("Revison of IEEE Std ").then(spaceMaybe())
238
- .then(match("[^)]").repeat(1, Infinity).as("revision_of")))
239
- .or(str("Revision to IEEE Std ").then(spaceMaybe())
240
- .then(match("[^)]").repeat(1, Infinity).as("revision_of")))
241
- .or(str("Revison to IEEE Std ").then(spaceMaybe())
242
- .then(match("[^)]").repeat(1, Infinity).as("revision_of")))
243
- .or(literalAlternation(["DRAFT", "Draft", "draft"]).then(str(" Amendment to "))
244
- .then(match("[^)]").repeat(1, Infinity).as("draft_amendment_to")))
245
- .or(str("Amendment to IEEE Std ").then(spaceMaybe())
246
- .then(match("[^)]").repeat(1, Infinity).as("amendment_to")))
247
- .or(str("Adoption of ").then(match("[^)]").repeat(1, Infinity).as("adoption")))
248
- .or(str("Notebooks").then(spaceMaybe())
249
- .then(match("[^,\\)]").repeat(1, Infinity).as("notebooks")))
250
- .or(str("Standard Newspaper(s)").then(spaceMaybe())
251
- .then(match("[^,\\)]").repeat(1, Infinity).as("standard_newspapers")))
252
- .or(match("[^)]").repeat(1, Infinity).as("parenthetical_content")))
253
- .then(str(")").maybe())).as("parameters"));
254
- rule("parenthetical", () => ref(rules, "relationship_clause").or(ref(rules, "additional_parameters")));
255
- rule("iec_ieee_copublished", () => str("IEC/IEEE")
256
- .then(space)
257
- .then(absent(str("P")))
258
- .then(match("[^0-9\\n]").repeat(0, Infinity).then(digit).present())
259
- .then(match("[^\\n]").repeat(1, Infinity).as("content")));
260
- rule("joint_development_ieee_format", () => literalAlternation(["ISO/IEC/IEEE", "ISO/IEEE", "IEC/IEEE", "IEEE/CSA"]).as("joint_publishers")
261
- .then(space)
262
- // P = project (the document is a draft): identity-bearing, so it
263
- // is captured and preserved, never silently consumed.
264
- .then(str("P").as("project_marker"))
265
- .then(digits.as("number"))
266
- .then((dot.or(dash)).then(digits.as("part")).maybe())
267
- .then(slash.then(digits).then(dot.then(digits).maybe())
268
- .then(dash.then(digits.as("draft_version")).maybe()).maybe())
269
- .then(
270
- // Variant 1b: the ordinal-less stage draft "D=CDV[:2020]" -
271
- // D (draft) = CDV (the IEC stage it drafts). The year rides in
272
- // the draft clause (a distinct key, so the builder keeps the
273
- // date inside the designator).
274
- slash.then(str("D")).then(str("="))
275
- .then(stageVocab().as("draft_iso_stage"))
276
- .then(str(":").then(R("year_digits").as("draft_stage_year")).maybe())
277
- .or(
278
- // Variant 1: /D8 notation (original), with the compound
279
- // both-systems suffix "=DDIS.3" (docs/IEEE-DRAFT-STAGES.md
280
- // §1.3). The doubled-D spelling is consumed and echoed: the
281
- // joint form prints the stage as spelled.
282
- slash.then(str("D")).then(digits.as("draft_version"))
283
- .then(str("=")
284
- .then(str("D").as("draft_stage_d").then(stageVocab().as("draft_iso_stage"))
285
- .or(stageVocab().as("draft_iso_stage")))
286
- .then((dot.or(dash)).maybe().then(digits.as("draft_iso_iteration")).maybe())
287
- .maybe()))
288
- .or(
289
- // Variant 2: , CDV1 notation (comma before stage code) —
290
- // the stage draft of the named ISO/IEC stage, its iteration
291
- comma.then(literalAlternation(["CDV", "FDIS", "CD", "DIS"]).as("iec_stage"))
292
- .then(digits.maybe().as("stage_iteration")))
293
- .maybe())
294
- .then(ref(rules, "edition").maybe())
295
- .then((dash.then(R("year_digits").as("year"))).or(comma.maybe().then(space).then(monthName().as("month")).then(spaceMaybe())
296
- .then(R("year_digits").as("year"))).maybe())
297
- .then(ref(rules, "revision_suffix").maybe()));
298
- rule("joint_development_iso_format", () => {
299
- const isoLed = literalAlternation([
300
- "ISO/IEC/IEEE", "IEEE/ISO/IEC", "IEEE/IEC/ISO", "ISO/IEEE",
301
- ]);
302
- const stagedOnly = literalAlternation([
303
- "IEC/IEEE", "IEEE/IEC", "ISO/IEC", "IEEE",
304
- ]);
305
- const isoStage = () => str("FDIS")
306
- .or(str("FCD"))
307
- .or(str("CDV"))
308
- .or(str("DIS").then(digit.maybe()))
309
- .or(str("CD").then(digit.maybe()))
310
- .or(str("WD"))
311
- .or(str("PWI"))
312
- .or(str("NP"))
313
- .as("iso_stage");
314
- const stdNoise = () => (space.then(str("Std"))).maybe();
315
- // The dash-year and ", Month YYYY" spellings are the catalogue-PRINTED
316
- // joint form; tag them so the builder routes to a Standard. A
317
- // dash-joined part is tagged too (printed parts spell the dash).
318
- const dateClause = () => (str(":").then(R("year_digits").as("year"))).or(dash.then(R("year_digits").as("year"))
319
- .then(dash.then(R("month_numeric").as("month")).maybe())
320
- .then(str("").as("printed_dash_year"))).or((comma.or(space)).then(monthName().as("month")).then(space)
321
- .then(R("year_digits").as("year"))
322
- .then(str("").as("printed_month_year"))).maybe();
323
- return (isoLed.as("joint_publishers").then(space)
324
- .then(isoStage().then(stdNoise()).then(space)
325
- .or(str("").as("iso_published").then(spaceMaybe())))
326
- .or(stagedOnly.as("joint_publishers").then(space).then(isoStage()).then(stdNoise()).then(space)))
327
- .then(str("P").as("project_marker").maybe())
328
- .then(digits.as("number"))
329
- .then(
330
- // Digits-only parts keep their tree under any date spelling. A
331
- // letter-suffixed part is the ISO print with a COLON year only
332
- // (pubid#215: "8802-1AC:2018") - a dash-year letter part
333
- // ("8802-1AC-2018") belongs to the later joint-IEEE rules, so
334
- // the colon lookahead gates it.
335
- (dot.then(absent(R("year_digits"))).then(digits.as("part")))
336
- .or(dash.then(str("").as("part_dash")).then(absent(R("year_digits")))
337
- .then(digits.as("part")))
338
- .or(dot.then(absent(R("year_digits")))
339
- .then(digits.then(match("[A-Za-z]").repeat(1, Infinity)).as("part"))
340
- .then(str(":").present()))
341
- .or(dash.then(str("").as("part_dash")).then(absent(R("year_digits")))
342
- .then(digits.then(match("[A-Za-z]").repeat(1, Infinity)).as("part"))
343
- .then(str(":").present()))
344
- .maybe())
345
- .then(dateClause())
346
- .then(
347
- // The ISO/IEC edition marker may sit between the year and an
348
- // amendment/draft tail ("8802.11:2012 (E)/Amd 1-2014").
349
- (spaceMaybe().then(str("("))
350
- .then(match("[^)]").repeat(1, Infinity).as("edition_marker"))
351
- .then(str(")"))).maybe())
352
- .then(
353
- // The stage-draft clause of the ISO-led print: "/D=WD.5" - D
354
- // (draft) = the ISO/IEC stage it drafts, with its iteration
355
- // (docs/IEEE-DRAFT-STAGES.md §1.2).
356
- (slash.then(str("D")).then(str("="))
357
- .then(stageVocab().as("draft_iso_stage"))
358
- .then(dot.then(digits.then(match("[A-Za-z]").repeat(0, 1)).as("draft_iso_iteration")).maybe()))
359
- .or(slash.then(str("D")).then(dashMaybe())
360
- .then(match("[0-9.]").repeat(1, Infinity).as("draft_version"))
361
- .then(((comma.or(space)).then(monthName().as("draft_month")).then(space.or(comma))
362
- .then(R("year_digits").as("draft_year"))).or(comma.then(R("year_digits").as("draft_year"))).maybe())).maybe())
363
- .then((slash.then(str("Amd")).then(dot.or(space).maybe())
364
- .then(digits.as("amd_number"))
365
- .then((str(":").or(dash)).then(R("year_digits").as("amd_year")).maybe())).maybe())
366
- // The ISO print's dotted corrigendum tail (pubid#215):
367
- // "8802-1AC:2018/Cor.1:2020(E)".
368
- .then(ref(rules, "corrigendum").maybe())
369
- .then(ref(rules, "edition").maybe())
370
- .then(ref(rules, "revision_suffix").maybe())
371
- // The joint rule's trailing parenthetical is the NARROW one (a
372
- // language/edition marker or P&V) - the reference's relationship
373
- // vocabulary does not accept mis-typed narratives ("Revison of…"),
374
- // so the loose catch-all would over-accept ahead of the redline.
375
- .then((spaceMaybe().then(str("("))
376
- .then(match("[A-Z]").then(match("[/][A-Z]").repeat(0, Infinity)).as("edition_marker"))
377
- .then(str(")"))
378
- .or(spaceMaybe().then(str("(P&V)")).as("parenthetical_content"))).maybe())
379
- // The joint ISO-print redline is a distinct document (pubid#215):
380
- // "15289:2015(E) - Redline".
381
- .then(ref(rules, "redline").maybe());
382
- });
383
- // The stage-less ISO/IEC label with a colon year and the ISO/IEC
384
- // edition marker: "ISO/IEC 13210:1994 (E)" - the ISO/IEC portion of a
385
- // double-labeled standard. The (E) parenthetical is REQUIRED: without it
386
- // this spelling is the ISO flavor's own form and must not be stolen.
387
- rule("joint_development_iso_iec_edition", () => str("ISO/IEC").as("joint_publishers")
388
- .then(space)
389
- .then(str("").as("iso_published"))
390
- .then(str("P").as("project_marker").maybe())
391
- .then(digits.as("number"))
392
- // The part may be dot- or dash-joined ("8802-9"); a dash-year is
393
- // not a part. A distinct key: the iso-format route's part_dash
394
- // prints as a dot in the joint code; only the label keeps its dash.
395
- .then((dot.then(digits.as("part")))
396
- .or(dash.then(str("").as("iec_label_dash")).then(absent(R("year_digits"))).then(digits.as("part")))
397
- .maybe())
398
- .then(str(":").then(spaceMaybe()).then(R("year_digits").as("year")))
399
- .then(spaceMaybe())
400
- .then(ref(rules, "parenthetical")));
401
- rule("joint_development_embedded_stage", () => literalAlternation([
402
- "ISO/IEC/IEEE", "IEEE/ISO/IEC", "IEEE/IEC/ISO", "ISO/IEEE",
403
- "IEC/IEEE", "IEEE/IEC", "ISO/IEC", "IEEE",
404
- ]).as("joint_publishers")
405
- .then(space)
406
- .then(str("P").as("project_marker").maybe())
407
- .then(digits.as("number"))
408
- .then((dot.or(dash)).then(absent(R("year_digits"))).then(digits.as("part")).maybe())
409
- .then(dot)
410
- .then(str("FDIS")
411
- .or(str("FCD"))
412
- .or(str("CDV"))
413
- .or(str("DIS").then(digit.maybe()))
414
- .or(str("CD").then(digit.maybe()))
415
- .or(str("WD"))
416
- .or(str("PWI"))
417
- .or(str("NP"))
418
- .as("iso_stage"))
419
- .then(absent(digit.or(letter)))
420
- .then((str(":").then(R("year_digits").as("year"))).or(dash.then(R("year_digits").as("year"))
421
- .then(dash.then(R("month_numeric").as("month")).maybe())).or((comma.or(space)).then(monthName().as("month")).then(space)
422
- .then(R("year_digits").as("year"))).maybe()));
423
- rule("number_first_identifier", () => ref(rules, "number")
424
- .then(dash.then(R("year_digits").as("year")).maybe())
425
- .then(space)
426
- .then((R("publisher").then(R("copublisher").repeat(0, Infinity).as("copublishers"))).as("publishers"))
427
- .then(space)
428
- .then(ref(rules, "type_word").as("type").then(spaceMaybe()).maybe())
429
- .then(match("[^\\n]").repeat(0, Infinity).as("title")));
430
- rule("ieee_p_identifier", () => (str("IEEE").as("publisher").then(space).maybe())
431
- .then(ref(rules, "number"))
432
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())
433
- .then((slash.then(digits.as("draft_version"))).as("digit_draft").maybe())
434
- .then(ref(rules, "fdraft").maybe())
435
- .then(ref(rules, "trailing_month_year").maybe())
436
- .then(ref(rules, "corrigendum").maybe())
437
- .then(ref(rules, "draft").maybe())
438
- .then(ref(rules, "revision_suffix").maybe())
439
- .then(ref(rules, "trailing_month_year").maybe())
440
- .then(ref(rules, "corrigendum").maybe())
441
- .then(ref(rules, "parenthetical").maybe()));
442
- rule("ansi_p_identifier", () => str("ANSI").as("publisher")
443
- .then(space)
444
- .then(str("P"))
445
- .then(spaceMaybe())
446
- .then(ref(rules, "number"))
447
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())
448
- .then(ref(rules, "trailing_month_year").maybe())
449
- .then(ref(rules, "corrigendum").maybe())
450
- .then(ref(rules, "draft").maybe())
451
- .then(ref(rules, "revision_suffix").maybe())
452
- .then(ref(rules, "trailing_month_year").maybe())
453
- .then((comma.or(space)).then(R("year_digits").as("trailing_year")).maybe())
454
- .then(ref(rules, "corrigendum").maybe())
455
- .then(ref(rules, "parenthetical").maybe()));
456
- rule("ieee_draft_p_identifier", () => (str("IEEE").as("publisher").then(space).maybe())
457
- .then(ref(rules, "draft_status").as("draft_status").maybe())
458
- .then(str("Draft"))
459
- .then(space)
460
- .then(ref(rules, "number"))
461
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())
462
- .then((space.then(monthName().as("trailing_month")).then(space)
463
- .then(R("year_digits").as("trailing_year"))).or(space.then(R("month_numeric").as("trailing_month")).then(space.or(dash))
464
- .then(R("year_digits").as("trailing_year"))).maybe())
465
- .then(ref(rules, "draft").maybe())
466
- .then(ref(rules, "revision_suffix").maybe())
467
- .then(ref(rules, "corrigendum").maybe())
468
- .then(ref(rules, "parenthetical").maybe()));
469
- rule("ieee_approved_draft_identifier", () => str("IEEE").as("publisher")
470
- .then(space)
471
- .then(str("Approved"))
472
- .then(space)
473
- .then(str("Draft Std").or(str("Std")).as("type"))
474
- .then(space)
475
- .then(str("P").maybe())
476
- .then(ref(rules, "number"))
477
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())
478
- .then(ref(rules, "draft").maybe())
479
- .then(ref(rules, "revision_suffix").maybe())
480
- .then(ref(rules, "parenthetical").maybe()));
481
- // --- AIEE sub-parser ----------------------------------------------------
482
- rule("aiee_year", () => str("18").then(digit.repeat(2, 2))
483
- .or(str("19").then(literalAlternation(["0", "1", "2", "3", "4", "5"]).then(digit)))
484
- .or(str("196").then(match("[0-3]"))));
485
- rule("aiee_prefix", () => literalAlternation(["IEEE-AIEE", "A.I.E.E.", "A. I. E. E.", "AIEE"]).as("publisher"));
486
- rule("aiee_type", () => literalAlternation([
487
- "Standard No.", "Standard No", "Std No.", "Std No", "Std", "Nos",
488
- "No.", "No", "no", "Standard", "Trans.",
489
- ]).as("type"));
490
- rule("aiee_number", () => ((upper.repeat(2, 3).then(dash).then(digits)).or(digits.then(upper).then(absent(space.then(str("and"))))).or(digits.then(dot).then(digits))
491
- .or(digits.as("main_number").then(space)
492
- .then((str("(").then(digits.as("alt_number")).then(str(")"))).as("parenthetical")))
493
- .or(digits.then(absent(space.then(str("and")).then(space).then(digits))))).as("number"));
494
- rule("aiee_date_short", () => space.maybe().then(dash).then(R("aiee_year").as("year")));
495
- rule("aiee_date_long", () => spaceMaybe().then(((str(",").or(dot)).as("separator").then(spaceMaybe())
496
- .then(monthName().as("month").then(space).maybe())
497
- .then(R("aiee_year").as("year"))).or(monthName().as("month").then(dash).then(R("aiee_year").as("year")))));
498
- rule("aiee_date", () => ref(rules, "aiee_date_short").or(ref(rules, "aiee_date_long")).maybe());
499
- rule("aiee_identifier", () => ref(rules, "aiee_prefix")
500
- .then(space)
501
- .then(ref(rules, "aiee_type").then(space).maybe())
502
- .then(ref(rules, "aiee_number"))
503
- .then(ref(rules, "aiee_date")));
504
- // --- IRE sub-parser -----------------------------------------------------
505
- rule("ire_year_full", () => str("191").then(digit.repeat(1, 1))
506
- .or(str("19").then(literalAlternation(["2", "3", "4", "5"])).then(digit))
507
- .or(str("196").then(match("[0-3]"))));
508
- rule("ire_year_short", () => match("[1-6]").then(digit));
509
- rule("ire_prefix", () => str("IEEE-IRE").or(str("IRE")).as("publisher"));
510
- rule("ire_type", () => literalAlternation(["Trans.", "Standard", "Std"]).as("type"));
511
- rule("ire_number", () => ((digits.then(space.or(dot)).then(upper).then(digits)).or(digits.then(dot).then(str("IRE")).then(digits).then(dot).then(digits).then(upper).then(digits)).or(upper.repeat(2, 4).then(dash).then(digits))
512
- .or(digits)).as("number"));
513
- rule("ire_date", () => (spaceMaybe().then(dash.or(str(",")).maybe()).then(spaceMaybe())
514
- .then(ref(rules, "ire_year_full").or(ref(rules, "ire_year_short")).as("year"))).maybe());
515
- rule("ire_identifier", () => (ref(rules, "ire_year_full").or(ref(rules, "ire_year_short")).as("year")
516
- .then(space)
517
- .then(ref(rules, "ire_prefix"))
518
- .then(space)
519
- .then(ref(rules, "ire_type").then(space).maybe())
520
- .then(ref(rules, "ire_number"))
521
- .then(spaceMaybe().then(dash.or(str(",")).maybe()).then(spaceMaybe())
522
- .then(ref(rules, "ire_year_full").as("full_year")).maybe())).or(ref(rules, "ire_prefix")
523
- .then(space)
524
- .then(ref(rules, "ire_type").then(space).maybe())
525
- .then(ref(rules, "ire_number"))
526
- .then(ref(rules, "ire_date"))));
527
- // --- NESC sub-parser ----------------------------------------------------
528
- rule("nesc_c2_code", () => str("C2").as("code"));
529
- rule("nesc_full_name", () => str("National Electrical Safety Code").or(str("National Electric Safety Code")));
530
- rule("nesc_registered", () => str("(R)"));
531
- rule("nesc_edition", () => literalAlternation([
532
- "Premier Edition", "First Edition", "Second Edition", "Third Edition",
533
- "Fourth Edition", "Fifth Edition", "Sixth Edition", "Seventh Edition",
534
- "Eighth Edition", "Ninth Edition", "Tenth Edition",
535
- ]).as("edition"));
536
- rule("nesc_variant", () => str("Handbook").or(str("Redline")).as("variant"));
537
- rule("nesc_month", () => literalAlternation([
538
- "January", "February", "March", "April", "May", "June", "July",
539
- "August", "September", "October", "November", "December",
540
- ]).as("month"));
541
- rule("nesc_c2_standard", () => ref(rules, "nesc_c2_code")
542
- .then(dash)
543
- .then(digit.repeat(4, 4).as("year"))
544
- .then(str(",").maybe().then(space).maybe())
545
- .then(ref(rules, "nesc_full_name"))
546
- .then(ref(rules, "nesc_registered").maybe())
547
- .then(space.then(str("(")).then(str("NESC")).then(ref(rules, "nesc_registered").maybe())
548
- .then(str(")")).maybe()));
549
- rule("nesc_year_first", () => str("IEEE").then(space).then(str("Std")).then(space).maybe()
550
- .then(digit.repeat(4, 4).as("year"))
551
- .then(space)
552
- .then((ref(rules, "nesc_full_name").as("full_name")
553
- .then(ref(rules, "nesc_registered").as("name_registered").maybe())
554
- .then(space.then(str("(")).then(str("NESC").as("paren_abbr"))
555
- .then(ref(rules, "nesc_registered").as("paren_registered").maybe())
556
- .then(str(")")).maybe())).or(str("NESC").as("abbr").then(ref(rules, "nesc_registered").as("abbr_registered").maybe())))
557
- .then(space.then(ref(rules, "nesc_variant")).maybe())
558
- .then(str(",").then(space).then(ref(rules, "nesc_edition")).maybe()));
559
- rule("nesc_name_first", () => ref(rules, "nesc_full_name")
560
- .then(ref(rules, "nesc_registered").maybe())
561
- .then(str(","))
562
- .then(space)
563
- .then(ref(rules, "nesc_c2_code"))
564
- .then(dash)
565
- .then(digit.repeat(4, 4).as("year"))
566
- .then(space.then(str("-")).then(space).then(ref(rules, "nesc_variant")).as("variant").maybe()));
567
- rule("nesc_draft_nesc", () => str("Draft").as("draft")
568
- .then(space)
569
- .then(ref(rules, "nesc_full_name").or(str("NESC")))
570
- .then(ref(rules, "nesc_registered").maybe())
571
- .then(str(","))
572
- .then(space)
573
- .then(ref(rules, "nesc_month"))
574
- .then(space)
575
- .then(digit.repeat(4, 4).as("year")));
576
- // Preprint is a draft STAGE of the C2 code (NESC terminology for its
577
- // pre-edition drafts), not a variant: dotted is the canonical spelling
578
- // (C2.2012.Preprint); dash (C2-2012-Preprint) and the catalogue's
579
- // slash tail (C2-2002/Preprint) are aliases. The verbose
580
- // "Preprint Proposal(s) for the YYYY Edition of ..." forms cite the
581
- // same draft by its target edition year. Longest literal first —
582
- // "Proposals" / "Proposal" — the choice does not retry the shorter
583
- // alternative when the continuation fails.
584
- rule("nesc_c2_preprint", () => ref(rules, "nesc_c2_code")
585
- .then(str(".").then(digit.repeat(4, 4).as("year")).then(str("."))
586
- .or(dash.then(digit.repeat(4, 4).as("year")).then(dash))
587
- .or(dash.then(digit.repeat(4, 4).as("year")).then(str("/"))))
588
- .then(str("Preprint").as("preprint")));
589
- rule("nesc_preprint_proposal", () => str("Preprint").as("preprint")
590
- .then(space)
591
- .then(str("Proposals").or(str("Proposal")))
592
- .then(space)
593
- .then(str("for")).then(space).then(str("the")).then(space)
594
- .then(digit.repeat(4, 4).as("year"))
595
- .then(space).then(str("Edition")).then(space)
596
- .then(str("of")).then(space).then(str("the")).then(space)
597
- .then(ref(rules, "nesc_full_name"))
598
- .then(space.then(str("(")).then(str("NESC")).then(ref(rules, "nesc_registered").maybe())
599
- .then(str(")")).maybe()));
600
- rule("nesc_identifier", () => ref(rules, "nesc_draft_nesc")
601
- .or(ref(rules, "nesc_preprint_proposal"))
602
- .or(ref(rules, "nesc_name_first"))
603
- .or(ref(rules, "nesc_c2_preprint"))
604
- .or(ref(rules, "nesc_c2_standard"))
605
- .or(ref(rules, "nesc_year_first")));
606
- // --- PSI/SI -------------------------------------------------------------
607
- rule("psi_draft", () => slash.then(str("D")).then(dashMaybe()).then(digits.as("draft_version")));
608
- rule("psi_date", () => (comma.then(monthName().or(R("month_numeric")).as("month")).then(space.or(dash))
609
- .then(R("year_digits").as("year"))).or(dash.then(R("year_digits").as("year"))
610
- .then(dash.then(digit.repeat(2, 2).as("month")).maybe())));
611
- rule("ieee_astm_si_psi", () => str("IEEE/ASTM").or(str("IEEE")).as("publishers")
612
- .then(space)
613
- .then(str("PSI").or(str("SI")).as("si_type"))
614
- .then(space.or(str(".")))
615
- .then(digits.as("number"))
616
- .then(str(".").then(R("year_digits").as("year")).maybe())
617
- .then((ref(rules, "psi_draft").then(ref(rules, "psi_date").maybe())).or(ref(rules, "psi_date").then(ref(rules, "psi_draft").maybe())).maybe())
618
- .then(ref(rules, "parenthetical").maybe()));
619
- rule("no_prefix_ieee", () => R("characteristic_ieee_number").as("number")
620
- .then((dash.then(letter)).maybe().as("suffix"))
621
- .then((dash.then(R("year_digits"))).maybe().as("year"))
622
- .then(ref(rules, "draft").maybe())
623
- .then(str("(E)").or(str("(F)")).maybe())
624
- .then(ref(rules, "parenthetical").maybe()));
625
- // The generic tail minus the publisher (parg line 154): the publisherled
626
- // alternative REQUIRES its publishers, so bare type-word/number forms
627
- // route here instead — WITHOUT the redline/book_nickname slots the
628
- // publisherled tail carries (the gem rejects "802.3-2012 - Redline").
629
- rule("publisherless_ieee", () => (ref(rules, "type_word").as("type").then(space).maybe())
630
- .then(ref(rules, "number"))
631
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())
632
- .then(ref(rules, "corrigendum").maybe())
633
- .then(ref(rules, "draft").maybe())
634
- .then(ref(rules, "revision_suffix").maybe())
635
- .then(ref(rules, "parenthetical").maybe()));
636
- rule("corrigendum_identifier", () => (R("publisher").then(R("copublisher").repeat(0, Infinity).as("copublishers")).as("publishers")
637
- .then(space).maybe()).maybe()
638
- .then(ref(rules, "type_word").as("type").then(spaceMaybe()).maybe())
639
- .then(ref(rules, "number"))
640
- .then(ref(rules, "part_subpart_year").maybe())
641
- .as("base")
642
- .then(slash.or(dash).or(space))
643
- .then(str("Cor"))
644
- .then(dash.or(dot).or(space).maybe())
645
- .then(spaceMaybe())
646
- .then(digits.as("cor_number"))
647
- .then((dash.or(str(":")).or(space)).then(R("year_digits").as("cor_year")).maybe())
648
- .then(ref(rules, "parenthetical").maybe()));
649
- rule("interpretation_identifier", () => (R("publisher").then(R("copublisher").repeat(0, Infinity).as("copublishers")).as("publishers")
650
- .then(space).maybe()).maybe()
651
- .then(ref(rules, "type_word").as("type").then(spaceMaybe()).maybe())
652
- .then(ref(rules, "number"))
653
- .then(ref(rules, "part_subpart_year").maybe())
654
- .as("base")
655
- .then(slash.or(dash).or(space))
656
- .then(str("INT"))
657
- .then((dash.or(str(":")).or(space)).then(R("year_digits").as("int_year")).maybe())
658
- .then(ref(rules, "parenthetical").maybe()));
659
- rule("conformance_identifier", () => (R("publisher").then(R("copublisher").repeat(0, Infinity).as("copublishers")).as("publishers")
660
- .then(space).maybe()).maybe()
661
- .then(ref(rules, "type_word").as("type").then(spaceMaybe()).maybe())
662
- .then(ref(rules, "number"))
663
- .then(ref(rules, "part_subpart_year").maybe())
664
- .as("base")
665
- .then(slash.or(dash).or(space))
666
- .then(str("Conformance"))
667
- .then(match("[0-9]").repeat(1, Infinity).as("conf_number"))
668
- .then(dash)
669
- .then(R("year_digits").as("conf_year"))
670
- .then(ref(rules, "parenthetical").maybe()));
671
- rule("multi_numbered_identifier", () => ((R("publisher").then(space).maybe()).maybe()
672
- .then(ref(rules, "type_word").as("type").then(spaceMaybe()).maybe())
673
- .then(ref(rules, "number"))
674
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())).as("primary_identifier")
675
- .then(((slash.then(str("C")).then(digits).then(dot).then(digits).then(dot).then(digits)
676
- .then(dash).then(R("year_digits"))).as("secondary_crossref")))
677
- .or(str(",").then(space)
678
- .then(ref(rules, "type_word").as("type").then(spaceMaybe()).maybe())
679
- .then(ref(rules, "number"))
680
- .then(dash)
681
- .then(R("year_digits"))
682
- .as("secondary_joint")));
683
- rule("csa_dual_published", () => (R("publisher").then(space)
684
- .then(ref(rules, "type_word").as("type").then(spaceMaybe()).maybe())
685
- .then(ref(rules, "number"))
686
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())).as("ieee_portion")
687
- .then(slash)
688
- .then(str("CSA"))
689
- .then(space)
690
- .then(((str("C").then(digit.repeat(2, 2)).then(dot).then(digit).then(space)
691
- .then(str("No").or(str("NO"))).then(dot)
692
- .then(space).then(match("[0-9.]").repeat(1, Infinity))
693
- .then(dash.or(str(":"))).then(digit.repeat(2, 2))).or(str("C").then(match("[0-9.]").repeat(1, Infinity)).then(dash).then(digit.repeat(2, 2))).or(str("C").then(digit.repeat(2, 2)).then(dot).then(digit).then(space)
694
- .then(str("No").or(str("NO")))
695
- .then(dot).then(space).then(match("[0-9.]").repeat(1, Infinity))
696
- .then(str(":")).then(digit.repeat(2, 2))).or(str("C").then(match("[0-9.]").repeat(1, Infinity)).then(str(":")).then(digit.repeat(2, 2)))).as("csa_portion")));
697
- rule("combined_aiee_identifier", () => ref(rules, "aiee_identifier").as("first_aiee")
698
- .then(space)
699
- .then(str("and"))
700
- .then(space)
701
- .then(ref(rules, "aiee_identifier").as("second_aiee")));
702
- rule("aiee_delegation", () => ((str("IEEE-AIEE").then(space).then(literalAlternation(["No.", "Nos", "No", "Standard", "Trans."]))).or(str("A.I.E.E.").then(space).then(literalAlternation(["No.", "Nos", "No"]))).or(str("A. I. E. E.").then(space).then(literalAlternation(["No.", "Nos", "No", "Standard"]))).or(str("AIEE").then(space).then(literalAlternation(["No.", "Nos", "No", "Standard", "Trans.", "Std"])))).present()
703
- .then(ref(rules, "aiee_identifier").as("aiee")));
704
- rule("ire_delegation", () => ((match("[1-6]").then(digit).then(space).then(str("IRE"))).or(str("19").then(digit.repeat(2, 2)).then(space).then(str("IRE"))).or(str("IRE").then(space).then(digits.or(str("Standard")).or(str("Std")).or(str("Trans")))).or(str("IEEE-IRE").then(space))).present()
705
- .then(ref(rules, "ire_identifier").as("ire")));
706
- rule("nesc_delegation", () =>
707
- // The optional "IEEE Std " prefix is consumed BEFORE the guard: the
708
- // catalogue prints NESC documents with it ("IEEE Std C2.2012.Preprint",
709
- // "IEEE Std 2017 NESC Handbook"), and a guard anchored at position 0
710
- // rejects every prefixed spelling. nesc_year_first carries its own
711
- // prefix .maybe(), so the consumed form still parses.
712
- str("IEEE").then(space).then(str("Std")).then(space).maybe()
713
- .then((str("C2").then(str(".").or(str("-")))).or(R("year_digits").then(space).then(str("NESC").or(str("National Electrical Safety Code")))).or(str("Draft").then(space).then(str("NESC").or(str("National Electrical Safety Code")))).or(str("Preprint")).or(str("National Electrical Safety Code").then(str(",")).then(space).then(str("C2-"))).present())
714
- .then(ref(rules, "nesc_identifier").as("nesc")));
715
- rule("identifier", () => ref(rules, "combined_aiee_identifier")
716
- .or(ref(rules, "aiee_delegation"))
717
- .or(ref(rules, "combined_aiee_identifier"))
718
- .or(ref(rules, "ire_delegation"))
719
- .or(ref(rules, "nesc_delegation"))
720
- .or(ref(rules, "ieee_astm_si_psi"))
721
- .or(ref(rules, "multi_numbered_identifier"))
722
- .or(ref(rules, "csa_dual_published"))
723
- .or(ref(rules, "s_designation"))
724
- .or(ref(rules, "corrigendum_identifier"))
725
- .or(ref(rules, "interpretation_identifier"))
726
- .or(ref(rules, "conformance_identifier"))
727
- .or(ref(rules, "joint_development_ieee_format"))
728
- .or(ref(rules, "joint_development_iso_format"))
729
- .or(ref(rules, "joint_development_iso_iec_edition"))
730
- .or(ref(rules, "joint_development_embedded_stage"))
731
- .or(ref(rules, "iec_ieee_copublished"))
732
- .or(ref(rules, "number_first_identifier"))
733
- .or(ref(rules, "ieee_approved_draft_identifier"))
734
- .or(ref(rules, "ieee_draft_p_identifier"))
735
- .or(ref(rules, "ieee_p_identifier"))
736
- .or(ref(rules, "ansi_p_identifier"))
737
- .or((R("publisher").then(R("copublisher").repeat(0, Infinity).as("copublishers")).as("publishers")
738
- .then(space))
739
- .then(ref(rules, "draft_status").as("draft_status").maybe())
740
- .then(str("Draft Std").as("type").then(spaceMaybe()).maybe())
741
- .then(ref(rules, "type_word").as("type")
742
- .then(space.then(str("No")).then(space).maybe())
743
- .then(spaceMaybe()).maybe())
744
- .then(ref(rules, "number"))
745
- .then(ref(rules, "part_subpart_year").or(ref(rules, "edition")).maybe())
746
- .then(ref(rules, "corrigendum").maybe())
747
- .then(ref(rules, "amendment").maybe())
748
- .then(ref(rules, "interpretation").maybe())
749
- .then(ref(rules, "conformance").maybe())
750
- .then(ref(rules, "ashrae_copub").maybe())
751
- .then(ref(rules, "ieee_crossref").maybe())
752
- .then(ref(rules, "draft").maybe())
753
- .then(ref(rules, "revision_suffix").maybe())
754
- .then(ref(rules, "trailing_month_year").maybe())
755
- .then(
756
- // The ASHRAE joint suffix may also trail a draft+date
757
- // ("IEEE P1635/D13, December, 2017/ASHRAE Guideline 21").
758
- ref(rules, "ashrae_copub").maybe())
759
- .then(
760
- // A bracketed narrative may sit between the base and a trailing
761
- // corrigendum ("IEEE Std 671-1985 [Corrigendum to …]/Cor. 1-2010").
762
- ref(rules, "book_nickname").maybe())
763
- .then(ref(rules, "corrigendum").maybe())
764
- .then(ref(rules, "edition").maybe())
765
- .then(ref(rules, "parenthetical").maybe())
766
- .then(ref(rules, "book_nickname").maybe())
767
- .then(ref(rules, "redline").maybe())
768
- .then(ref(rules, "title_portion").maybe())
769
- .then(ref(rules, "approved_draft_suffix").maybe()))
770
- .or(ref(rules, "no_prefix_ieee"))
771
- .or(ref(rules, "publisherless_ieee")));
772
- return rules;
773
- }
774
- export const ieeeGrammar = {
775
- rules: buildRules(),
776
- root: "identifier",
777
- };