main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
616 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = ebnf
|
---|
| 4 | ebnf.displayName = 'ebnf'
|
---|
| 5 | ebnf.aliases = []
|
---|
| 6 | function ebnf(Prism) {
|
---|
| 7 | Prism.languages.ebnf = {
|
---|
| 8 | comment: /\(\*[\s\S]*?\*\)/,
|
---|
| 9 | string: {
|
---|
| 10 | pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
|
---|
| 11 | greedy: true
|
---|
| 12 | },
|
---|
| 13 | special: {
|
---|
| 14 | pattern: /\?[^?\r\n]*\?/,
|
---|
| 15 | greedy: true,
|
---|
| 16 | alias: 'class-name'
|
---|
| 17 | },
|
---|
| 18 | definition: {
|
---|
| 19 | pattern: /^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,
|
---|
| 20 | lookbehind: true,
|
---|
| 21 | alias: ['rule', 'keyword']
|
---|
| 22 | },
|
---|
| 23 | rule: /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,
|
---|
| 24 | punctuation: /\([:/]|[:/]\)|[.,;()[\]{}]/,
|
---|
| 25 | operator: /[-=|*/!]/
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.