'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){d.defineMode("fcl",function(d){function f(a,b){var c=a.next();if(/[\d\.]/.test(c))return"."==c?a.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==c?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 b.tokenize=
h,h(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(k.test(c))return a.eatWhile(k),"operator";a.eatWhile(/[\w\$_\xa1-\uffff]/);a=a.current().toLowerCase();return p.propertyIsEnumerable(a)||l.propertyIsEnumerable(a)||g.propertyIsEnumerable(a)?"keyword":q.propertyIsEnumerable(a)?"atom":"variable"}function h(a,b){for(var c=!1,e;e=a.next();){if(("/"==e||")"==e)&&c){b.tokenize=f;break}c="*"==e}return"comment"}function m(a,b,c,e,d){this.indented=a;this.column=b;this.type=c;this.align=e;this.prev=d}
var n=d.indentUnit,p={term:!0,method:!0,accu:!0,rule:!0,then:!0,is:!0,and:!0,or:!0,"if":!0,"default":!0},l={var_input:!0,var_output:!0,fuzzify:!0,defuzzify:!0,function_block:!0,ruleblock:!0},g={end_ruleblock:!0,end_defuzzify:!0,end_function_block:!0,end_fuzzify:!0,end_var:!0},q={"true":!0,"false":!0,nan:!0,real:!0,min:!0,max:!0,cog:!0,cogs:!0},k=/[+\-*&^%:=<>!|\/]/;return{startState:function(a){return{tokenize:null,context:new m((a||0)-n,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=
b.context;a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0);if(a.eatSpace())return null;var d=(b.tokenize||f)(a,b);if("comment"==d)return d;null==c.align&&(c.align=!0);c=a.current().toLowerCase();l.propertyIsEnumerable(c)?(a=a.column(),b.context=new m(b.indented,a,"end_block",null,b.context)):g.propertyIsEnumerable(c)&&b.context.prev&&("end_block"==b.context.type&&(b.indented=b.context.indented),b.context=b.context.prev);b.startOfLine=!1;return d},indent:function(a,
b){if(a.tokenize!=f&&null!=a.tokenize)return 0;a=a.context;b=g.propertyIsEnumerable(b);return a.align?a.column+(b?0:1):a.indented+(b?0:n)},electricChars:"ryk",fold:"brace",blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:"//"}});d.defineMIME("text/x-fcl","fcl")});
