mode-c9search-35ca1ead.js.map 16 KB

1
  1. {"version":3,"file":"mode-c9search-35ca1ead.js","sources":["../../node_modules/ace-builds/src-noconflict/mode-c9search.js"],"sourcesContent":["ace.define(\"ace/mode/c9search_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/mode/text_highlight_rules\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar lang = require(\"../lib/lang\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nfunction safeCreateRegexp(source, flag) {\n try {\n return new RegExp(source, flag);\n }\n catch (e) { }\n}\nvar C9SearchHighlightRules = function () {\n this.$rules = {\n \"start\": [\n {\n tokenNames: [\"c9searchresults.constant.numeric\", \"c9searchresults.text\", \"c9searchresults.text\", \"c9searchresults.keyword\"],\n regex: /(^\\s+[0-9]+)(:)(\\d*\\s?)([^\\r\\n]+)/,\n onMatch: function (val, state, stack) {\n var values = this.splitRegex.exec(val);\n var types = this.tokenNames;\n var tokens = [{\n type: types[0],\n value: values[1]\n }, {\n type: types[1],\n value: values[2]\n }];\n if (values[3]) {\n if (values[3] == \" \")\n tokens[1] = { type: types[1], value: values[2] + \" \" };\n else\n tokens.push({ type: types[1], value: values[3] });\n }\n var regex = stack[1];\n var str = values[4];\n var m;\n var last = 0;\n if (regex && regex.exec) {\n regex.lastIndex = 0;\n while (m = regex.exec(str)) {\n var skipped = str.substring(last, m.index);\n last = regex.lastIndex;\n if (skipped)\n tokens.push({ type: types[2], value: skipped });\n if (m[0])\n tokens.push({ type: types[3], value: m[0] });\n else if (!skipped)\n break;\n }\n }\n if (last < str.length)\n tokens.push({ type: types[2], value: str.substr(last) });\n return tokens;\n }\n },\n {\n regex: \"^Searching for [^\\\\r\\\\n]*$\",\n onMatch: function (val, state, stack) {\n var parts = val.split(\"\\x01\");\n if (parts.length < 3)\n return \"text\";\n var options, search;\n var i = 0;\n var tokens = [{\n value: parts[i++] + \"'\",\n type: \"text\"\n }, {\n value: search = parts[i++],\n type: \"text\" // \"c9searchresults.keyword\"\n }, {\n value: \"'\" + parts[i++],\n type: \"text\"\n }];\n if (parts[2] !== \" in\") {\n tokens.push({\n value: \"'\" + parts[i++] + \"'\",\n type: \"text\"\n }, {\n value: parts[i++],\n type: \"text\"\n });\n }\n tokens.push({\n value: \" \" + parts[i++] + \" \",\n type: \"text\"\n });\n if (parts[i + 1]) {\n options = parts[i + 1];\n tokens.push({\n value: \"(\" + parts[i + 1] + \")\",\n type: \"text\"\n });\n i += 1;\n }\n else {\n i -= 1;\n }\n while (i++ < parts.length) {\n parts[i] && tokens.push({\n value: parts[i],\n type: \"text\"\n });\n }\n if (search) {\n if (!/regex/.test(options))\n search = lang.escapeRegExp(search);\n if (/whole/.test(options))\n search = \"\\\\b\" + search + \"\\\\b\";\n }\n var regex = search && safeCreateRegexp(\"(\" + search + \")\", / sensitive/.test(options) ? \"g\" : \"ig\");\n if (regex) {\n stack[0] = state;\n stack[1] = regex;\n }\n return tokens;\n }\n },\n {\n regex: \"^(?=Found \\\\d+ matches)\",\n token: \"text\",\n next: \"numbers\"\n },\n {\n token: \"string\",\n regex: \"^\\\\S:?[^:]+\",\n next: \"numbers\"\n }\n ],\n numbers: [{\n regex: \"\\\\d+\",\n token: \"constant.numeric\"\n }, {\n regex: \"$\",\n token: \"text\",\n next: \"start\"\n }]\n };\n this.normalizeRules();\n};\noop.inherits(C9SearchHighlightRules, TextHighlightRules);\nexports.C9SearchHighlightRules = C9SearchHighlightRules;\n\n});\n\nace.define(\"ace/mode/matching_brace_outdent\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nvar MatchingBraceOutdent = function () { };\n(function () {\n this.checkOutdent = function (line, input) {\n if (!/^\\s+$/.test(line))\n return false;\n return /^\\s*\\}/.test(input);\n };\n this.autoOutdent = function (doc, row) {\n var line = doc.getLine(row);\n var match = line.match(/^(\\s*\\})/);\n if (!match)\n return 0;\n var column = match[1].length;\n var openBracePos = doc.findMatchingBracket({ row: row, column: column });\n if (!openBracePos || openBracePos.row == row)\n return 0;\n var indent = this.$getIndent(doc.getLine(openBracePos.row));\n doc.replace(new Range(row, 0, row, column - 1), indent);\n };\n this.$getIndent = function (line) {\n return line.match(/^\\s*/)[0];\n };\n}).call(MatchingBraceOutdent.prototype);\nexports.MatchingBraceOutdent = MatchingBraceOutdent;\n\n});\n\nace.define(\"ace/mode/folding/c9search\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/range\",\"ace/mode/folding/fold_mode\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../../lib/oop\");\nvar Range = require(\"../../range\").Range;\nvar BaseFoldMode = require(\"./fold_mode\").FoldMode;\nvar FoldMode = exports.FoldMode = function () { };\noop.inherits(FoldMode, BaseFoldMode);\n(function () {\n this.foldingStartMarker = /^(\\S.*:|Searching for.*)$/;\n this.foldingStopMarker = /^(\\s+|Found.*)$/;\n this.getFoldWidgetRange = function (session, foldStyle, row) {\n var lines = session.doc.getAllLines(row);\n var line = lines[row];\n var level1 = /^(Found.*|Searching for.*)$/;\n var level2 = /^(\\S.*:|\\s*)$/;\n var re = level1.test(line) ? level1 : level2;\n var startRow = row;\n var endRow = row;\n if (this.foldingStartMarker.test(line)) {\n for (var i = row + 1, l = session.getLength(); i < l; i++) {\n if (re.test(lines[i]))\n break;\n }\n endRow = i;\n }\n else if (this.foldingStopMarker.test(line)) {\n for (var i = row - 1; i >= 0; i--) {\n line = lines[i];\n if (re.test(line))\n break;\n }\n startRow = i;\n }\n if (startRow != endRow) {\n var col = line.length;\n if (re === level1)\n col = line.search(/\\(Found[^)]+\\)$|$/);\n return new Range(startRow, col, endRow, 0);\n }\n };\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/mode/c9search\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/c9search_highlight_rules\",\"ace/mode/matching_brace_outdent\",\"ace/mode/folding/c9search\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar TextMode = require(\"./text\").Mode;\nvar C9SearchHighlightRules = require(\"./c9search_highlight_rules\").C9SearchHighlightRules;\nvar MatchingBraceOutdent = require(\"./matching_brace_outdent\").MatchingBraceOutdent;\nvar C9StyleFoldMode = require(\"./folding/c9search\").FoldMode;\nvar Mode = function () {\n this.HighlightRules = C9SearchHighlightRules;\n this.$outdent = new MatchingBraceOutdent();\n this.foldingRules = new C9StyleFoldMode();\n};\noop.inherits(Mode, TextMode);\n(function () {\n this.getNextLineIndent = function (state, line, tab) {\n var indent = this.$getIndent(line);\n return indent;\n };\n this.checkOutdent = function (state, line, input) {\n return this.$outdent.checkOutdent(line, input);\n };\n this.autoOutdent = function (state, doc, row) {\n this.$outdent.autoOutdent(doc, row);\n };\n this.$id = \"ace/mode/c9search\";\n}).call(Mode.prototype);\nexports.Mode = Mode;\n\n}); (function() {\n ace.require([\"ace/mode/c9search\"], function(m) {\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = m;\n }\n });\n })();\n "],"names":["require","exports","module","oop","lang","TextHighlightRules","safeCreateRegexp","source","flag","C9SearchHighlightRules","val","state","stack","values","types","tokens","regex","str","m","last","skipped","parts","options","search","i","Range","MatchingBraceOutdent","line","input","doc","row","match","column","openBracePos","indent","BaseFoldMode","FoldMode","session","foldStyle","lines","level1","level2","re","startRow","endRow","l","col","TextMode","C9StyleFoldMode","Mode","tab"],"mappings":"gaAAA,IAAI,OAAO,oCAAoC,CAAC,UAAU,UAAU,SAAS,cAAc,eAAe,+BAA+B,EAAG,SAASA,EAASC,EAASC,EAAO,CAC9K,IAAIC,EAAMH,EAAQ,YAAY,EAC1BI,EAAOJ,EAAQ,aAAa,EAC5BK,EAAqBL,EAAQ,wBAAwB,EAAE,mBAC3D,SAASM,EAAiBC,EAAQC,EAAM,CACpC,GAAI,CACA,OAAO,IAAI,OAAOD,EAAQC,CAAI,CACjC,MACD,CAAa,CA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