-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmode-alsl.js
239 lines (227 loc) · 8.49 KB
/
mode-alsl.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
ace.define("ace/mode/alsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from Assembly x86.tmLanguage (uuid: ) */
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ALSLHighlightRules = function () {
this.$rules = {
start:
[
{
token: 'token comment',
regex: /(\/\/).*/,
caseInsensitive: true
},
{
token: "token comment",
regex:/(\/\*)/,
caseInsensitive:true,
push:[
{
token: "token comment",
regex:/(\*\/)/,
caseInsensitive:true,
next:"pop"
},
{defaultToken:"token comment"}
]
},
{
token: 'token string',
regex: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
caseInsensitive: true
},{
token: 'token char',
regex: /(^|[^\\])'(?:\\.|[^\\"\r\n])'(?!\s:)/,
caseInsensitive: true
},
{
token: 'token.number.dec',
regex: /-?\b[0-9]+\b/,
caseInsensitive: true
},
{
token: 'token.number.hex',
regex: /-?\b(h|0x)[0-9a-f]+\b/,
caseInsensitive: true
},
{
token: 'token.number.bin',
regex: /-?\b(b|0b)[01]+\b/,
caseInsensitive: true
},
{
token: 'token.register',
regex: /(r|\#)[0-9a-f]+/,
caseInsensitive: true
},
{
token: 'token.variable.built-in',
regex: /\$(a|b|c|d|n|kb|x|y|z|random|fcolor|bgcolor)\b/,
caseInsensitive: true
},
{
token: 'token variable flag',
regex: /\$(CF|HCF|PF|SF|ZF|IF|XDF|YDF|OF)/,
caseInsensitive: true
},
{
token: 'token variable flag o',
regex: /\$!(CY|HCY|PE|SNG|ZY|IY|XL|YD|OY|FALSE)/,
caseInsensitive: true
},
{
token: 'token variable flag i',
regex: /\$!(CN|HCN|PO|SPL|ZN|IN|XR|YU|ON|TRUE)/,
caseInsensitive: true
},
{
token: 'token variable user',
regex: /@([A-Z_](|[A-Z0-9_])+)+/,
caseInsensitive: true
},
{
token: 'token variable constant',
regex: /@![A-Z_](|[A-Z0-9_])+/,
caseInsensitive: true
},
{
token: 'token keyword math',
regex: /\b(add|sub|mul|mll|dvv|mod|mnp)\b/,
caseInsensitive: true
},{
token: 'token keyword logic',
regex: /\b(and|nnd|bor|nor|xor|nxr|inv|lnp|lsh|rsh)\b/,
caseInsensitive: true
},{
token: 'token keyword general',
regex: /\b(set|mov|cpy|prg|ext|rtn|osh)\b/,
caseInsensitive: true
},{
token: 'token keyword jump',
regex: /\b(jmp|jie|jne|jez|jnz|jwr|jig|jis|jng|jns|jse|jge)\b/,
caseInsensitive: true
},{
token: 'token keyword humanic',
regex: /\b(var|const|print|dw)\b/,
caseInsensitive: true
},{
token: 'token keyword screen',
regex: /\b(pnt|cls|plt|ptl|swp)\b/,
caseInsensitive: true
},
{
token: 'token link',
regex: /[\[\]]/,
caseInsensitive: true
},
{
token: 'token point user',
regex: /\.[a-z_][a-z0-9_\.]+/,
caseInsensitive: true
}
]
};
this.normalizeRules();
};
ALSLHighlightRules.metaData = { fileTypes: ['alsl'],
name: 'ALSL',
scopeName: 'source.alsl' };
oop.inherits(ALSLHighlightRules, TextHighlightRules);
exports.ALSLHighlightRules = ALSLHighlightRules;
});
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
var re = /\S/;
var line = session.getLine(row);
var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#")
return;
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
var level = line.search(re);
if (level == -1)
continue;
if (line[level] != "#")
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
var indent = line.search(/\S/);
var next = session.getLine(row + 1);
var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/);
if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return "";
}
if (prevIndent == -1) {
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
session.foldWidgets[row - 1] = "";
session.foldWidgets[row + 1] = "";
return "start";
}
}
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = "";
return "";
}
}
if (prevIndent != -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start";
else
session.foldWidgets[row - 1] = "";
if (indent < nextIndent)
return "start";
else
return "";
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/alsl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/alsl_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ALSLHighlightRules = require("./alsl_highlight_rules").ALSLHighlightRules;
var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
this.HighlightRules = ALSLHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = ["//"];
this.$id = "ace/mode/alsl";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/alsl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();