hexo/node_modules/prismjs/components/prism-ebnf.js

23 lines
462 B
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
Prism.languages.ebnf = {
'comment': /\(\*[\s\S]*?\*\)/,
'string': {
pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
greedy: true
},
'special': {
pattern: /\?[^?\r\n]*\?/,
greedy: true,
alias: 'class-name'
},
'definition': {
pattern: /^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,
lookbehind: true,
alias: ['rule', 'keyword']
},
'rule': /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,
'punctuation': /\([:/]|[:/]\)|[.,;()[\]{}]/,
'operator': /[-=|*/!]/
};