From f8f953403367e43380acd07d1989c3bf341c83d0 Mon Sep 17 00:00:00 2001 From: Wei Ting <59229084+hoonweiting@users.noreply.github.com> Date: Mon, 14 Mar 2022 02:08:25 +0800 Subject: [PATCH] GEDCOM: Update `tag` to `record` (#3386) Update `tag` to `record` (GEDCOM 5.5.5 spec terminology update) --- components/prism-gedcom.js | 4 +- components/prism-gedcom.min.js | 2 +- tests/languages/gedcom/level_feature.test | 8 +-- .../languages/gedcom/line-value_feature.test | 12 ++--- tests/languages/gedcom/pointer_feature.test | 6 +-- .../{tag_feature.test => record_feature.test} | 50 +++++++++---------- 6 files changed, 41 insertions(+), 41 deletions(-) rename tests/languages/gedcom/{tag_feature.test => record_feature.test} (67%) diff --git a/components/prism-gedcom.js b/components/prism-gedcom.js index 7fbbc3ddc5..b3ac0d67a2 100644 --- a/components/prism-gedcom.js +++ b/components/prism-gedcom.js @@ -10,11 +10,11 @@ Prism.languages.gedcom = { } } }, - 'tag': { + 'record': { // Preceded by level and optional pointer pattern: /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m, lookbehind: true, - alias: 'string' + alias: 'tag' }, 'level': { pattern: /(^[\t ]*)\d+/m, diff --git a/components/prism-gedcom.min.js b/components/prism-gedcom.min.js index 9b199672c2..c16feee9a1 100644 --- a/components/prism-gedcom.min.js +++ b/components/prism-gedcom.min.js @@ -1 +1 @@ -Prism.languages.gedcom={"line-value":{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,lookbehind:!0,inside:{pointer:{pattern:/^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,alias:"variable"}}},tag:{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,lookbehind:!0,alias:"string"},level:{pattern:/(^[\t ]*)\d+/m,lookbehind:!0,alias:"number"},pointer:{pattern:/@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,alias:"variable"}}; \ No newline at end of file +Prism.languages.gedcom={"line-value":{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,lookbehind:!0,inside:{pointer:{pattern:/^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,alias:"variable"}}},record:{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,lookbehind:!0,alias:"tag"},level:{pattern:/(^[\t ]*)\d+/m,lookbehind:!0,alias:"number"},pointer:{pattern:/@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,alias:"variable"}}; \ No newline at end of file diff --git a/tests/languages/gedcom/level_feature.test b/tests/languages/gedcom/level_feature.test index 08c3963d83..9b1bcd4641 100644 --- a/tests/languages/gedcom/level_feature.test +++ b/tests/languages/gedcom/level_feature.test @@ -6,15 +6,15 @@ [ ["level", "0"], - ["tag", "HEAD"], + ["record", "HEAD"], ["level", "1"], - ["tag", "CHAR"], + ["record", "CHAR"], ["line-value", ["ASCII"]], ["level", "99"], - ["tag", "FOO"], + ["record", "FOO"], ["line-value", ["bar"]] ] ---------------------------------------------------- -Checks for levels. \ No newline at end of file +Checks for levels. diff --git a/tests/languages/gedcom/line-value_feature.test b/tests/languages/gedcom/line-value_feature.test index 4ab43e728b..cf7b6f4670 100644 --- a/tests/languages/gedcom/line-value_feature.test +++ b/tests/languages/gedcom/line-value_feature.test @@ -8,22 +8,22 @@ [ ["level", "1"], - ["tag", "CHIL"], + ["record", "CHIL"], ["line-value", [["pointer", "@CHILD1@"]]], ["level", "2"], - ["tag", "PLAC"], + ["record", "PLAC"], ["line-value", ["ÁĆÉǴÍ,ḰĹḾŃÓ,ṔŔŚÚẂ,ÝŹáćé,ǵíḱĺḿ,ńóṕŕś,úẃýź"]], ["level", "1"], - ["tag", "NAME"], + ["record", "NAME"], ["line-value", ["code: 0313/COMMA ABOVE/"]], ["level", "2"], - ["tag", "DATE"], + ["record", "DATE"], ["line-value", ["@#DGREGORIAN@ 31 DEC 1997"]], ["level", "2"], - ["tag", "CONT"], + ["record", "CONT"], ["line-value", ["Copyright gedcom@@gedcom.org"]] ] ---------------------------------------------------- -Checks for line values. \ No newline at end of file +Checks for line values. diff --git a/tests/languages/gedcom/pointer_feature.test b/tests/languages/gedcom/pointer_feature.test index f39ffb77a6..ea4bd0d5df 100644 --- a/tests/languages/gedcom/pointer_feature.test +++ b/tests/languages/gedcom/pointer_feature.test @@ -12,12 +12,12 @@ ["pointer", "@_$!\"$%&'()*+,-./:;<=>?[\\]^`{|}~ #foobar@"], ["level", "0"], ["pointer", "@SUBMITTER@"], - ["tag", "SUBM"], + ["record", "SUBM"], ["level", "1"], - ["tag", "FAMS"], + ["record", "FAMS"], ["line-value", [["pointer", "@FAMILY@"]]] ] ---------------------------------------------------- -Checks for pointers. \ No newline at end of file +Checks for pointers. diff --git a/tests/languages/gedcom/tag_feature.test b/tests/languages/gedcom/record_feature.test similarity index 67% rename from tests/languages/gedcom/tag_feature.test rename to tests/languages/gedcom/record_feature.test index 2166f64484..6cb38edc0e 100644 --- a/tests/languages/gedcom/tag_feature.test +++ b/tests/languages/gedcom/record_feature.test @@ -1,25 +1,25 @@ -0 HEAD -1 foo_bar -2 _ -3 @pointer@ _Sometag42 -4 247 - ----------------------------------------------------- - -[ - ["level", "0"], - ["tag", "HEAD"], - ["level", "1"], - ["tag", "foo_bar"], - ["level", "2"], - ["tag", "_"], - ["level", "3"], - ["pointer", "@pointer@"], - ["tag", "_Sometag42"], - ["level", "4"], - ["tag", "247"] -] - ----------------------------------------------------- - -Checks for tags. \ No newline at end of file +0 HEAD +1 foo_bar +2 _ +3 @pointer@ _Sometag42 +4 247 + +---------------------------------------------------- + +[ + ["level", "0"], + ["record", "HEAD"], + ["level", "1"], + ["record", "foo_bar"], + ["level", "2"], + ["record", "_"], + ["level", "3"], + ["pointer", "@pointer@"], + ["record", "_Sometag42"], + ["level", "4"], + ["record", "247"] +] + +---------------------------------------------------- + +Checks for records.