cobol.xml 1.3 KB

123456789101112131415161718192021222324252627
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- ==========================================================================\
  3. |
  4. | To learn how to make your own language parser, please check the following
  5. | link:
  6. | https://npp-user-manual.org/docs/function-list/
  7. |
  8. \=========================================================================== -->
  9. <NotepadPlus>
  10. <functionList>
  11. <!-- Variant for COBOL fixed-form reference format -->
  12. <parser id="cobol_section_fixed" displayName="COBOL fixed-form reference format">
  13. <function
  14. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  15. (?m-s)(^.{6}[ D]) # ignore first 6 columns, 7 must be empty or D (debug-line)
  16. ([\t ]{0,3}) # don't start after column 12
  17. (?!exit\s)[\w_-]+(\.|((?'seps'([\t ]|\*&gt;.*|([\n\r]+(.{6}([ D]|\*.*)|.{0,6}$)))+)section(\.|((?&amp;seps)(\.|[\w_-]+\.)))))
  18. # all names that come before `section` but not `exit section`
  19. "
  20. >
  21. <functionName>
  22. <nameExpr expr="[\w_-]+((?=\.)|((?'seps'([\t ]|\*&gt;.*|([\n\r]+(.{6}([ D]|\*.*)|.{0,6}$)))+)section((?=\.)|(?&amp;seps)((?=\.)|[\w_-]+(?=\.)))))"/>
  23. </functionName>
  24. </function>
  25. </parser>
  26. </functionList>
  27. </NotepadPlus>