prism-bnf.js 383 B

123456789101112131415161718192021
  1. Prism.languages.bnf = {
  2. 'string': {
  3. pattern: /"[^\r\n"]*"|'[^\r\n']*'/
  4. },
  5. 'definition': {
  6. pattern: /<[^<>\r\n\t]+>(?=\s*::=)/,
  7. alias: ['rule', 'keyword'],
  8. inside: {
  9. 'punctuation': /^<|>$/
  10. }
  11. },
  12. 'rule': {
  13. pattern: /<[^<>\r\n\t]+>/,
  14. inside: {
  15. 'punctuation': /^<|>$/
  16. }
  17. },
  18. 'operator': /::=|[|()[\]{}*+?]|\.{3}/
  19. };
  20. Prism.languages.rbnf = Prism.languages.bnf;