nsis.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. <!-- ======================================================== [ NSIS ] -->
  12. <!-- NSIS - Nullsoft Scriptable Install System -->
  13. <parser
  14. displayName="NSIS"
  15. id ="nsis_syntax"
  16. >
  17. <classRange
  18. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  19. \b(?-i:SectionGroup)\b # open indicator
  20. (?s:.*?)
  21. \b(?-i:SectionGroupEnd)\b # close indicator
  22. "
  23. >
  24. <className>
  25. <nameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  26. (?m-s)
  27. SectionGroup\h+(?-i:/e\h+)? # start indicator and its optional switch
  28. \K # keep the text matched so far, out of the overall match
  29. .+$ # whatever, till end-of-line
  30. "
  31. />
  32. <nameExpr expr="[^\r\n\x22]*" />
  33. </className>
  34. <function
  35. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  36. (?m)
  37. ^(?'INDENT'\h*) # optional leading whitespace at start-of-line
  38. (?:
  39. (?-i:!macro)
  40. \h+ # required whitespace separator
  41. \K # keep the text matched so far, out of the overall match
  42. [^\r\n]*$ # whatever, until end-of-line
  43. |
  44. (?'TAG'(?-i:Function|PageEx|Section))
  45. \h+ # required whitespace separator
  46. (?-i:/o\h+)? # optional switch
  47. \K # keep the text matched so far, out of the overall match
  48. (?s:
  49. .*? # whatever,
  50. (?= # up till...
  51. ^\k'INDENT' # ...equal indent at start-of-line for...
  52. \k'TAG'End\b # ...matching close indicator
  53. )
  54. )
  55. |
  56. \x24\x7B # start-of-open-element indicator
  57. (?'ID'[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*)
  58. \x7D # end-of-open-element indicator
  59. \h+ # required whitespace separator
  60. (?-i:/o\h+)? # optional switch
  61. \K # keep the text matched so far, out of the overall match
  62. (?s:
  63. .*? # whatever,
  64. (?= # up till...
  65. ^\k'INDENT' # ...equal indent at start-of-line for...
  66. \x24\x7B\k'ID'End\x7D # ...matching close indicator
  67. )
  68. )
  69. )
  70. "
  71. >
  72. <functionName>
  73. <funcNameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  74. (?m)
  75. [^\r\n]+? # whatever,
  76. (?= # up till...
  77. \h* # ...optional whitespace and...
  78. (?:
  79. \x2F\x2A # ...start of multi line comment or...
  80. | [\x23;] # ...start of single line comment or...
  81. | $ # ...end-of-line
  82. )
  83. )
  84. "
  85. />
  86. </functionName>
  87. </function>
  88. </classRange>
  89. <function
  90. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  91. (?m)
  92. ^(?'INDENT'\h*) # optional leading whitespace at start-of-line
  93. (?:
  94. (?-i:!macro)
  95. \h+ # required whitespace separator
  96. \K # keep the text matched so far, out of the overall match
  97. [^\r\n]*$ # whatever, until end-of-line
  98. |
  99. (?'TAG'(?-i:Function|PageEx|Section))
  100. \h+ # required whitespace separator
  101. (?-i:/o\h+)? # optional switch
  102. \K # keep the text matched so far, out of the overall match
  103. (?s:
  104. .*? # whatever,
  105. (?= # up till...
  106. ^\k'INDENT' # ...equal indent at start-of-line for...
  107. \k'TAG'End\b # ...matching close indicator
  108. )
  109. )
  110. |
  111. \x24\x7B # start-of-open-element indicator
  112. (?'ID'[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*)
  113. \x7D # end-of-open-element indicator
  114. \h+ # required whitespace separator
  115. (?-i:/o\h+)? # optional switch
  116. \K # keep the text matched so far, out of the overall match
  117. (?s:
  118. .*? # whatever,
  119. (?= # up till...
  120. ^\k'INDENT' # ...equal indent at start-of-line for...
  121. \x24\x7B\k'ID'End\x7D # ...matching close indicator
  122. )
  123. )
  124. )
  125. "
  126. >
  127. <functionName>
  128. <nameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  129. (?m)
  130. [^\r\n]+? # whatever,
  131. (?= # up till...
  132. \h* # ...optional whitespace and...
  133. (?:
  134. \x2F\x2A # ...start of multi line comment or...
  135. | [\x23;] # ...start of single line comment or...
  136. | $ # ...end-of-line
  137. )
  138. )
  139. "
  140. />
  141. </functionName>
  142. </function>
  143. </parser>
  144. </functionList>
  145. </NotepadPlus>