powershell.xml 1.3 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. <!-- ================================================== [ PowerShell ] -->
  12. <parser
  13. displayName="PowerShell"
  14. id ="powershell_function"
  15. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  16. (?s:\x3C\x23(?:[^\x23]|\x23[^\x3E])*\x23\x3E) # Multi Line Comment
  17. | (?m-s:\x23.*$) # Single Line Comment
  18. "
  19. >
  20. <function
  21. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  22. \b
  23. (?:function|filter)
  24. \s+
  25. (?:
  26. [A-Za-z_]\w*
  27. :
  28. )?
  29. [A-Za-z_][\w\-]*
  30. \s*
  31. [({]
  32. "
  33. >
  34. <functionName>
  35. <nameExpr expr="[A-Za-z_][\w\-]*(?=\s*[({])" />
  36. </functionName>
  37. <className>
  38. <nameExpr expr="[A-Za-z_]\w*(?=:)" />
  39. </className>
  40. </function>
  41. </parser>
  42. </functionList>
  43. </NotepadPlus>