summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-ebnf.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/prism/prism-ebnf.js')
-rw-r--r--public/prism/prism-ebnf.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/public/prism/prism-ebnf.js b/public/prism/prism-ebnf.js
new file mode 100644
index 0000000..136b3df
--- /dev/null
+++ b/public/prism/prism-ebnf.js
@@ -0,0 +1,22 @@
+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: /[-=|*/!]/,
+};