perl.xml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. <!-- ======================================================== [ PERL ] -->
  12. <!-- PERL - Practical Extraction and Reporting Language -->
  13. <parser
  14. displayName="PERL"
  15. id ="perl_function"
  16. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  17. (?m-s:\x23.*$) # Single Line Comment
  18. "
  19. >
  20. <function
  21. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  22. sub
  23. \s+
  24. [A-Za-z_]\w*
  25. (\s*\([^()]*\))? # prototype or signature
  26. (\s*\:\s*[^{]+)? # attributes
  27. \s*\{ # start of class body
  28. "
  29. >
  30. <functionName>
  31. <nameExpr expr="(?:sub\s+)?\K[A-Za-z_]\w*" />
  32. </functionName>
  33. <className>
  34. <nameExpr expr="[A-Za-z_]\w*(?=\s*:{2})" />
  35. </className>
  36. </function>
  37. </parser>
  38. </functionList>
  39. </NotepadPlus>