inno.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. <!-- ================================================== [ Inno Setup ] -->
  12. <parser
  13. displayName="Inno Setup"
  14. id ="innosetup_syntax"
  15. >
  16. <classRange
  17. mainExpr ="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  18. (?ms)
  19. (?'SECTION_HEADER'
  20. ^ # header starts at beginning of a line
  21. \[ # start of section header
  22. (?-i:Code) # `Code` section name
  23. ] # end of section header
  24. )
  25. .*? # whatever, up till...
  26. (?= # ...next valid section header or...
  27. ^ # +-- header starts at beginning of a line
  28. \[ # +-- start-of-header indicator
  29. (?-i:
  30. Components|(?:Custom)?Messages
  31. | Dirs
  32. | Files
  33. | I(?:cons|nstallDelete)
  34. | Languages
  35. | R(?:egistry|un)
  36. | Setup
  37. | T(?:asks|ypes)
  38. | Uninstall(?:Delete|Run)
  39. ) # +-- valid section name
  40. ] # \-- end-of-header indicator
  41. | \Z # ...end-of-file
  42. )
  43. "
  44. >
  45. <className>
  46. <nameExpr expr="^\[\K[^\h\]]+(?=])" />
  47. </className>
  48. <function
  49. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  50. (?m-s)^\h* # optional leading whitespace
  51. (?i:FUNCTION\h+)
  52. (?'VALID_ID'
  53. [A-Za-z_]\w*
  54. )
  55. \s*\( # start-of-parameter-list indicator
  56. [^()]* # parameter list
  57. \s*\) # end-of-parameter-list indicator
  58. \s*: # type indicator
  59. \s*[A-Za-z_]\w* # type identifier
  60. \s*; # end-of-statement indicator
  61. "
  62. >
  63. <functionName>
  64. <funcNameExpr expr="(?i:FUNCTION\h+)\K[A-Za-z_]\w*\s*\([^()]*\)" />
  65. <!-- comment out the following node to display the method with its parameters -->
  66. <funcNameExpr expr="[A-Za-z_]\w*" />
  67. </functionName>
  68. </function>
  69. </classRange>
  70. <function
  71. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  72. (?ms)
  73. (?'SECTION_HEADER'
  74. ^ # header starts at beginning of a line
  75. \[ # start-of-header indicator
  76. (?-i:
  77. Components|(?:Custom)?Messages
  78. | Dirs
  79. | Files
  80. | I(?:cons|nstallDelete)
  81. | Languages
  82. | R(?:egistry|un)
  83. | Setup
  84. | T(?:asks|ypes)
  85. | Uninstall(?:Delete|Run)
  86. ) # valid section name
  87. ] # end-of-header indicator
  88. )
  89. .*? # whatever, up till...
  90. (?=
  91. (?&amp;SECTION_HEADER) # ...next valid section header,...
  92. | ^\[(?-i:Code)] # ...`Code` section header or...
  93. | \Z # ...end-of-file
  94. )
  95. "
  96. >
  97. <functionName>
  98. <nameExpr expr="^\[\K[^\]]+(?=])" />
  99. </functionName>
  100. </function>
  101. </parser>
  102. </functionList>
  103. </NotepadPlus>