var keywords={term:!0,method:!0,accu:!0,rule:!0,then:!0,is:!0,and:!0,or:!0,if:!0,default:!0},start_blocks={var_input:!0,var_output:!0,fuzzify:!0,defuzzify:!0,function_block:!0,ruleblock:!0},end_blocks={end_ruleblock:!0,end_defuzzify:!0,end_function_block:!0,end_fuzzify:!0,end_var:!0},atoms={true:!0,false:!0,nan:!0,real:!0,min:!0,max:!0,cog:!0,cogs:!0},isOperatorChar=/[+\-*&^%:=<>!|\/]/;function tokenBase(e,t){var n=e.next();if(/[\d\.]/.test(n))return "."==n?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==n?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if("/"==n||"("==n){if(e.eat("*"))return t.tokenize=tokenComment,tokenComment(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(isOperatorChar.test(n))return e.eatWhile(isOperatorChar),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var o=e.current().toLowerCase();return keywords.propertyIsEnumerable(o)||start_blocks.propertyIsEnumerable(o)||end_blocks.propertyIsEnumerable(o)?"keyword":atoms.propertyIsEnumerable(o)?"atom":"variable"}function tokenComment(e,t){for(var n,o=!1;n=e.next();){if(("/"==n||")"==n)&&o){t.tokenize=tokenBase;break}o="*"==n;}return "comment"}function Context(e,t,n,o,r){this.indented=e,this.column=t,this.type=n,this.align=o,this.prev=r;}function pushContext(e,t,n){return e.context=new Context(e.indented,t,n,null,e.context)}function popContext(e){if(e.context.prev)return "end_block"==e.context.type&&(e.indented=e.context.indented),e.context=e.context.prev}const fcl={startState:function(e){return {tokenize:null,context:new Context(-e,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;var o=(t.tokenize||tokenBase)(e,t);if("comment"==o)return o;null==n.align&&(n.align=!0);var r=e.current().toLowerCase();return start_blocks.propertyIsEnumerable(r)?pushContext(t,e.column(),"end_block"):end_blocks.propertyIsEnumerable(r)&&popContext(t),t.startOfLine=!1,o},indent:function(e,t,n){if(e.tokenize!=tokenBase&&null!=e.tokenize)return 0;var o=e.context,r=end_blocks.propertyIsEnumerable(t);return o.align?o.column+(r?0:1):o.indented+(r?0:n.unit)},languageData:{commentTokens:{line:"//",block:{open:"(*",close:"*)"}}}};

export { fcl };
