cobol-free.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 free-form reference format -->
  12. <parser id="cobol_section_free" displayName="COBOL free-form reference format">
  13. <!-- working comment Expression:
  14. commentExpr="(?m-s)(?:\*&gt;).*$"
  15. cannot be used because problems with comment boundaries
  16. in current FunctionList implementation, for details see
  17. https://sourceforge.net/p/notepad-plus/patches/597/
  18. -->
  19. <!-- Variant with paragraphs (don't work with comment lines
  20. before section/paragraph header, can be activated when
  21. comment boundaries work and the commentExpr is used) -->
  22. <!--
  23. <function
  24. mainExpr="(?m-s)(?<=\.)\s*(?!exit\s)[\w_-]+(\s+section(\s*|(\s+[\w_-]+)?))(?=\.)"
  25. "
  26. >
  27. <functionName>
  28. <nameExpr expr="(?m-s)(?<=[\s\.])[\w_-]+(\s*section\s*([\w_-]+)?)?"/>
  29. </functionName>
  30. </function>
  31. -->
  32. <!-- Variant without paragraphs (works with comment lines before section header) -->
  33. <function
  34. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  35. [\s\.](?!exit\s)[\w_-]+\s+section(\s*|(\s+[\w_-]+)?)(?=\.) # all names that come before `section` but not `exit section`
  36. "
  37. >
  38. <functionName>
  39. <nameExpr expr="[\w_-]+\s*section"/>
  40. </functionName>
  41. </function>
  42. </parser>
  43. </functionList>
  44. </NotepadPlus>