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