Add BaanC Sections in functionlist.xml
Based on https://notepad-plus-plus.org/community/topic/14494/functionlist-classrange-question Closes #3842
This commit is contained in:
parent
c8a15a5225
commit
16b62c9f45
@ -89,6 +89,7 @@
|
||||
<association id= "innosetup_syntax" langID="46" />
|
||||
<association id= "powershell_function" langID="53" />
|
||||
<association id= "javascript_function" langID="58" />
|
||||
<association id= "baanc_section" langID="60" />
|
||||
<!-- ======================================================================== -->
|
||||
<association id= "krl_function" userDefinedLangName="KRL" />
|
||||
<association id= "krl_function" ext=".src" />
|
||||
@ -1295,6 +1296,178 @@
|
||||
/>
|
||||
</parser>
|
||||
|
||||
<!-- ======================================================= [ BaanC ] -->
|
||||
|
||||
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| Based on:
|
||||
| https://notepad-plus-plus.org/community/topic/14494/functionlist-classrange-question
|
||||
|
|
||||
| Note(s):
|
||||
| 1. Boost::Regex 1.58-1.59 do not correctly handle quantifiers on subroutine calls
|
||||
| therefore the additional non-capturing group i.e. "(?:(?&COMMENT))?" instead
|
||||
| of simply "(?&COMMENT)?"
|
||||
\-->
|
||||
<parser
|
||||
displayName="BaanC Sections"
|
||||
id ="baanc_section"
|
||||
>
|
||||
<classRange
|
||||
mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
|
||||
(?im) # case-insensitive, ^ and $ match at line breaks
|
||||
(?(DEFINE) # definition of sub-routines
|
||||
(?'SECTION'
|
||||
^\h* # optional leading whitespace at start-of-line
|
||||
(?: # known section names
|
||||
(?:after|before)\.(?:report\.\d+|\w+(?:\.\w+)*\.\d+)
|
||||
| (?:field|zoom\.from)\.(?:all|other|\w+(?:\.\w+)*)
|
||||
| (?:footer|group|header)\.\d+
|
||||
| choice\.\w+(?:\.\w+)*
|
||||
| detail\.\d+
|
||||
| form\.(?:all|other|\d+)
|
||||
| functions
|
||||
| main\.table\.io
|
||||
): # end-of-section-header indicator
|
||||
)
|
||||
(?'SECTION_EMPTY'
|
||||
^\h* # optional leading whitespace at start-of-line
|
||||
(?: # known `empty` section names
|
||||
after\.(?:form\.read|program|receive\.data|update\.db\.commit)
|
||||
| before\.(?:(?:display|new)\.object|program)
|
||||
| declaration
|
||||
| on\.(?:display\.total\.line|error)
|
||||
): # end-of-section-header indicator
|
||||
)
|
||||
)
|
||||
(?&SECTION) # section header
|
||||
(?s:.*?) # whatever,
|
||||
(?= # ...up till
|
||||
\s*
|
||||
(?:
|
||||
(?&SECTION) # ...next section header,
|
||||
| (?&SECTION_EMPTY) # ...next `empty` section header
|
||||
| \Z # ...or end-of-text
|
||||
)
|
||||
)
|
||||
"
|
||||
>
|
||||
<className>
|
||||
<nameExpr expr="^\h*\K\w+(?:\.\w+)*:" />
|
||||
</className>
|
||||
<function
|
||||
mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
|
||||
(?im) # case-insensitive, ^ and $ match at line breaks
|
||||
(?(DEFINE) # definition of sub-routines
|
||||
(?'COMMENT'
|
||||
\s*\x7C[^\r\n]* # trailing comment
|
||||
(?: # optional subsequent comment
|
||||
(?:\r?\n|\n?\r) # - mandatory line-break
|
||||
\s*\x7C[^\r\n]* # - `trailing` comment
|
||||
)*
|
||||
)
|
||||
)
|
||||
^\h* # optional leading whitespace at start-of-line
|
||||
(?:
|
||||
\K # discard text matched so far
|
||||
(?: # known sub-section names
|
||||
after\.(?:choice|d(?:elete|isplay)|f(?:ield|orm)|group|input|layout|re(?:ad|write)|skip\.(?:delete|(?:re)?write)|write|zoom)
|
||||
| before\.(?:ch(?:ecks|oice)|d(?:elete|isplay)|f(?:ield|orm)|group|input|layout|print|re(?:ad|write)|write|zoom)
|
||||
| check\.input
|
||||
| domain\.error
|
||||
| init\.(?:f(?:ield|orm)|group)
|
||||
| on\.(?:choice|e(?:ntry|xit)|input)
|
||||
| read\.view
|
||||
| ref\.(?:display|input)
|
||||
| selection\.filter
|
||||
| when\.field\.changes
|
||||
): # end-of-sub-section-header indicator
|
||||
|
|
||||
function # keyword, start-of-function-header indicator
|
||||
(?:(?&COMMENT))? # optional `embedded` comment
|
||||
(?: # optional storage-class specifier
|
||||
\s+extern
|
||||
(?:(?&COMMENT))? # ...with optional `embedded` comment
|
||||
)?
|
||||
(?: # optional function type specifier
|
||||
\s+(?:
|
||||
boolean
|
||||
| double
|
||||
| long
|
||||
| string
|
||||
| void
|
||||
| domain
|
||||
(?:(?&COMMENT))? # ...with optional `embedded` comment
|
||||
\s+\w+(?:\.\w+)*
|
||||
)
|
||||
(?:(?&COMMENT))? # ...with optional `embedded` comment
|
||||
)?
|
||||
\s+
|
||||
\K # discard text matched so far
|
||||
\w+(?:\.\w+)* # function identifier
|
||||
(?:(?&COMMENT)(?:\r?\n|\n?\r))? # optional `embedded` comment
|
||||
\s*\( # start-of-parameter-list indicator
|
||||
)
|
||||
"
|
||||
>
|
||||
<functionName>
|
||||
<funcNameExpr expr="\w+(?:\.\w+)*(?:\h*:)?" />
|
||||
</functionName>
|
||||
</function>
|
||||
</classRange>
|
||||
<function
|
||||
mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
|
||||
(?im) # case-insensitive, ^ and $ match at line breaks
|
||||
(?(DEFINE) # definition of sub-routines
|
||||
(?'COMMENT'
|
||||
\s*\x7C[^\r\n]* # trailing comment
|
||||
(?: # optional subsequent comment
|
||||
(?:\r?\n|\n?\r) # - mandatory line-break
|
||||
\s*\x7C[^\r\n]* # - `trailing` comment
|
||||
)*
|
||||
)
|
||||
)
|
||||
^\h* # optional leading whitespace at start-of-line
|
||||
(?:
|
||||
\K # discard text matched so far
|
||||
(?: # known `empty` section names
|
||||
after\.(?:form\.read|program|receive\.data|update\.db\.commit)
|
||||
| before\.(?:display\.object|new\.object|program)
|
||||
| declaration
|
||||
| on\.(?:display\.total\.line|error)
|
||||
): # end-of-section-header indicator
|
||||
|
|
||||
function # keyword, start-of-function-header indicator
|
||||
(?:(?&COMMENT))? # optional `embedded` comment
|
||||
(?: # optional storage-class specifier
|
||||
\s+extern
|
||||
(?:(?&COMMENT))? # ...with optional `embedded` comment
|
||||
)?
|
||||
(?: # optional function type specifier
|
||||
\s+(?:
|
||||
boolean
|
||||
| double
|
||||
| long
|
||||
| string
|
||||
| void
|
||||
| domain
|
||||
(?:(?&COMMENT))? # ...with optional `embedded` comment
|
||||
\s+\w+(?:\.\w+)*
|
||||
)
|
||||
(?:(?&COMMENT))? # ...with optional `embedded` comment
|
||||
)?
|
||||
\s+
|
||||
\K # discard text matched so far
|
||||
\w+(?:\.\w+)* # function identifier
|
||||
(?:(?&COMMENT)(?:\r?\n|\n?\r))? # optional `embedded` comment
|
||||
\s*\( # start-of-parameter-list indicator
|
||||
)
|
||||
"
|
||||
>
|
||||
<functionName>
|
||||
<nameExpr expr="\w+(?:\.\w+)*(?:\h*:)?" />
|
||||
</functionName>
|
||||
</function>
|
||||
</parser>
|
||||
|
||||
<!-- ================================================================= -->
|
||||
</parsers>
|
||||
</functionList>
|
||||
|
Loading…
Reference in New Issue
Block a user