main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | /*
|
---|
| 2 | Language: Roboconf
|
---|
| 3 | Author: Vincent Zurczak <vzurczak@linagora.com>
|
---|
| 4 | Description: Syntax highlighting for Roboconf's DSL
|
---|
| 5 | Website: http://roboconf.net
|
---|
| 6 | Category: config
|
---|
| 7 | */
|
---|
| 8 |
|
---|
| 9 | function roboconf(hljs) {
|
---|
| 10 | const IDENTIFIER = '[a-zA-Z-_][^\\n{]+\\{';
|
---|
| 11 |
|
---|
| 12 | const PROPERTY = {
|
---|
| 13 | className: 'attribute',
|
---|
| 14 | begin: /[a-zA-Z-_]+/,
|
---|
| 15 | end: /\s*:/,
|
---|
| 16 | excludeEnd: true,
|
---|
| 17 | starts: {
|
---|
| 18 | end: ';',
|
---|
| 19 | relevance: 0,
|
---|
| 20 | contains: [
|
---|
| 21 | {
|
---|
| 22 | className: 'variable',
|
---|
| 23 | begin: /\.[a-zA-Z-_]+/
|
---|
| 24 | },
|
---|
| 25 | {
|
---|
| 26 | className: 'keyword',
|
---|
| 27 | begin: /\(optional\)/
|
---|
| 28 | }
|
---|
| 29 | ]
|
---|
| 30 | }
|
---|
| 31 | };
|
---|
| 32 |
|
---|
| 33 | return {
|
---|
| 34 | name: 'Roboconf',
|
---|
| 35 | aliases: [
|
---|
| 36 | 'graph',
|
---|
| 37 | 'instances'
|
---|
| 38 | ],
|
---|
| 39 | case_insensitive: true,
|
---|
| 40 | keywords: 'import',
|
---|
| 41 | contains: [
|
---|
| 42 | // Facet sections
|
---|
| 43 | {
|
---|
| 44 | begin: '^facet ' + IDENTIFIER,
|
---|
| 45 | end: /\}/,
|
---|
| 46 | keywords: 'facet',
|
---|
| 47 | contains: [
|
---|
| 48 | PROPERTY,
|
---|
| 49 | hljs.HASH_COMMENT_MODE
|
---|
| 50 | ]
|
---|
| 51 | },
|
---|
| 52 |
|
---|
| 53 | // Instance sections
|
---|
| 54 | {
|
---|
| 55 | begin: '^\\s*instance of ' + IDENTIFIER,
|
---|
| 56 | end: /\}/,
|
---|
| 57 | keywords: 'name count channels instance-data instance-state instance of',
|
---|
| 58 | illegal: /\S/,
|
---|
| 59 | contains: [
|
---|
| 60 | 'self',
|
---|
| 61 | PROPERTY,
|
---|
| 62 | hljs.HASH_COMMENT_MODE
|
---|
| 63 | ]
|
---|
| 64 | },
|
---|
| 65 |
|
---|
| 66 | // Component sections
|
---|
| 67 | {
|
---|
| 68 | begin: '^' + IDENTIFIER,
|
---|
| 69 | end: /\}/,
|
---|
| 70 | contains: [
|
---|
| 71 | PROPERTY,
|
---|
| 72 | hljs.HASH_COMMENT_MODE
|
---|
| 73 | ]
|
---|
| 74 | },
|
---|
| 75 |
|
---|
| 76 | // Comments
|
---|
| 77 | hljs.HASH_COMMENT_MODE
|
---|
| 78 | ]
|
---|
| 79 | };
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | module.exports = roboconf;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.