Debian Codegraph @

extensions/CodeEditor/modules/lib/ace/mode-jssm.js

raw symbols SCIP
1 ace.define("ace/mode/jssm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ./jssm.tmLanguage (uuid: ) */
2 "use strict";
3 var oop = require("../lib/oop");
4 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
5 var JSSMHighlightRules = function () {
6 this.$rules = {
7 start: [{
8 token: "punctuation.definition.comment.mn",
9 regex: /\/\*/,
10 push: [{
11 token: "punctuation.definition.comment.mn",
12 regex: /\*\//,
13 next: "pop"
14 }, {
15 defaultToken: "comment.block.jssm"
16 }],
17 comment: "block comment"
18 }, {
19 token: "comment.line.jssm",
20 regex: /\/\//,
21 push: [{
22 token: "comment.line.jssm",
23 regex: /$/,
24 next: "pop"
25 }, {
26 defaultToken: "comment.line.jssm"
27 }],
28 comment: "block comment"
29 }, {
30 token: "entity.name.function",
31 regex: /\${/,
32 push: [{
33 token: "entity.name.function",
34 regex: /}/,
35 next: "pop"
36 }, {
37 defaultToken: "keyword.other"
38 }],
39 comment: "js outcalls"
40 }, {
41 token: "constant.numeric",
42 regex: /[0-9]*\.[0-9]*\.[0-9]*/,
43 comment: "semver"
44 }, {
45 token: "constant.language.jssmLanguage",
46 regex: /graph_layout\s*:/,
47 comment: "jssm language tokens"
48 }, {
49 token: "constant.language.jssmLanguage",
50 regex: /machine_name\s*:/,
51 comment: "jssm language tokens"
52 }, {
53 token: "constant.language.jssmLanguage",
54 regex: /machine_version\s*:/,
55 comment: "jssm language tokens"
56 }, {
57 token: "constant.language.jssmLanguage",
58 regex: /jssm_version\s*:/,
59 comment: "jssm language tokens"
60 }, {
61 token: "keyword.control.transition.jssmArrow.legal_legal",
62 regex: /<->/,
63 comment: "transitions"
64 }, {
65 token: "keyword.control.transition.jssmArrow.legal_none",
66 regex: /<-/,
67 comment: "transitions"
68 }, {
69 token: "keyword.control.transition.jssmArrow.none_legal",
70 regex: /->/,
71 comment: "transitions"
72 }, {
73 token: "keyword.control.transition.jssmArrow.main_main",
74 regex: /<=>/,
75 comment: "transitions"
76 }, {
77 token: "keyword.control.transition.jssmArrow.none_main",
78 regex: /=>/,
79 comment: "transitions"
80 }, {
81 token: "keyword.control.transition.jssmArrow.main_none",
82 regex: /<=/,
83 comment: "transitions"
84 }, {
85 token: "keyword.control.transition.jssmArrow.forced_forced",
86 regex: /<~>/,
87 comment: "transitions"
88 }, {
89 token: "keyword.control.transition.jssmArrow.none_forced",
90 regex: /~>/,
91 comment: "transitions"
92 }, {
93 token: "keyword.control.transition.jssmArrow.forced_none",
94 regex: /<~/,
95 comment: "transitions"
96 }, {
97 token: "keyword.control.transition.jssmArrow.legal_main",
98 regex: /<-=>/,
99 comment: "transitions"
100 }, {
101 token: "keyword.control.transition.jssmArrow.main_legal",
102 regex: /<=->/,
103 comment: "transitions"
104 }, {
105 token: "keyword.control.transition.jssmArrow.legal_forced",
106 regex: /<-~>/,
107 comment: "transitions"
108 }, {
109 token: "keyword.control.transition.jssmArrow.forced_legal",
110 regex: /<~->/,
111 comment: "transitions"
112 }, {
113 token: "keyword.control.transition.jssmArrow.main_forced",
114 regex: /<=~>/,
115 comment: "transitions"
116 }, {
117 token: "keyword.control.transition.jssmArrow.forced_main",
118 regex: /<~=>/,
119 comment: "transitions"
120 }, {
121 token: "constant.numeric.jssmProbability",
122 regex: /[0-9]+%/,
123 comment: "edge probability annotation"
124 }, {
125 token: "constant.character.jssmAction",
126 regex: /\'[^']*\'/,
127 comment: "action annotation"
128 }, {
129 token: "entity.name.tag.jssmLabel.doublequoted",
130 regex: /\"[^"]*\"/,
131 comment: "jssm label annotation"
132 }, {
133 token: "entity.name.tag.jssmLabel.atom",
134 regex: /[a-zA-Z0-9_.+&()#@!?,]/,
135 comment: "jssm label annotation"
136 }]
137 };
138 this.normalizeRules();
139 };
140 JSSMHighlightRules.metaData = {
141 fileTypes: ["jssm", "jssm_state"],
142 name: "JSSM",
143 scopeName: "source.jssm"
144 };
145 oop.inherits(JSSMHighlightRules, TextHighlightRules);
146 exports.JSSMHighlightRules = JSSMHighlightRules;
147
148 });
149
150 ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
151 var oop = require("../../lib/oop");
152 var Range = require("../../range").Range;
153 var BaseFoldMode = require("./fold_mode").FoldMode;
154 var FoldMode = exports.FoldMode = function (commentRegex) {
155 if (commentRegex) {
156 this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
157 this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
158 }
159 };
160 oop.inherits(FoldMode, BaseFoldMode);
161 (function () {
162 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
163 this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
164 this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
165 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
166 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
167 this._getFoldWidgetBase = this.getFoldWidget;
168 this.getFoldWidget = function (session, foldStyle, row) {
169 var line = session.getLine(row);
170 if (this.singleLineBlockCommentRe.test(line)) {
171 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
172 return "";
173 }
174 var fw = this._getFoldWidgetBase(session, foldStyle, row);
175 if (!fw && this.startRegionRe.test(line))
176 return "start"; // lineCommentRegionStart
177 return fw;
178 };
179 this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
180 var line = session.getLine(row);
181 if (this.startRegionRe.test(line))
182 return this.getCommentRegionBlock(session, line, row);
183 var match = line.match(this.foldingStartMarker);
184 if (match) {
185 var i = match.index;
186 if (match[1])
187 return this.openingBracketBlock(session, match[1], row, i);
188 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
189 if (range && !range.isMultiLine()) {
190 if (forceMultiline) {
191 range = this.getSectionRange(session, row);
192 }
193 else if (foldStyle != "all")
194 range = null;
195 }
196 return range;
197 }
198 if (foldStyle === "markbegin")
199 return;
200 var match = line.match(this.foldingStopMarker);
201 if (match) {
202 var i = match.index + match[0].length;
203 if (match[1])
204 return this.closingBracketBlock(session, match[1], row, i);
205 return session.getCommentFoldRange(row, i, -1);
206 }
207 };
208 this.getSectionRange = function (session, row) {
209 var line = session.getLine(row);
210 var startIndent = line.search(/\S/);
211 var startRow = row;
212 var startColumn = line.length;
213 row = row + 1;
214 var endRow = row;
215 var maxRow = session.getLength();
216 while (++row < maxRow) {
217 line = session.getLine(row);
218 var indent = line.search(/\S/);
219 if (indent === -1)
220 continue;
221 if (startIndent > indent)
222 break;
223 var subRange = this.getFoldWidgetRange(session, "all", row);
224 if (subRange) {
225 if (subRange.start.row <= startRow) {
226 break;
227 }
228 else if (subRange.isMultiLine()) {
229 row = subRange.end.row;
230 }
231 else if (startIndent == indent) {
232 break;
233 }
234 }
235 endRow = row;
236 }
237 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
238 };
239 this.getCommentRegionBlock = function (session, line, row) {
240 var startColumn = line.search(/\s*$/);
241 var maxRow = session.getLength();
242 var startRow = row;
243 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
244 var depth = 1;
245 while (++row < maxRow) {
246 line = session.getLine(row);
247 var m = re.exec(line);
248 if (!m)
249 continue;
250 if (m[1])
251 depth--;
252 else
253 depth++;
254 if (!depth)
255 break;
256 }
257 var endRow = row;
258 if (endRow > startRow) {
259 return new Range(startRow, startColumn, endRow, line.length);
260 }
261 };
262 }).call(FoldMode.prototype);
263
264 });
265
266 ace.define("ace/mode/jssm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jssm_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
267 THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
268 */
269 "use strict";
270 var oop = require("../lib/oop");
271 var TextMode = require("./text").Mode;
272 var JSSMHighlightRules = require("./jssm_highlight_rules").JSSMHighlightRules;
273 var FoldMode = require("./folding/cstyle").FoldMode;
274 var Mode = function () {
275 this.HighlightRules = JSSMHighlightRules;
276 this.foldingRules = new FoldMode();
277 };
278 oop.inherits(Mode, TextMode);
279 (function () {
280 this.lineCommentStart = "//";
281 this.blockComment = { start: "/*", end: "*/" };
282 this.$id = "ace/mode/jssm";
283 }).call(Mode.prototype);
284 exports.Mode = Mode;
285
286 }); (function() {
287 ace.require(["ace/mode/jssm"], function(m) {
288 if (typeof module == "object" && typeof exports == "object" && module) {
289 module.exports = m;
290 }
291 });
292 })();
293