]> luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/axapta.js
Initial commit.
[flow-web.git] / static / highlight / es / languages / axapta.js
1 /*! `axapta` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar = (function () {
3 'use strict';
4
5 /*
6 Language: Microsoft X++
7 Description: X++ is a language used in Microsoft Dynamics 365, Dynamics AX, and Axapta.
8 Author: Dmitri Roudakov <dmitri@roudakov.ru>
9 Website: https://dynamics.microsoft.com/en-us/ax-overview/
10 Category: enterprise
11 */
12
13 /** @type LanguageFn */
14 function axapta(hljs) {
15 const IDENT_RE = hljs.UNDERSCORE_IDENT_RE;
16 const BUILT_IN_KEYWORDS = [
17 'anytype',
18 'boolean',
19 'byte',
20 'char',
21 'container',
22 'date',
23 'double',
24 'enum',
25 'guid',
26 'int',
27 'int64',
28 'long',
29 'real',
30 'short',
31 'str',
32 'utcdatetime',
33 'var'
34 ];
35
36 const LITERAL_KEYWORDS = [
37 'default',
38 'false',
39 'null',
40 'true'
41 ];
42
43 const NORMAL_KEYWORDS = [
44 'abstract',
45 'as',
46 'asc',
47 'avg',
48 'break',
49 'breakpoint',
50 'by',
51 'byref',
52 'case',
53 'catch',
54 'changecompany',
55 'class',
56 'client',
57 'client',
58 'common',
59 'const',
60 'continue',
61 'count',
62 'crosscompany',
63 'delegate',
64 'delete_from',
65 'desc',
66 'display',
67 'div',
68 'do',
69 'edit',
70 'else',
71 'eventhandler',
72 'exists',
73 'extends',
74 'final',
75 'finally',
76 'firstfast',
77 'firstonly',
78 'firstonly1',
79 'firstonly10',
80 'firstonly100',
81 'firstonly1000',
82 'flush',
83 'for',
84 'forceliterals',
85 'forcenestedloop',
86 'forceplaceholders',
87 'forceselectorder',
88 'forupdate',
89 'from',
90 'generateonly',
91 'group',
92 'hint',
93 'if',
94 'implements',
95 'in',
96 'index',
97 'insert_recordset',
98 'interface',
99 'internal',
100 'is',
101 'join',
102 'like',
103 'maxof',
104 'minof',
105 'mod',
106 'namespace',
107 'new',
108 'next',
109 'nofetch',
110 'notexists',
111 'optimisticlock',
112 'order',
113 'outer',
114 'pessimisticlock',
115 'print',
116 'private',
117 'protected',
118 'public',
119 'readonly',
120 'repeatableread',
121 'retry',
122 'return',
123 'reverse',
124 'select',
125 'server',
126 'setting',
127 'static',
128 'sum',
129 'super',
130 'switch',
131 'this',
132 'throw',
133 'try',
134 'ttsabort',
135 'ttsbegin',
136 'ttscommit',
137 'unchecked',
138 'update_recordset',
139 'using',
140 'validtimestate',
141 'void',
142 'where',
143 'while'
144 ];
145
146 const KEYWORDS = {
147 keyword: NORMAL_KEYWORDS,
148 built_in: BUILT_IN_KEYWORDS,
149 literal: LITERAL_KEYWORDS
150 };
151
152 const CLASS_DEFINITION = {
153 variants: [
154 { match: [
155 /(class|interface)\s+/,
156 IDENT_RE,
157 /\s+(extends|implements)\s+/,
158 IDENT_RE
159 ] },
160 { match: [
161 /class\s+/,
162 IDENT_RE
163 ] }
164 ],
165 scope: {
166 2: "title.class",
167 4: "title.class.inherited"
168 },
169 keywords: KEYWORDS
170 };
171
172 return {
173 name: 'X++',
174 aliases: [ 'x++' ],
175 keywords: KEYWORDS,
176 contains: [
177 hljs.C_LINE_COMMENT_MODE,
178 hljs.C_BLOCK_COMMENT_MODE,
179 hljs.APOS_STRING_MODE,
180 hljs.QUOTE_STRING_MODE,
181 hljs.C_NUMBER_MODE,
182 {
183 className: 'meta',
184 begin: '#',
185 end: '$'
186 },
187 CLASS_DEFINITION
188 ]
189 };
190 }
191
192 return axapta;
193
194 })();
195 ;
196 export default hljsGrammar;