Liferay.Loader.define("journal-web$codemirror@5.65.2/mode/swift/swift",["module","exports","require","../../lib/codemirror"],(function(e,t,n){var r,i=void 0;window;r=function(e){"use strict";function wordSet(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}var t=wordSet(["_","var","let","class","enum","extension","import","protocol","struct","func","typealias","associatedtype","open","public","internal","fileprivate","private","deinit","init","new","override","self","subscript","super","convenience","dynamic","final","indirect","lazy","required","static","unowned","unowned(safe)","unowned(unsafe)","weak","as","is","break","case","continue","default","else","fallthrough","for","guard","if","in","repeat","switch","where","while","defer","return","inout","mutating","nonmutating","catch","do","rethrows","throw","throws","try","didSet","get","set","willSet","assignment","associativity","infix","left","none","operator","postfix","precedence","precedencegroup","prefix","right","Any","AnyObject","Type","dynamicType","Self","Protocol","__COLUMN__","__FILE__","__FUNCTION__","__LINE__"]),n=wordSet(["var","let","class","enum","extension","import","protocol","struct","func","typealias","associatedtype","for"]),r=wordSet(["true","false","nil","self","super","_"]),i=wordSet(["Array","Bool","Character","Dictionary","Double","Float","Int","Int8","Int16","Int32","Int64","Never","Optional","Set","String","UInt8","UInt16","UInt32","UInt64","Void"]),o=/^\-?0b[01][01_]*/,a=/^\-?0o[0-7][0-7_]*/,u=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,c=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,f=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,d=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,l=/^\#[A-Za-z]+/,s=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function tokenBase(e,p,m){if(e.sol()&&(p.indented=e.indentation()),e.eatSpace())return null;var h,v=e.peek();if("/"==v){if(e.match("//"))return e.skipToEnd(),"comment";if(e.match("/*"))return p.tokenize.push(tokenComment),tokenComment(e,p)}if(e.match(l))return"builtin";if(e.match(s))return"attribute";if(e.match(o))return"number";if(e.match(a))return"number";if(e.match(u))return"number";if(e.match(c))return"number";if(e.match(d))return"property";if("+-/*%=|&<>~^?!".indexOf(v)>-1)return e.next(),"operator";if(":;,.(){}[]".indexOf(v)>-1)return e.next(),e.match(".."),"punctuation";if(h=e.match(/("""|"|')/)){var k=tokenString.bind(null,h[0]);return p.tokenize.push(k),k(e,p)}if(e.match(f)){var x=e.current();return i.hasOwnProperty(x)?"variable-2":r.hasOwnProperty(x)?"atom":t.hasOwnProperty(x)?(n.hasOwnProperty(x)&&(p.prev="define"),"keyword"):"define"==m?"def":"variable"}return e.next(),null}function tokenUntilClosingParen(){var e=0;return function(t,n,r){var i=tokenBase(t,n,r);if("punctuation"==i)if("("==t.current())++e;else if(")"==t.current()){if(0==e)return t.backUp(1),n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);--e}return i}}function tokenString(e,t,n){for(var r,i=1==e.length,o=!1;r=t.peek();)if(o){if(t.next(),"("==r)return n.tokenize.push(tokenUntilClosingParen()),"string";o=!1}else{if(t.match(e))return n.tokenize.pop(),"string";t.next(),o="\\"==r}return i&&n.tokenize.pop(),"string"}function tokenComment(e,t){for(var n;e.match(/^[^/*]+/,!0),n=e.next();)"/"===n&&e.eat("*")?t.tokenize.push(tokenComment):"*"===n&&e.eat("/")&&t.tokenize.pop();return"comment"}function Context(e,t,n){this.prev=e,this.align=t,this.indented=n}function pushContext(e,t){var n=t.match(/^\s*($|\/[\/\*])/,!1)?null:t.column()+1;e.context=new Context(e.context,n,e.indented)}function popContext(e){e.context&&(e.indented=e.context.indented,e.context=e.context.prev)}e.defineMode("swift",(function(e){return{startState:function(){return{prev:null,context:null,indented:0,tokenize:[]}},token:function(e,t){var n=t.prev;t.prev=null;var r=(t.tokenize[t.tokenize.length-1]||tokenBase)(e,t,n);if(r&&"comment"!=r?t.prev||(t.prev=r):t.prev=n,"punctuation"==r){var i=/[\(\[\{]|([\]\)\}])/.exec(e.current());i&&(i[1]?popContext:pushContext)(t,e)}return r},indent:function(t,n){var r=t.context;if(!r)return 0;var i=/^[\]\}\)]/.test(n);return null!=r.align?r.align-(i?1:0):r.indented+(i?0:e.indentUnit)},electricInput:/^\s*[\)\}\]]$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace",closeBrackets:"()[]{}''\"\"``"}})),e.defineMIME("text/x-swift","swift")},"object"==typeof t&&"object"==typeof e?r(n("../../lib/codemirror")):"function"==typeof i&&i.amd?i(["../../lib/codemirror"],r):r(CodeMirror)}));
//# sourceMappingURL=swift.js.map