prism-ebnf.js 462 B

12345678910111213141516171819202122
  1. Prism.languages.ebnf = {
  2. 'comment': /\(\*[\s\S]*?\*\)/,
  3. 'string': {
  4. pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
  5. greedy: true
  6. },
  7. 'special': {
  8. pattern: /\?[^?\r\n]*\?/,
  9. greedy: true,
  10. alias: 'class-name'
  11. },
  12. 'definition': {
  13. pattern: /^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,
  14. lookbehind: true,
  15. alias: ['rule', 'keyword']
  16. },
  17. 'rule': /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,
  18. 'punctuation': /\([:/]|[:/]\)|[.,;()[\]{}]/,
  19. 'operator': /[-=|*/!]/
  20. };