From cde0b5b25f15465456b6e2ee6049a433b9f9d634 Mon Sep 17 00:00:00 2001 From: Wei Ting <59229084+hoonweiting@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:34:39 +0800 Subject: [PATCH] Ada: Changed `attr-name` to `attribute`; Use `attr-name` as alias (#3381) --- components/prism-ada.js | 5 +++- components/prism-ada.min.js | 2 +- ...me_feature.test => attribute_feature.test} | 26 +++++++++---------- 3 files changed, 18 insertions(+), 15 deletions(-) rename tests/languages/ada/{attr-name_feature.test => attribute_feature.test} (51%) diff --git a/components/prism-ada.js b/components/prism-ada.js index aef2dd1f30..a537f39b0a 100644 --- a/components/prism-ada.js +++ b/components/prism-ada.js @@ -9,7 +9,10 @@ Prism.languages.ada = { pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i } ], - 'attr-name': /\b'\w+/, + 'attribute': { + pattern: /\b'\w+/, + alias: 'attr-name' + }, 'keyword': /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, 'boolean': /\b(?:false|true)\b/i, 'operator': /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/, diff --git a/components/prism-ada.min.js b/components/prism-ada.min.js index 53e06f6a27..57de170363 100644 --- a/components/prism-ada.min.js +++ b/components/prism-ada.min.js @@ -1 +1 @@ -Prism.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/,number:[{pattern:/\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i},{pattern:/\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i}],"attr-name":/\b'\w+/,keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,boolean:/\b(?:false|true)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,char:/'.'/,variable:/\b[a-z](?:\w)*\b/i}; \ No newline at end of file +Prism.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/,number:[{pattern:/\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i},{pattern:/\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i}],attribute:{pattern:/\b'\w+/,alias:"attr-name"},keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,boolean:/\b(?:false|true)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,char:/'.'/,variable:/\b[a-z](?:\w)*\b/i}; \ No newline at end of file diff --git a/tests/languages/ada/attr-name_feature.test b/tests/languages/ada/attribute_feature.test similarity index 51% rename from tests/languages/ada/attr-name_feature.test rename to tests/languages/ada/attribute_feature.test index c30a2f57d2..edddaadb7b 100644 --- a/tests/languages/ada/attr-name_feature.test +++ b/tests/languages/ada/attribute_feature.test @@ -1,13 +1,13 @@ -Integer'Size -Character'Val - ----------------------------------------------------- - -[ - ["variable", "Integer"], ["attr-name", "'Size"], - ["variable", "Character"], ["attr-name", "'Val"] -] - ----------------------------------------------------- - -Checks for attributes. \ No newline at end of file +Integer'Size +Character'Val + +---------------------------------------------------- + +[ + ["variable", "Integer"], ["attribute", "'Size"], + ["variable", "Character"], ["attribute", "'Val"] +] + +---------------------------------------------------- + +Checks for attributes.