function e(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}var t=e(`_.var.let.actor.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.isolated.nonisolated.catch.do.rethrows.throw.throws.async.await.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__`.split(`.`)),n=e([`var`,`let`,`actor`,`class`,`enum`,`extension`,`import`,`protocol`,`struct`,`func`,`typealias`,`associatedtype`,`for`]),r=e([`true`,`false`,`nil`,`self`,`super`,`_`]),i=e([`Array`,`Bool`,`Character`,`Dictionary`,`Double`,`Float`,`Int`,`Int8`,`Int16`,`Int32`,`Int64`,`Never`,`Optional`,`Set`,`String`,`UInt8`,`UInt16`,`UInt32`,`UInt64`,`Void`]),a=`+-/*%=|&<>~^?!`,o=`:;,.(){}[]`,s=/^\-?0b[01][01_]*/,c=/^\-?0o[0-7][0-7_]*/,l=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,u=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,d=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,f=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,p=/^\#[A-Za-z]+/,m=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function h(e,h,g){if(e.sol()&&(h.indented=e.indentation()),e.eatSpace())return null;var y=e.peek();if(y==`/`){if(e.match(`//`))return e.skipToEnd(),`comment`;if(e.match(`/*`))return h.tokenize.push(v),v(e,h)}if(e.match(p))return`builtin`;if(e.match(m))return`attribute`;if(e.match(s)||e.match(c)||e.match(l)||e.match(u))return`number`;if(e.match(f))return`property`;if(a.indexOf(y)>-1)return e.next(),`operator`;if(o.indexOf(y)>-1)return e.next(),e.match(`..`),`punctuation`;var b;if(b=e.match(/("""|"|')/)){var x=_.bind(null,b[0]);return h.tokenize.push(x),x(e,h)}if(e.match(d)){var S=e.current();return i.hasOwnProperty(S)?`type`:r.hasOwnProperty(S)?`atom`:t.hasOwnProperty(S)?(n.hasOwnProperty(S)&&(h.prev=`define`),`keyword`):g==`define`?`def`:`variable`}return e.next(),null}function g(){var e=0;return function(t,n,r){var i=h(t,n,r);if(i==`punctuation`){if(t.current()==`(`)++e;else if(t.current()==`)`){if(e==0)return t.backUp(1),n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);--e}}return i}}function _(e,t,n){for(var r=e.length==1,i,a=!1;i=t.peek();)if(a){if(t.next(),i==`(`)return n.tokenize.push(g()),`string`;a=!1}else if(t.match(e))return n.tokenize.pop(),`string`;else t.next(),a=i==`\\`;return r&&n.tokenize.pop(),`string`}function v(e,t){for(var n;n=e.next();)if(n===`/`&&e.eat(`*`))t.tokenize.push(v);else if(n===`*`&&e.eat(`/`)){t.tokenize.pop();break}return`comment`}function y(e,t,n){this.prev=e,this.align=t,this.indented=n}function b(e,t){var n=t.match(/^\s*($|\/[\/\*]|[)}\]])/,!1)?null:t.column()+1;e.context=new y(e.context,n,e.indented)}function x(e){e.context&&=(e.indented=e.context.indented,e.context.prev)}var S={name:`swift`,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]||h)(e,t,n);if(!r||r==`comment`?t.prev=n:t.prev||=r,r==`punctuation`){var i=/[\(\[\{]|([\]\)\}])/.exec(e.current());i&&(i[1]?x:b)(t,e)}return r},indent:function(e,t,n){var r=e.context;if(!r)return 0;var i=/^[\]\}\)]/.test(t);return r.align==null?r.indented+(i?0:n.unit):r.align-+!!i},languageData:{indentOnInput:/^\s*[\)\}\]]$/,commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}};export{S as swift};