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