mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
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
This commit is contained in:
parent
aa6a55cb7e
commit
8ab9b99b73
@ -9,6 +9,8 @@
|
|||||||
<NotepadPlus>
|
<NotepadPlus>
|
||||||
<functionList>
|
<functionList>
|
||||||
<!--
|
<!--
|
||||||
|
| Complies to ADA 2022
|
||||||
|
| http://www.ada-auth.org/standards/overview22.html
|
||||||
| Based on:
|
| Based on:
|
||||||
| http://stackoverflow.com/questions/32126855/notepad-and-ada
|
| http://stackoverflow.com/questions/32126855/notepad-and-ada
|
||||||
\-->
|
\-->
|
||||||
@ -23,10 +25,10 @@
|
|||||||
mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
|
mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
|
||||||
^\h* # optional leading whitespace at start-of-line
|
^\h* # optional leading whitespace at start-of-line
|
||||||
(?:
|
(?:
|
||||||
(?-i:function)
|
(?i:function)
|
||||||
\s+
|
\s+
|
||||||
(?'VALID_ID' # valid identifier, use as subroutine
|
(?'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)
|
a(?:b(?:ort|s(?:tract)?)|cce(?:pt|ss)|l(?:iased|l)|nd|rray|t)
|
||||||
| b(?:egin|ody)
|
| b(?:egin|ody)
|
||||||
| c(?:ase|onstant)
|
| c(?:ase|onstant)
|
||||||
@ -39,7 +41,7 @@
|
|||||||
| mod
|
| mod
|
||||||
| n(?:ew|ot|ull)
|
| n(?:ew|ot|ull)
|
||||||
| o(?:[fr]|thers|ut|verriding)
|
| 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))
|
| r(?:a(?:is|ng)e|e(?:cord|m|names|queue|turn|verse))
|
||||||
| s(?:e(?:lect|parate)|ome|ubtype|ynchronized)
|
| s(?:e(?:lect|parate)|ome|ubtype|ynchronized)
|
||||||
| t(?:a(?:gged|sk)|erminate|hen|ype)
|
| t(?:a(?:gged|sk)|erminate|hen|ype)
|
||||||
@ -47,7 +49,7 @@
|
|||||||
| w(?:h(?:en|ile)|ith)
|
| w(?:h(?:en|ile)|ith)
|
||||||
| xor
|
| xor
|
||||||
)\b)
|
)\b)
|
||||||
[A-Za-z_]\w* # valid character combination for identifiers
|
[[:alpha:]](?:[\w.]*[[:alnum:]])? # valid character combination for identifiers
|
||||||
)
|
)
|
||||||
(?'PARAMETERS'
|
(?'PARAMETERS'
|
||||||
\s*
|
\s*
|
||||||
@ -55,30 +57,32 @@
|
|||||||
[^()]* # parameters
|
[^()]* # parameters
|
||||||
\) # end-of-parameters indicator
|
\) # end-of-parameters indicator
|
||||||
)? # parentheses and parameters optional
|
)? # parentheses and parameters optional
|
||||||
\s*return # function returns a value with...
|
\s*
|
||||||
|
(?:return # function returns a value with...
|
||||||
\s+(?&VALID_ID) # ...type-name
|
\s+(?&VALID_ID) # ...type-name
|
||||||
|
)?
|
||||||
|
|
|
|
||||||
(?-i:procedure)
|
(?i:procedure)
|
||||||
\s+(?&VALID_ID)
|
\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
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<functionName>
|
<functionName>
|
||||||
<nameExpr expr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
|
<nameExpr expr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
|
||||||
(?:function|procedure)\s+
|
(?:function|procedure)\s+
|
||||||
\K # discard text matched so far
|
\K # discard text matched so far
|
||||||
[A-Za-z_]\w*
|
[[:alpha:]](?:[\w.]*[[:alnum:]])?
|
||||||
(?:\s*\([^()]*\))? # parentheses and parameters optional
|
(?:\s*\([^()]*\))? # parentheses and parameters optional
|
||||||
(?=
|
(?=
|
||||||
\s*
|
\s*
|
||||||
\b(?:return|is)
|
(?:\breturn|\bis|;)
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<!-- comment out the following node to display the method with its parameters -->
|
<!-- comment out the following node to display the method with its parameters -->
|
||||||
<!-- <nameExpr expr="[A-Za-z_]\w*" /> -->
|
<!-- <nameExpr expr="[[:alpha:]](?:[\w.]*[[:alnum:]])?" /> -->
|
||||||
</functionName>
|
</functionName>
|
||||||
</function>
|
</function>
|
||||||
</parser>
|
</parser>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user