Debian Codegraph @

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

raw symbols SCIP
1 ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2 var oop = require("../lib/oop");
3 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
4 var DocCommentHighlightRules = function () {
5 this.$rules = {
6 "start": [
7 {
8 token: "comment.doc.tag",
9 regex: "@\\w+(?=\\s|$)"
10 }, DocCommentHighlightRules.getTagRule(), {
11 defaultToken: "comment.doc",
12 caseInsensitive: true
13 }
14 ]
15 };
16 };
17 oop.inherits(DocCommentHighlightRules, TextHighlightRules);
18 DocCommentHighlightRules.getTagRule = function (start) {
19 return {
20 token: "comment.doc.tag.storage.type",
21 regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
22 };
23 };
24 DocCommentHighlightRules.getStartRule = function (start) {
25 return {
26 token: "comment.doc", // doc comment
27 regex: "\\/\\*(?=\\*)",
28 next: start
29 };
30 };
31 DocCommentHighlightRules.getEndRule = function (start) {
32 return {
33 token: "comment.doc", // closing comment
34 regex: "\\*\\/",
35 next: start
36 };
37 };
38 exports.DocCommentHighlightRules = DocCommentHighlightRules;
39
40 });
41
42 ace.define("ace/mode/scrypt_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ./tmthemes/tmscrypt.tmLanguage (uuid: ) */
43 "use strict";
44 var oop = require("../lib/oop");
45 var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
46 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
47 var scryptHighlightRules = function () {
48 var keywords = ("contract|library|loop|new|private|" +
49 "public|if|else|struct|type|" +
50 "require|static|const|import|exit|return|asm");
51 var buildinConstants = ("true|false");
52 var langClasses = ("function|auto|constructor|bytes|int|bool|SigHashPreimage|PrivKey|PubKey|Sig|Ripemd160|Sha1|Sha256|" +
53 "SigHashType|SigHashPreimage|OpCodeType");
54 var keywordMapper = this.createKeywordMapper({
55 "variable.language": "this",
56 "keyword": keywords,
57 "constant.language": buildinConstants,
58 "support.function": langClasses
59 }, "identifier");
60 this.$rules = {
61 "start": [
62 {
63 token: "comment",
64 regex: "\\/\\/.*$"
65 },
66 DocCommentHighlightRules.getStartRule("doc-start"),
67 {
68 token: "comment", // multi line comment
69 regex: "\\/\\*",
70 next: "comment"
71 }, {
72 token: "string", // single line
73 regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
74 }, {
75 token: "string", // single line
76 regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
77 }, {
78 token: "constant.numeric", // hex
79 regex: /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/
80 }, {
81 token: "constant.numeric", // float
82 regex: /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/
83 }, {
84 token: "constant.language.boolean",
85 regex: "(?:true|false)\\b"
86 },
87 {
88 token: ["support.function.math.scrypt", "text", "text"],
89 regex: /\b(abs|min|max|within|ripemd160|sha1|sha256|hash160|hash256|checkSig|checkMultiSig|num2bin|pack|unpack|len|reverseBytes|repeat)(\s*)(\()/
90 }, {
91 token: [
92 "entity.name.type.scrypt",
93 "text",
94 "text",
95 "text",
96 "variable.object.property.scrypt"
97 ],
98 regex: /\b(SigHash)(\s*)(\.)(\s*)(ANYONECANPAY|ALL|FORKID|NONE|SINGLE)\b/
99 },
100 {
101 token: [
102 "entity.name.type.scrypt",
103 "text",
104 "text",
105 "text",
106 "variable.object.property.scrypt"
107 ],
108 regex: /\b(OpCode)(\s*)(\.)(\s*)(OP_PUSHDATA1|OP_PUSHDATA2|OP_PUSHDATA4|OP_0|OP_FALSE|OP_1NEGATE|OP_1|OP_TRUE|OP_2|OP_3|OP_4|OP_5|OP_6|OP_7|OP_8|OP_9|OP_10|OP_11|OP_12|OP_13|OP_14|OP_15|OP_16|OP_1ADD|OP_1SUB|OP_NEGATE|OP_ABS|OP_NOT|OP_0NOTEQUAL|OP_ADD|OP_SUB|OP_MUL|OP_DIV|OP_MOD|OP_LSHIFT|OP_RSHIFT|OP_BOOLAND|OP_BOOLOR|OP_NUMEQUAL|OP_NUMEQUALVERIFY|OP_NUMNOTEQUAL|OP_LESSTHAN|OP_GREATERTHAN|OP_LESSTHANOREQUAL|OP_GREATERTHANOREQUAL|OP_MIN|OP_MAX|OP_WITHIN|OP_CAT|OP_SPLIT|OP_BIN2NUM|OP_NUM2BIN|OP_SIZE|OP_NOP|OP_IF|OP_NOTIF|OP_ELSE|OP_ENDIF|OP_VERIFY|OP_RETURN|OP_TOALTSTACK|OP_FROMALTSTACK|OP_IFDUP|OP_DEPTH|OP_DROP|OP_DUP|OP_NIP|OP_OVER|OP_PICK|OP_ROLL|OP_ROT|OP_SWAP|OP_TUCK|OP_2DROP|OP_2DUP|OP_3DUP|OP_2OVER|OP_2ROT|OP_2SWAP|OP_RIPEMD160|OP_SHA1|OP_SHA256|OP_HASH160|OP_HASH256|OP_CODESEPARATOR|OP_CHECKSIG|OP_CHECKSIGVERIFY|OP_CHECKMULTISIG|OP_CHECKMULTISIGVERIFY|OP_INVERT|OP_AND|OP_OR|OP_XOR|OP_EQUAL|OP_EQUALVERIFY)\b/
109 }, {
110 token: "entity.name.type.scrypt",
111 regex: /\b(?:P2PKH|P2PK|Tx|HashPuzzleRipemd160|HashPuzzleSha1|HashPuzzleSha256|HashPuzzleHash160|OpCode|SigHash)\b/
112 }, {
113 token: [
114 "punctuation.separator.period.scrypt",
115 'text',
116 "entity.name.function.scrypt",
117 "text",
118 "punctuation.definition.parameters.begin.bracket.round.scrypt"
119 ],
120 regex: /(\.)([^\S$\r]*)([\w][\w\d]*)(\s*)(\()/,
121 push: [{
122 token: "punctuation.definition.parameters.end.bracket.round.scrypt",
123 regex: /\)/,
124 next: "pop"
125 }, {
126 defaultToken: "start"
127 }]
128 }, {
129 token: keywordMapper,
130 regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
131 }, {
132 token: "keyword.operator",
133 regex: "!|\\$|%|&|\\||\\^|\\*|\\/|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<>|<|>|!|&&|\\|\\||\\?|\\:|\\*=|\\/=|%=|\\+=|\\-=|&=|\\|=|\\^="
134 }, {
135 token: "lparen",
136 regex: "[[({]"
137 }, {
138 token: "rparen",
139 regex: "[\\])}]"
140 }, {
141 token: "text",
142 regex: "\\s+"
143 }
144 ],
145 "comment": [
146 {
147 token: "comment", // closing comment
148 regex: "\\*\\/",
149 next: "start"
150 }, {
151 defaultToken: "comment"
152 }
153 ]
154 };
155 this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
156 this.normalizeRules();
157 };
158 oop.inherits(scryptHighlightRules, TextHighlightRules);
159 exports.scryptHighlightRules = scryptHighlightRules;
160
161 });
162
163 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";
164 var oop = require("../../lib/oop");
165 var Range = require("../../range").Range;
166 var BaseFoldMode = require("./fold_mode").FoldMode;
167 var FoldMode = exports.FoldMode = function (commentRegex) {
168 if (commentRegex) {
169 this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
170 this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
171 }
172 };
173 oop.inherits(FoldMode, BaseFoldMode);
174 (function () {
175 this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
176 this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
177 this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
178 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
179 this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
180 this._getFoldWidgetBase = this.getFoldWidget;
181 this.getFoldWidget = function (session, foldStyle, row) {
182 var line = session.getLine(row);
183 if (this.singleLineBlockCommentRe.test(line)) {
184 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
185 return "";
186 }
187 var fw = this._getFoldWidgetBase(session, foldStyle, row);
188 if (!fw && this.startRegionRe.test(line))
189 return "start"; // lineCommentRegionStart
190 return fw;
191 };
192 this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
193 var line = session.getLine(row);
194 if (this.startRegionRe.test(line))
195 return this.getCommentRegionBlock(session, line, row);
196 var match = line.match(this.foldingStartMarker);
197 if (match) {
198 var i = match.index;
199 if (match[1])
200 return this.openingBracketBlock(session, match[1], row, i);
201 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
202 if (range && !range.isMultiLine()) {
203 if (forceMultiline) {
204 range = this.getSectionRange(session, row);
205 }
206 else if (foldStyle != "all")
207 range = null;
208 }
209 return range;
210 }
211 if (foldStyle === "markbegin")
212 return;
213 var match = line.match(this.foldingStopMarker);
214 if (match) {
215 var i = match.index + match[0].length;
216 if (match[1])
217 return this.closingBracketBlock(session, match[1], row, i);
218 return session.getCommentFoldRange(row, i, -1);
219 }
220 };
221 this.getSectionRange = function (session, row) {
222 var line = session.getLine(row);
223 var startIndent = line.search(/\S/);
224 var startRow = row;
225 var startColumn = line.length;
226 row = row + 1;
227 var endRow = row;
228 var maxRow = session.getLength();
229 while (++row < maxRow) {
230 line = session.getLine(row);
231 var indent = line.search(/\S/);
232 if (indent === -1)
233 continue;
234 if (startIndent > indent)
235 break;
236 var subRange = this.getFoldWidgetRange(session, "all", row);
237 if (subRange) {
238 if (subRange.start.row <= startRow) {
239 break;
240 }
241 else if (subRange.isMultiLine()) {
242 row = subRange.end.row;
243 }
244 else if (startIndent == indent) {
245 break;
246 }
247 }
248 endRow = row;
249 }
250 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
251 };
252 this.getCommentRegionBlock = function (session, line, row) {
253 var startColumn = line.search(/\s*$/);
254 var maxRow = session.getLength();
255 var startRow = row;
256 var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
257 var depth = 1;
258 while (++row < maxRow) {
259 line = session.getLine(row);
260 var m = re.exec(line);
261 if (!m)
262 continue;
263 if (m[1])
264 depth--;
265 else
266 depth++;
267 if (!depth)
268 break;
269 }
270 var endRow = row;
271 if (endRow > startRow) {
272 return new Range(startRow, startColumn, endRow, line.length);
273 }
274 };
275 }).call(FoldMode.prototype);
276
277 });
278
279 ace.define("ace/mode/scrypt",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scrypt_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
280 THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
281 */
282 "use strict";
283 var oop = require("../lib/oop");
284 var TextMode = require("./text").Mode;
285 var scryptHighlightRules = require("./scrypt_highlight_rules").scryptHighlightRules;
286 var FoldMode = require("./folding/cstyle").FoldMode;
287 var Mode = function () {
288 this.HighlightRules = scryptHighlightRules;
289 this.foldingRules = new FoldMode();
290 this.$behaviour = this.$defaultBehaviour;
291 };
292 oop.inherits(Mode, TextMode);
293 (function () {
294 this.lineCommentStart = "//";
295 this.blockComment = {
296 start: "/*",
297 end: "*/"
298 };
299 this.$quotes = {
300 '"': '"',
301 "'": "'"
302 };
303 this.createWorker = function (session) {
304 return null;
305 };
306 this.$id = "ace/mode/scrypt";
307 }).call(Mode.prototype);
308 exports.Mode = Mode;
309
310 }); (function() {
311 ace.require(["ace/mode/scrypt"], function(m) {
312 if (typeof module == "object" && typeof exports == "object" && module) {
313 module.exports = m;
314 }
315 });
316 })();
317