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