function e(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}var t={name:`ttcn`,keywords:e(`activate address alive all alt altstep and and4b any break case component const continue control deactivate display do else encode enumerated except exception execute extends extension external for from function goto group if import in infinity inout interleave label language length log match message mixed mod modifies module modulepar mtc noblock not not4b nowait of on optional or or4b out override param pattern port procedure record recursive rem repeat return runs select self sender set signature system template testcase to type union value valueof var variant while with xor xor4b`),builtin:e(`bit2hex bit2int bit2oct bit2str char2int char2oct encvalue decomp decvalue float2int float2str hex2bit hex2int hex2oct hex2str int2bit int2char int2float int2hex int2oct int2str int2unichar isbound ischosen ispresent isvalue lengthof log2str oct2bit oct2char oct2hex oct2int oct2str regexp replace rnd sizeof str2bit str2float str2hex str2int str2oct substr unichar2int unichar2char enum2int`),types:e(`anytype bitstring boolean char charstring default float hexstring integer objid octetstring universal verdicttype timer`),timerOps:e(`read running start stop timeout`),portOps:e(`call catch check clear getcall getreply halt raise receive reply send trigger`),configOps:e(`create connect disconnect done kill killed map unmap`),verdictOps:e(`getverdict setverdict`),sutOps:e(`action`),functionOps:e(`apply derefers refers`),verdictConsts:e(`error fail inconc none pass`),booleanConsts:e(`true false`),otherConsts:e(`null NULL omit`),visibilityModifiers:e(`private public friend`),templateMatch:e(`complement ifpresent subset superset permutation`),multiLineStrings:!0},n=[];function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&n.push(t)}r(t.keywords),r(t.builtin),r(t.timerOps),r(t.portOps);var i=t.keywords||{},a=t.builtin||{},o=t.timerOps||{},s=t.portOps||{},c=t.configOps||{},l=t.verdictOps||{},u=t.sutOps||{},d=t.functionOps||{},f=t.verdictConsts||{},p=t.booleanConsts||{},m=t.otherConsts||{},h=t.types||{},g=t.visibilityModifiers||{},_=t.templateMatch||{},v=t.multiLineStrings,y=t.indentStatements!==!1,b=/[+\-*&@=<>!\/]/,x;function S(e,t){var n=e.next();if(n==`"`||n==`'`)return t.tokenize=C(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\\:\?\.]/.test(n))return x=n,`punctuation`;if(n==`#`)return e.skipToEnd(),`atom`;if(n==`%`)return e.eatWhile(/\b/),`atom`;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),`number`;if(n==`/`){if(e.eat(`*`))return t.tokenize=w,w(e,t);if(e.eat(`/`))return e.skipToEnd(),`comment`}if(b.test(n))return n==`@`&&(e.match(`try`)||e.match(`catch`)||e.match(`lazy`))?`keyword`:(e.eatWhile(b),`operator`);e.eatWhile(/[\w\$_\xa1-\uffff]/);var r=e.current();return i.propertyIsEnumerable(r)?`keyword`:a.propertyIsEnumerable(r)?`builtin`:o.propertyIsEnumerable(r)||c.propertyIsEnumerable(r)||l.propertyIsEnumerable(r)||s.propertyIsEnumerable(r)||u.propertyIsEnumerable(r)||d.propertyIsEnumerable(r)?`def`:f.propertyIsEnumerable(r)||p.propertyIsEnumerable(r)||m.propertyIsEnumerable(r)?`string`:h.propertyIsEnumerable(r)?`typeName.standard`:g.propertyIsEnumerable(r)?`modifier`:_.propertyIsEnumerable(r)?`atom`:`variable`}function C(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){var o=t.peek();o&&(o=o.toLowerCase(),(o==`b`||o==`h`||o==`o`)&&t.next()),a=!0;break}r=!r&&i==`\\`}return(a||!(r||v))&&(n.tokenize=null),`string`}}function w(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=null;break}n=r==`*`}return`comment`}function T(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function E(e,t,n){var r=e.indented;return e.context&&e.context.type==`statement`&&(r=e.context.indented),e.context=new T(r,t,n,null,e.context)}function D(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}var O={name:`ttcn`,startState:function(){return{tokenize:null,context:new T(0,0,`top`,!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(n.align??=!1,t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;x=null;var r=(t.tokenize||S)(e,t);if(r==`comment`)return r;if(n.align??=!0,(x==`;`||x==`:`||x==`,`)&&n.type==`statement`)D(t);else if(x==`{`)E(t,e.column(),`}`);else if(x==`[`)E(t,e.column(),`]`);else if(x==`(`)E(t,e.column(),`)`);else if(x==`}`){for(;n.type==`statement`;)n=D(t);for(n.type==`}`&&(n=D(t));n.type==`statement`;)n=D(t)}else x==n.type?D(t):y&&((n.type==`}`||n.type==`top`)&&x!=`;`||n.type==`statement`&&x==`newstatement`)&&E(t,e.column(),`statement`);return t.startOfLine=!1,r},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},autocomplete:n}};export{O as ttcn};