'use strict';(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function a(a){var c={};a=a.split(" ");for(var g=0;g<a.length;++g)c[a[g]]=!0;return c}h.defineMode("ttcn",function(a,c){function g(b,f){var d=b.next();if('"'==d||"'"==d)return f.tokenize=h(d),f.tokenize(b,f);if(/[\[\]{}\(\),;\\:\?\.]/.test(d))return e=d,"punctuation";if("#"==d)return b.skipToEnd(),
"atom preprocessor";if("%"==d)return b.eatWhile(/\b/),"atom ttcn3Macros";if(/\d/.test(d))return b.eatWhile(/[\w\.]/),"number";if("/"==d){if(b.eat("*"))return f.tokenize=p,p(b,f);if(b.eat("/"))return b.skipToEnd(),"comment"}if(q.test(d)){if("@"==d&&(b.match("try")||b.match("catch")||b.match("lazy")))return"keyword";b.eatWhile(q);return"operator"}b.eatWhile(/[\w\$_\xa1-\uffff]/);b=b.current();return t.propertyIsEnumerable(b)?"keyword":u.propertyIsEnumerable(b)?"builtin":v.propertyIsEnumerable(b)?"def timerOps":
w.propertyIsEnumerable(b)?"def configOps":x.propertyIsEnumerable(b)?"def verdictOps":y.propertyIsEnumerable(b)?"def portOps":z.propertyIsEnumerable(b)?"def sutOps":A.propertyIsEnumerable(b)?"def functionOps":B.propertyIsEnumerable(b)?"string verdictConsts":C.propertyIsEnumerable(b)?"string booleanConsts":D.propertyIsEnumerable(b)?"string otherConsts":E.propertyIsEnumerable(b)?"builtin types":F.propertyIsEnumerable(b)?"builtin visibilityModifiers":G.propertyIsEnumerable(b)?"atom templateMatch":"variable"}
function h(b){return function(f,d){for(var c=!1,a,e=!1;null!=(a=f.next());){if(a==b&&!c){if(a=f.peek())a=a.toLowerCase(),"b"!=a&&"h"!=a&&"o"!=a||f.next();e=!0;break}c=!c&&"\\"==a}if(e||!c&&!H)d.tokenize=null;return"string"}}function p(b,f){for(var d=!1,a;a=b.next();){if("/"==a&&d){f.tokenize=null;break}d="*"==a}return"comment"}function r(b,a,d,c,e){this.indented=b;this.column=a;this.type=d;this.align=c;this.prev=e}function l(b,a,d){var c=b.indented;b.context&&"statement"==b.context.type&&(c=b.context.indented);
return b.context=new r(c,a,d,null,b.context)}function k(b){var a=b.context.type;if(")"==a||"]"==a||"}"==a)b.indented=b.context.indented;return b.context=b.context.prev}var I=a.indentUnit,t=c.keywords||{},u=c.builtin||{},v=c.timerOps||{},y=c.portOps||{},w=c.configOps||{},x=c.verdictOps||{},z=c.sutOps||{},A=c.functionOps||{},B=c.verdictConsts||{},C=c.booleanConsts||{},D=c.otherConsts||{},E=c.types||{},F=c.visibilityModifiers||{},G=c.templateMatch||{},H=c.multiLineStrings,J=!1!==c.indentStatements,q=
/[+\-*&@=<>!\/]/,e;return{startState:function(b){return{tokenize:null,context:new r((b||0)-I,0,"top",!1),indented:0,startOfLine:!0}},token:function(b,a){var c=a.context;b.sol()&&(null==c.align&&(c.align=!1),a.indented=b.indentation(),a.startOfLine=!0);if(b.eatSpace())return null;e=null;var f=(a.tokenize||g)(b,a);if("comment"==f)return f;null==c.align&&(c.align=!0);if(";"!=e&&":"!=e&&","!=e||"statement"!=c.type)if("{"==e)l(a,b.column(),"}");else if("["==e)l(a,b.column(),"]");else if("("==e)l(a,b.column(),
")");else if("}"==e){for(;"statement"==c.type;)c=k(a);for("}"==c.type&&(c=k(a));"statement"==c.type;)c=k(a)}else e==c.type?k(a):J&&(("}"==c.type||"top"==c.type)&&";"!=e||"statement"==c.type&&"newstatement"==e)&&l(a,b.column(),"statement");else k(a);a.startOfLine=!1;return f},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});(function(a,c){function g(a){if(a)for(var c in a)a.hasOwnProperty(c)&&m.push(c)}"string"==typeof a&&(a=[a]);var m=[];g(c.keywords);
g(c.builtin);g(c.timerOps);g(c.portOps);m.length&&(c.helperType=a[0],h.registerHelper("hintWords",a[0],m));for(var n=0;n<a.length;++n)h.defineMIME(a[n],c)})(["text/x-ttcn","text/x-ttcn3","text/x-ttcnpp"],{name:"ttcn",keywords:a("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:a("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:a("anytype bitstring boolean char charstring default float hexstring integer objid octetstring universal verdicttype timer"),
timerOps:a("read running start stop timeout"),portOps:a("call catch check clear getcall getreply halt raise receive reply send trigger"),configOps:a("create connect disconnect done kill killed map unmap"),verdictOps:a("getverdict setverdict"),sutOps:a("action"),functionOps:a("apply derefers refers"),verdictConsts:a("error fail inconc none pass"),booleanConsts:a("true false"),otherConsts:a("null NULL omit"),visibilityModifiers:a("private public friend"),templateMatch:a("complement ifpresent subset superset permutation"),
multiLineStrings:!0})});
