Enhance COBOL language support - function list & auto-completion

COBOL support in function list - new entries in functionList.xml (note: defaults to fixed-form reference format, manual switch to free-form reference-format possible in association for langID 50)

COBOL support in auto-completion - new file APIs/cobol.xml
COBOL syntax highlighter - recreated list

note: list of statements, functions and reserved words token from GnuCOBOL 3.0 (COBOL85,2002,2014 + extensions from IBM/MF/RM/ACUCOBOL), please report back if any words are missing

Close #4004
This commit is contained in:
Simon Sobisch 2017-12-14 09:20:46 +01:00 committed by Don HO
parent 61abf06bf3
commit a5ec6be8a9
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 1307 additions and 5 deletions

File diff suppressed because it is too large Load Diff

View File

@ -86,9 +86,13 @@
<association id= "ruby_syntax" langID="36" /> <association id= "ruby_syntax" langID="36" />
<association id= "autoit3_function" langID="40" /> <association id= "autoit3_function" langID="40" />
<association id= "innosetup_syntax" langID="46" /> <association id= "innosetup_syntax" langID="46" />
<!--
As there is currently only one langID for COBOL: change to cobol_section_free
if this is your favourite format
-->
<association id= "cobol_section_fixed" langID="50" />
<association id= "powershell_function" langID="53" /> <association id= "powershell_function" langID="53" />
<association id= "javascript_function" langID="58" /> <association id= "javascript_function" langID="58" />
<!-- ======================================================================== -->
<association id= "baanc_section" langID="60" /> <association id= "baanc_section" langID="60" />
<!-- ======================================================================== --> <!-- ======================================================================== -->
<association id= "krl_function" userDefinedLangName="KRL" /> <association id= "krl_function" userDefinedLangName="KRL" />
@ -1382,6 +1386,55 @@
</function> </function>
</parser> </parser>
<!-- Variant for COBOL fixed-form reference format -->
<parser id="cobol_section_fixed" displayName="COBOL fixed-form reference format">
<function
mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
(?m-s)(^.{6}[ D]) # ignore first 6 columns, 7 must be empty or D (debug-line)
([\t ]{0,3}) # don't start after column 12
(?!exit\s)[\w_-]+(\.|((?'seps'([\t ]|\*&gt;.*|([\n\r]+(.{6}([ D]|\*.*)|.{0,6}$)))+)section(\.|((?&amp;seps)(\.|[\w_-]+\.)))))
# all names that come before `section` but not `exit section`
"
>
<functionName>
<nameExpr expr="[\w_-]+((?=\.)|((?'seps'([\t ]|\*&gt;.*|([\n\r]+(.{6}([ D]|\*.*)|.{0,6}$)))+)section((?=\.)|(?&amp;seps)((?=\.)|[\w_-]+(?=\.)))))"/>
</functionName>
</function>
</parser>
<!-- Variant for COBOL free-form reference format -->
<parser id="cobol_section_free" displayName="COBOL free-form reference format">
<!-- working comment Expression:
commentExpr="(?m-s)(?:\*&gt;).*$"
cannot be used because problems with comment boundaries
in current FunctionList implementation, for details see
https://sourceforge.net/p/notepad-plus/patches/597/
-->
<!-- Variant with paragraphs (don't work with comment lines
before section/paragraph header, can be activated when
comment boundaries work and the commentExpr is used) -->
<!--
<function
mainExpr="(?m-s)(?<=\.)\s*(?!exit\s)[\w_-]+(\s+section(\s*|(\s+[\w_-]+)?))(?=\.)"
"
>
<functionName>
<nameExpr expr="(?m-s)(?<=[\s\.])[\w_-]+(\s*section\s*([\w_-]+)?)?"/>
</functionName>
</function>
-->
<!-- Variant without paragraphs (works with comment lines before section header) -->
<function
mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
[\s\.](?!exit\s)[\w_-]+\s+section(\s*|(\s+[\w_-]+)?)(?=\.) # all names that come before `section` but not `exit section`
"
>
<functionName>
<nameExpr expr="[\w_-]+\s*section"/>
</functionName>
</function>
</parser>
<!-- ================================================================= --> <!-- ================================================================= -->
</parsers> </parsers>
</functionList> </functionList>

File diff suppressed because one or more lines are too long