ruby.xml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. <!-- ======================================================== [ Ruby ] -->
  12. <parser
  13. displayName="Ruby"
  14. id ="ruby_syntax"
  15. >
  16. <!-- within a class-->
  17. <classRange
  18. mainExpr ="^class\x20\K.*?(?=\n\S|\Z)"
  19. >
  20. <className>
  21. <nameExpr expr="\w+" />
  22. </className>
  23. <function
  24. mainExpr="^\s*def\s+\w+"
  25. >
  26. <functionName>
  27. <funcNameExpr expr="def\s\K\w+" />
  28. </functionName>
  29. </function>
  30. </classRange>
  31. <!-- without class-->
  32. <function
  33. mainExpr="^\s*def\s+\w+"
  34. >
  35. <functionName>
  36. <nameExpr expr="def\s\K\w+" />
  37. </functionName>
  38. </function>
  39. </parser>
  40. </functionList>
  41. </NotepadPlus>