bnf.js 735 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. Language: Backus–Naur Form
  3. Website: https://en.wikipedia.org/wiki/Backus–Naur_form
  4. Category: syntax
  5. Author: Oleg Efimov <efimovov@gmail.com>
  6. */
  7. /** @type LanguageFn */
  8. function bnf(hljs) {
  9. return {
  10. name: 'Backus–Naur Form',
  11. contains: [
  12. // Attribute
  13. {
  14. className: 'attribute',
  15. begin: /</,
  16. end: />/
  17. },
  18. // Specific
  19. {
  20. begin: /::=/,
  21. end: /$/,
  22. contains: [
  23. {
  24. begin: /</,
  25. end: />/
  26. },
  27. // Common
  28. hljs.C_LINE_COMMENT_MODE,
  29. hljs.C_BLOCK_COMMENT_MODE,
  30. hljs.APOS_STRING_MODE,
  31. hljs.QUOTE_STRING_MODE
  32. ]
  33. }
  34. ]
  35. };
  36. }
  37. export { bnf as default };