]> luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/roboconf.js
Initial commit.
[flow-web.git] / static / highlight / languages / roboconf.js
1 /*! `roboconf` grammar compiled for Highlight.js 11.11.1 */
2 (function(){
3 var hljsGrammar = (function () {
4 'use strict';
5
6 /*
7 Language: Roboconf
8 Author: Vincent Zurczak <vzurczak@linagora.com>
9 Description: Syntax highlighting for Roboconf's DSL
10 Website: http://roboconf.net
11 Category: config
12 */
13
14 function roboconf(hljs) {
15 const IDENTIFIER = '[a-zA-Z-_][^\\n{]+\\{';
16
17 const PROPERTY = {
18 className: 'attribute',
19 begin: /[a-zA-Z-_]+/,
20 end: /\s*:/,
21 excludeEnd: true,
22 starts: {
23 end: ';',
24 relevance: 0,
25 contains: [
26 {
27 className: 'variable',
28 begin: /\.[a-zA-Z-_]+/
29 },
30 {
31 className: 'keyword',
32 begin: /\(optional\)/
33 }
34 ]
35 }
36 };
37
38 return {
39 name: 'Roboconf',
40 aliases: [
41 'graph',
42 'instances'
43 ],
44 case_insensitive: true,
45 keywords: 'import',
46 contains: [
47 // Facet sections
48 {
49 begin: '^facet ' + IDENTIFIER,
50 end: /\}/,
51 keywords: 'facet',
52 contains: [
53 PROPERTY,
54 hljs.HASH_COMMENT_MODE
55 ]
56 },
57
58 // Instance sections
59 {
60 begin: '^\\s*instance of ' + IDENTIFIER,
61 end: /\}/,
62 keywords: 'name count channels instance-data instance-state instance of',
63 illegal: /\S/,
64 contains: [
65 'self',
66 PROPERTY,
67 hljs.HASH_COMMENT_MODE
68 ]
69 },
70
71 // Component sections
72 {
73 begin: '^' + IDENTIFIER,
74 end: /\}/,
75 contains: [
76 PROPERTY,
77 hljs.HASH_COMMENT_MODE
78 ]
79 },
80
81 // Comments
82 hljs.HASH_COMMENT_MODE
83 ]
84 };
85 }
86
87 return roboconf;
88
89 })();
90
91 hljs.registerLanguage('roboconf', hljsGrammar);
92 })();