1 |
- {"version":3,"file":"mode-swift-ffd1d718.js","sources":["../../node_modules/ace-builds/src-noconflict/mode-swift.js"],"sourcesContent":["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\";\nvar oop = require(\"../lib/oop\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nvar DocCommentHighlightRules = function () {\n this.$rules = {\n \"start\": [\n {\n token: \"comment.doc.tag\",\n regex: \"@\\\\w+(?=\\\\s|$)\"\n }, DocCommentHighlightRules.getTagRule(), {\n defaultToken: \"comment.doc\",\n caseInsensitive: true\n }\n ]\n };\n};\noop.inherits(DocCommentHighlightRules, TextHighlightRules);\nDocCommentHighlightRules.getTagRule = function (start) {\n return {\n token: \"comment.doc.tag.storage.type\",\n regex: \"\\\\b(?:TODO|FIXME|XXX|HACK)\\\\b\"\n };\n};\nDocCommentHighlightRules.getStartRule = function (start) {\n return {\n token: \"comment.doc\",\n regex: \"\\\\/\\\\*(?=\\\\*)\",\n next: start\n };\n};\nDocCommentHighlightRules.getEndRule = function (start) {\n return {\n token: \"comment.doc\",\n regex: \"\\\\*\\\\/\",\n next: start\n };\n};\nexports.DocCommentHighlightRules = DocCommentHighlightRules;\n\n});\n\nace.define(\"ace/mode/swift_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/lang\",\"ace/mode/doc_comment_highlight_rules\",\"ace/mode/text_highlight_rules\"], function(require, exports, module){\"use strict\";\nvar oop = require(\"../lib/oop\");\nvar lang = require(\"../lib/lang\");\nvar DocCommentHighlightRules = require(\"./doc_comment_highlight_rules\").DocCommentHighlightRules;\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\nvar SwiftHighlightRules = function () {\n var keywordMapper = this.createKeywordMapper({\n \"variable.language\": \"\",\n \"keyword\": \"__COLUMN__|__FILE__|__FUNCTION__|__LINE__\"\n + \"|as|associativity|break|case|class|continue|default|deinit|didSet\"\n + \"|do|dynamicType|else|enum|extension|fallthrough|for|func|get|if|import\"\n + \"|in|infix|init|inout|is|left|let|let|mutating|new|none|nonmutating\"\n + \"|operator|override|postfix|precedence|prefix|protocol|return|right\"\n + \"|safe|Self|self|set|struct|subscript|switch|Type|typealias\"\n + \"|unowned|unsafe|var|weak|where|while|willSet\"\n + \"|convenience|dynamic|final|infix|lazy|mutating|nonmutating|optional|override|postfix\"\n + \"|prefix|required|static|guard|defer\",\n \"storage.type\": \"bool|double|Double\"\n + \"|extension|float|Float|int|Int|open|internal|fileprivate|private|public|string|String\",\n \"constant.language\": \"false|Infinity|NaN|nil|no|null|null|off|on|super|this|true|undefined|yes\",\n \"support.function\": \"\"\n }, \"identifier\");\n function string(start, options) {\n var nestable = options.nestable || options.interpolation;\n var interpStart = options.interpolation && options.interpolation.nextState || \"start\";\n var mainRule = {\n regex: start + (options.multiline ? \"\" : \"(?=.)\"),\n token: \"string.start\"\n };\n var nextState = [\n options.escape && {\n regex: options.escape,\n token: \"character.escape\"\n },\n options.interpolation && {\n token: \"paren.quasi.start\",\n regex: lang.escapeRegExp(options.interpolation.lead + options.interpolation.open),\n push: interpStart\n },\n options.error && {\n regex: options.error,\n token: \"error.invalid\"\n },\n {\n regex: start + (options.multiline ? \"\" : \"|$\"),\n token: \"string.end\",\n next: nestable ? \"pop\" : \"start\"\n }, {\n defaultToken: \"string\"\n }\n ].filter(Boolean);\n if (nestable)\n mainRule.push = nextState;\n else\n mainRule.next = nextState;\n if (!options.interpolation)\n return mainRule;\n var open = options.interpolation.open;\n var close = options.interpolation.close;\n var counter = {\n regex: \"[\" + lang.escapeRegExp(open + close) + \"]\",\n onMatch: function (val, state, stack) {\n this.next = val == open ? this.nextState : \"\";\n if (val == open && stack.length) {\n stack.unshift(\"start\", state);\n return \"paren\";\n }\n if (val == close && stack.length) {\n stack.shift();\n this.next = stack.shift();\n if (this.next.indexOf(\"string\") != -1)\n return \"paren.quasi.end\";\n }\n return val == open ? \"paren.lparen\" : \"paren.rparen\";\n },\n nextState: interpStart\n };\n return [counter, mainRule];\n }\n function comments() {\n return [{\n token: \"comment\",\n regex: /\\/\\//,\n next: [\n DocCommentHighlightRules.getTagRule(),\n { token: \"comment\", regex: \"$|^\", next: \"start\" },\n { defaultToken: \"comment\", caseInsensitive: true }\n ]\n },\n DocCommentHighlightRules.getStartRule(\"doc-start\"),\n {\n token: \"comment.start\",\n regex: /\\/\\*/,\n stateName: \"nested_comment\",\n push: [\n DocCommentHighlightRules.getTagRule(),\n { token: \"comment.start\", regex: /\\/\\*/, push: \"nested_comment\" },\n { token: \"comment.end\", regex: \"\\\\*\\\\/\", next: \"pop\" },\n { defaultToken: \"comment\", caseInsensitive: true }\n ]\n }\n ];\n }\n this.$rules = {\n start: [\n string('\"\"\"', {\n escape: /\\\\(?:[0\\\\tnr\"']|u{[a-fA-F1-9]{0,8}})/,\n interpolation: { lead: \"\\\\\", open: \"(\", close: \")\" },\n error: /\\\\./,\n multiline: true\n }),\n string('\"', {\n escape: /\\\\(?:[0\\\\tnr\"']|u{[a-fA-F1-9]{0,8}})/,\n interpolation: { lead: \"\\\\\", open: \"(\", close: \")\" },\n error: /\\\\./,\n multiline: false\n }),\n comments(),\n {\n regex: /@[a-zA-Z_$][a-zA-Z_$\\d\\u0080-\\ufffe]*/,\n token: \"variable.parameter\"\n },\n {\n regex: /[a-zA-Z_$][a-zA-Z_$\\d\\u0080-\\ufffe]*/,\n token: keywordMapper\n },\n {\n token: \"constant.numeric\",\n regex: /[+-]?(?:0(?:b[01]+|o[0-7]+|x[\\da-fA-F])|\\d+(?:(?:\\.\\d*)?(?:[PpEe][+-]?\\d+)?)\\b)/\n }, {\n token: \"keyword.operator\",\n regex: /--|\\+\\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?:|[!$
|