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