batch.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  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. <!-- ================================ [ Batch / Command Shell Script ] -->
  12. <parser
  13. displayName="Batch / Command Shell Script"
  14. id ="batch_label"
  15. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  16. (?m-s:(?i:REM)(?:\h.+)?$) # Single Line Comment 1
  17. | (?m-s::{2}.*$) # Single Line Comment 2
  18. "
  19. >
  20. <function
  21. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  22. (?m-s) # enforce strict line by line search
  23. ^ # label starts at the beginning of a line,...
  24. \h* # ...can be preceded by blank characters and
  25. : # ...starts with a colon
  26. \K # keep the text matched so far, out of the overall match
  27. \w # a label name has to start with a word character,...
  28. [\w.\-]+ # ...the remainder of the name can contain dots and minus signs and
  29. \b # ...ends at a word boundary i.e. discard any trailing characters
  30. "
  31. />
  32. </parser>
  33. </functionList>
  34. </NotepadPlus>