From 8ab9b99b73f0ba1d111cca884b4e96e8033469f0 Mon Sep 17 00:00:00 2001 From: notdodgeball <99600325+notdodgeball@users.noreply.github.com> Date: Fri, 12 Apr 2024 15:47:28 -0300 Subject: [PATCH] Ada Function List improvements Changes: Ada is case insensitive Added 'Parallel' reserved word Identifiers may not begin or end with underscore Support for identifiers containing digits Support for Ada specifications file (subprogram declaration) (#14687) Support for dot notation within types (#14908) Support for generic instantiations (#14498) (functions with no return statement) Fix #14908, fix #14687, fix #14498, close #14986 --- PowerEditor/installer/functionList/ada.xml | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/PowerEditor/installer/functionList/ada.xml b/PowerEditor/installer/functionList/ada.xml index 195cc4711..f4157a8c1 100644 --- a/PowerEditor/installer/functionList/ada.xml +++ b/PowerEditor/installer/functionList/ada.xml @@ -9,6 +9,8 @@ @@ -23,10 +25,10 @@ mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`) ^\h* # optional leading whitespace at start-of-line (?: - (?-i:function) + (?i:function) \s+ (?'VALID_ID' # valid identifier, use as subroutine - \b(?!(?-i: # keywords (case-sensitive), not to be used as identifier + \b(?!(?i: # keywords (case-insensitive), not to be used as identifier a(?:b(?:ort|s(?:tract)?)|cce(?:pt|ss)|l(?:iased|l)|nd|rray|t) | b(?:egin|ody) | c(?:ase|onstant) @@ -39,7 +41,7 @@ | mod | n(?:ew|ot|ull) | o(?:[fr]|thers|ut|verriding) - | p(?:ackage|r(?:agma|ivate|o(?:cedure|tected))) + | p(?:a(?:ckage|rallel)|r(?:agma|ivate|o(?:cedure|tected))) | r(?:a(?:is|ng)e|e(?:cord|m|names|queue|turn|verse)) | s(?:e(?:lect|parate)|ome|ubtype|ynchronized) | t(?:a(?:gged|sk)|erminate|hen|ype) @@ -47,7 +49,7 @@ | w(?:h(?:en|ile)|ith) | xor )\b) - [A-Za-z_]\w* # valid character combination for identifiers + [[:alpha:]](?:[\w.]*[[:alnum:]])? # valid character combination for identifiers ) (?'PARAMETERS' \s* @@ -55,32 +57,34 @@ [^()]* # parameters \) # end-of-parameters indicator )? # parentheses and parameters optional - \s*return # function returns a value with... + \s* + (?:return # function returns a value with... \s+(?&VALID_ID) # ...type-name + )? | - (?-i:procedure) + (?i:procedure) \s+(?&VALID_ID) - (?:(?&PARAMETERS))? # Boost::Regex 1.58-1.59 do not correctly handle quantifiers on subroutine calls + (?&PARAMETERS)? ) - \s*(?-i:\bis\b) # end-of-definition indicator + \s*(?i:\bis\b|;) # end-of-definition indicator " > - + - \ No newline at end of file +