@pubid/pubid 0.1.22 → 0.1.23
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
CHANGED
|
Binary file
|
|
@@ -43,14 +43,19 @@ function buildRules() {
|
|
|
43
43
|
rule("numbered_corrigendum_identifier", () => rules["base"]
|
|
44
44
|
.as("base")
|
|
45
45
|
.then(str("/"), str("Cor").as("type_with_stage"))
|
|
46
|
-
.then(
|
|
46
|
+
.then(supplementSeparator(), digits.as("number"))
|
|
47
47
|
.then(datePortion.maybe()));
|
|
48
48
|
rule("amendment_identifier", () => rules["base"]
|
|
49
49
|
.as("base")
|
|
50
50
|
.then(str("/"), str("Amd").as("type_with_stage"))
|
|
51
|
-
.then(
|
|
51
|
+
.then(supplementSeparator(), digits.as("number"))
|
|
52
52
|
.then(datePortion.maybe()));
|
|
53
53
|
rule("named_number", () => (str("GUM").or(str("VIM").then(str("-").then(digits).maybe()))).as("number"));
|
|
54
|
+
// "Amd 1" and the dotted "Amd.1:2026" BIPM prints are both accepted on
|
|
55
|
+
// input; rendering stays "Amd 1" (the gem's jcgm parser, pubid#574).
|
|
56
|
+
function supplementSeparator() {
|
|
57
|
+
return space.or(str(".").then(space.maybe()));
|
|
58
|
+
}
|
|
54
59
|
rule("named_guide_identifier", () => rules["publisher"].then(space, rules["named_number"]));
|
|
55
60
|
rule("identifier", () => rules["meeting_identifier"]
|
|
56
61
|
.or(rules["amendment_identifier"])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubid/pubid",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "TypeScript PubID identifiers: resolution, normalization and canonical hashes for every identifier in the pubid-testsuite corpus (41 standards bodies), with a conformance runner mirroring the Ruby reference",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/vendor/parg/jcgm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidJcgm","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":36}},{"Entity":{"atom":3}},{"Str":{"pattern":"JCGM"}},{"Named":{"name":"publisher","atom":2}},{"Entity":{"atom":5}},{"Str":{"pattern":" "}},{"Entity":{"atom":9}},{"Entity":{"atom":8}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":7,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":6}},{"Entity":{"atom":16}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"nd"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"th"}},{"Alternative":{"atoms":[12,13,14,15]}},{"Entity":{"atom":5}},{"Str":{"pattern":"Meeting"}},{"Named":{"name":"type_with_stage","atom":18}},{"Entity":{"atom":5}},{"Str":{"pattern":"("}},{"Entity":{"atom":31}},{"Entity":{"atom":26}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"20"}},{"Alternative":{"atoms":[24,25]}},{"Entity":{"atom":8}},{"Repetition":{"atom":27,"min":2,"max":null,"tag":"Repetition"}},{"Entity":{"atom":8}},{"Lookahead":{"atom":29,"positive":false}},{"Sequence":{"atoms":[23,28,30]}},{"Named":{"name":"date","atom":22}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[20,21,32,33]}},{"Repetition":{"atom":34,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,10,11,17,19,35]}},{"Entity":{"atom":
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"PubidJcgm","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":36}},{"Entity":{"atom":3}},{"Str":{"pattern":"JCGM"}},{"Named":{"name":"publisher","atom":2}},{"Entity":{"atom":5}},{"Str":{"pattern":" "}},{"Entity":{"atom":9}},{"Entity":{"atom":8}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":7,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":6}},{"Entity":{"atom":16}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"nd"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"th"}},{"Alternative":{"atoms":[12,13,14,15]}},{"Entity":{"atom":5}},{"Str":{"pattern":"Meeting"}},{"Named":{"name":"type_with_stage","atom":18}},{"Entity":{"atom":5}},{"Str":{"pattern":"("}},{"Entity":{"atom":31}},{"Entity":{"atom":26}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"20"}},{"Alternative":{"atoms":[24,25]}},{"Entity":{"atom":8}},{"Repetition":{"atom":27,"min":2,"max":null,"tag":"Repetition"}},{"Entity":{"atom":8}},{"Lookahead":{"atom":29,"positive":false}},{"Sequence":{"atoms":[23,28,30]}},{"Named":{"name":"date","atom":22}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[20,21,32,33]}},{"Repetition":{"atom":34,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,10,11,17,19,35]}},{"Entity":{"atom":106}},{"Entity":{"atom":86}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Entity":{"atom":51}},{"Entity":{"atom":47}},{"Str":{"pattern":"GUM-"}},{"Entity":{"atom":8}},{"Repetition":{"atom":44,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"gum_number","atom":45}},{"Sequence":{"atoms":[43,46]}},{"Entity":{"atom":50}},{"Entity":{"atom":9}},{"Named":{"name":"number","atom":49}},{"Alternative":{"atoms":[42,48]}},{"Entity":{"atom":72}},{"Entity":{"atom":54}},{"Str":{"pattern":":"}},{"Entity":{"atom":67}},{"Entity":{"atom":31}},{"Entity":{"atom":58}},{"Str":{"pattern":"-"}},{"Entity":{"atom":61}},{"Entity":{"atom":8}},{"Repetition":{"atom":60,"min":2,"max":null,"tag":"Repetition"}},{"Entity":{"atom":58}},{"Entity":{"atom":65}},{"Entity":{"atom":8}},{"Repetition":{"atom":64,"min":2,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[56,57,59,62,63]}},{"Named":{"name":"date","atom":66}},{"Entity":{"atom":70}},{"Entity":{"atom":31}},{"Named":{"name":"date","atom":69}},{"Alternative":{"atoms":[55,68]}},{"Sequence":{"atoms":[53,71]}},{"Repetition":{"atom":52,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":84}},{"Str":{"pattern":"("}},{"Str":{"pattern":"E/F"}},{"Str":{"pattern":"F/E"}},{"Alternative":{"atoms":[76,77]}},{"Entity":{"atom":80}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Alternative":{"atoms":[78,79]}},{"Named":{"name":"languages","atom":81}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[75,82,83]}},{"Repetition":{"atom":74,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[39,40,41,73,85]}},{"Named":{"name":"base","atom":38}},{"Entity":{"atom":89}},{"Str":{"pattern":"/"}},{"Str":{"pattern":"Amd"}},{"Named":{"name":"type_with_stage","atom":90}},{"Entity":{"atom":5}},{"Str":{"pattern":"."}},{"Entity":{"atom":5}},{"Repetition":{"atom":94,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[93,95]}},{"Alternative":{"atoms":[92,96]}},{"Entity":{"atom":9}},{"Named":{"name":"number","atom":98}},{"Entity":{"atom":54}},{"Entity":{"atom":67}},{"Entity":{"atom":70}},{"Alternative":{"atoms":[101,102]}},{"Sequence":{"atoms":[100,103]}},{"Repetition":{"atom":104,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[87,88,91,97,99,105]}},{"Entity":{"atom":113}},{"Entity":{"atom":86}},{"Named":{"name":"base","atom":108}},{"Entity":{"atom":5}},{"Str":{"pattern":"Corrigendum"}},{"Named":{"name":"type_with_stage","atom":111}},{"Sequence":{"atoms":[109,110,112]}},{"Entity":{"atom":134}},{"Entity":{"atom":86}},{"Named":{"name":"base","atom":115}},{"Entity":{"atom":89}},{"Str":{"pattern":"Cor"}},{"Named":{"name":"type_with_stage","atom":118}},{"Entity":{"atom":5}},{"Str":{"pattern":"."}},{"Entity":{"atom":5}},{"Repetition":{"atom":122,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[121,123]}},{"Alternative":{"atoms":[120,124]}},{"Entity":{"atom":9}},{"Named":{"name":"number","atom":126}},{"Entity":{"atom":54}},{"Entity":{"atom":67}},{"Entity":{"atom":70}},{"Alternative":{"atoms":[129,130]}},{"Sequence":{"atoms":[128,131]}},{"Repetition":{"atom":132,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[116,117,119,125,127,133]}},{"Entity":{"atom":86}},{"Entity":{"atom":149}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Entity":{"atom":148}},{"Str":{"pattern":"GUM"}},{"Str":{"pattern":"VIM"}},{"Entity":{"atom":58}},{"Entity":{"atom":9}},{"Sequence":{"atoms":[142,143]}},{"Repetition":{"atom":144,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[141,145]}},{"Alternative":{"atoms":[140,146]}},{"Named":{"name":"number","atom":147}},{"Sequence":{"atoms":[137,138,139]}},{"Alternative":{"atoms":[0,37,107,114,135,136]}}],"root":150},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"JCGM 200:2008(F)","expect":{}},{"entry":"identifier","kind":"accept","input":"JCGM 100:2008","expect":{}},{"entry":"identifier","kind":"accept","input":"JCGM 1st Meeting (2004)","expect":{}},{"entry":"identifier","kind":"accept","input":"JCGM 100:2008/Amd.1:2026","expect":{}},{"entry":"identifier","kind":"accept","input":"JCGM 101:2008/Cor.1:2009","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/jcgm/parser.rb: JCGM base, meeting, amendment and\n# corrigendum identifiers, and the named GUM/VIM guides.\n\ngrammar PubidJcgm version \"0.1.0\" {\n century = \"19\" / \"20\"\n year_digits = century 2*digit !digit\n month_digits = 2*digit\n day_digits = 2*digit\n digits = 1*digit\n publisher = \"JCGM\" as publisher\n ordinal_suffix = \"st\" / \"nd\" / \"rd\" / \"th\"\n gum_number = \"GUM-\" (1*digit) as gum_number\n standard_number = digits as number\n number_portion = gum_number / standard_number\n full_date = (year_digits dash month_digits dash day_digits) as date\n year_only = year_digits as date\n date_portion = colon (full_date / year_only)\n language_portion = \"(\" ((\"E/F\" / \"F/E\") / upper) as languages \")\"\n base = publisher space number_portion [date_portion] [language_portion]\n meeting_identifier = publisher space digits as number ordinal_suffix space \"Meeting\" as type_with_stage [(space \"(\" year_digits as date \")\")]\n amendment_identifier = (base as base) slash \"Amd\" as type_with_stage (space / (\".\" [space])) digits as number [(colon (full_date / year_only))]\n corrigendum_identifier = (base as base) space \"Corrigendum\" as type_with_stage\n numbered_corrigendum_identifier = (base as base) slash \"Cor\" as type_with_stage (space / (\".\" [space])) digits as number [(colon (full_date / year_only))]\n named_number = (\"GUM\" / (\"VIM\" [(dash digits)])) as number\n named_guide_identifier = publisher space named_number\n identifier = meeting_identifier / amendment_identifier / corrigendum_identifier / numbered_corrigendum_identifier / base / named_guide_identifier\n upper = %x41-5A\n digit = %x30-39\n slash = \"/\"\n dash = \"-\"\n colon = \":\"\n space = \" \"\n entry identifier: identifier\n\n test {\n accept \"JCGM 200:2008(F)\"\n accept \"JCGM 100:2008\"\n accept \"JCGM 1st Meeting (2004)\"\n accept \"JCGM 100:2008/Amd.1:2026\"\n accept \"JCGM 101:2008/Cor.1:2009\"\n reject \"nonsense\"\n }\n}\n","source_hash":"d380467460b56523c7a36149a52e36904cd94a76406359f763847cfd4b177e8b","compiler_version":"1.3.93","checksum":"sha256:bf00524a2d18b2ab81764b53960b410509b53e924ced7ec438ab2494fcd0fc7e"}
|