1{"version":3,"sources":["../../node_modules/codemirror/mode/fcl/fcl.js"],"names":["mod","exports","module","require","define","amd","CodeMirror","defineMode","config","indentUnit","keywords","term","method","accu","rule","then","is","and","or","if","default","start_blocks","var_input","var_output","fuzzify","defuzzify","function_block","ruleblock","end_blocks","end_ruleblock","end_defuzzify","end_function_block","end_fuzzify","end_var","atoms","true","false","nan","real","min","max","cog","cogs","isOperatorChar","tokenBase","stream","state","ch","next","test","match","eat","tokenize","tokenComment","skipToEnd","eatWhile","cur","current","toLowerCase","propertyIsEnumerable","maybeEnd","Context","indented","column","type","align","prev","this","pushContext","col","context","popContext","t","startState","basecolumn","startOfLine","token","ctx","sol","indentation","eatSpace","style","indent","textAfter","closing","electricChars","fold","blockCommentStart","blockCommentEnd","lineComment","defineMIME"],"mappings":"CAGA,SAAUA,GACR,SAAWC,UAAW,gBAAmBC,SAAU,SACjDF,EAAIG,QAAQ,6BACT,UAAWC,SAAU,YAAcA,OAAOC,IAC7CD,QAAQ,wBAAyBJ,OAEjCA,GAAIM,cACL,SAASA,GACZ,YAEAA,GAAWC,WAAW,MAAO,SAASC,GACpC,GAAIC,GAAaD,EAAOC,UAExB,IAAIC,IACAC,KAAQ,KACRC,OAAU,KAAMC,KAAQ,KACxBC,KAAQ,KAAMC,KAAQ,KAAMC,GAAM,KAAMC,IAAO,KAAMC,GAAM,KAC3DC,KAAM,KAAMC,UAAW,KAG3B,IAAIC,IACAC,UAAa,KACbC,WAAc,KACdC,QAAW,KACXC,UAAa,KACbC,eAAkB,KAClBC,UAAa,KAGjB,IAAIC,IACAC,cAAiB,KACjBC,cAAiB,KACjBC,mBAAsB,KACtBC,YAAe,KACfC,QAAW,KAGf,IAAIC,IACAC,OAAQ,KAAMC,QAAS,KAAMC,IAAO,KACpCC,KAAQ,KAAMC,IAAO,KAAMC,IAAO,KAAMC,IAAO,KAAMC,KAAQ,KAGjE,IAAIC,GAAiB,mBAErB,SAASC,GAAUC,EAAQC,GACzB,GAAIC,GAAKF,EAAO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license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"fcl\", function(config) {\n  var indentUnit = config.indentUnit;\n\n  var keywords = {\n      \"term\": true,\n      \"method\": true, \"accu\": true,\n      \"rule\": true, \"then\": true, \"is\": true, \"and\": true, \"or\": true,\n      \"if\": true, \"default\": true\n  };\n\n  var start_blocks = {\n      \"var_input\": true,\n      \"var_output\": true,\n      \"fuzzify\": true,\n      \"defuzzify\": true,\n      \"function_block\": true,\n      \"ruleblock\": true\n  };\n\n  var end_blocks = {\n      \"end_ruleblock\": true,\n      \"end_defuzzify\": true,\n      \"end_function_block\": true,\n      \"end_fuzzify\": true,\n      \"end_var\": true\n  };\n\n  var atoms = {\n      \"true\": true, \"false\": true, \"nan\": true,\n      \"real\": true, \"min\": true, \"max\": true, \"cog\": true, \"cogs\": true\n  };\n\n  var isOperatorChar = /[+\\-*&^%:=<>!|\\/]/;\n\n  function tokenBase(stream, state) {\n    var ch = stream.next();\n\n    if (/[\\d\\.]/.test(ch)) {\n      if (ch == \".\") {\n        stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n      } else if (ch == \"0\") {\n        stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n      } else {\n        stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n      }\n      return \"number\";\n    }\n\n    if (ch == \"/\" || ch == \"(\") {\n      if (stream.eat(\"*\")) {\n        state.tokenize = tokenComment;\n        return tokenComment(stream, state);\n      }\n      if (stream.eat(\"/\")) {\n        stream.skipToEnd();\n        return \"comment\";\n      }\n    }\n    if (isOperatorChar.test(ch)) {\n      stream.eatWhile(isOperatorChar);\n      return \"operator\";\n    }\n    stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n\n    var cur = stream.current().toLowerCase();\n    if (keywords.propertyIsEnumerable(cur) ||\n        start_blocks.propertyIsEnumerable(cur) ||\n        end_blocks.propertyIsEnumerable(cur)) {\n      return \"keyword\";\n    }\n    if (atoms.propertyIsEnumerable(cur)) return \"atom\";\n    return \"variable\";\n  }\n\n\n  function tokenComment(stream, state) {\n    var maybeEnd = false, ch;\n    while (ch = stream.next()) {\n      if ((ch == \"/\" || ch == \")\") && maybeEnd) {\n        state.tokenize = tokenBase;\n        break;\n      }\n      maybeEnd = (ch == \"*\");\n    }\n    return \"comment\";\n  }\n\n  function Context(indented, column, type, align, prev) {\n    this.indented = indented;\n    this.column = column;\n    this.type = type;\n    this.align = align;\n    this.prev = prev;\n  }\n\n  function pushContext(state, col, type) {\n    return state.context = new Context(state.indented, col, type, null, state.context);\n  }\n\n  function popContext(state) {\n    if (!state.context.prev) return;\n    var t = state.context.type;\n    if (t == \"end_block\")\n      state.indented = state.context.indented;\n    return state.context = state.context.prev;\n  }\n\n  // Interface\n\n  return {\n    startState: function(basecolumn) {\n      return {\n        tokenize: null,\n        context: new Context((basecolumn || 0) - indentUnit, 0, \"top\", false),\n        indented: 0,\n        startOfLine: true\n      };\n    },\n\n    token: function(stream, state) {\n        var ctx = state.context;\n        if (stream.sol()) {\n            if (ctx.align == null) ctx.align = false;\n            state.indented = stream.indentation();\n            state.startOfLine = true;\n        }\n        if (stream.eatSpace()) return null;\n\n        var style = (state.tokenize || tokenBase)(stream, state);\n        if (style == \"comment\") return style;\n        if (ctx.align == null) ctx.align = true;\n\n        var cur = stream.current().toLowerCase();\n\n        if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), \"end_block\");\n        else if (end_blocks.propertyIsEnumerable(cur))  popContext(state);\n\n        state.startOfLine = false;\n        return style;\n    },\n\n    indent: function(state, textAfter) {\n      if (state.tokenize != tokenBase && state.tokenize != null) return 0;\n      var ctx = state.context;\n\n      var closing = end_blocks.propertyIsEnumerable(textAfter);\n      if (ctx.align) return ctx.column + (closing ? 0 : 1);\n      else return ctx.indented + (closing ? 0 : indentUnit);\n    },\n\n    electricChars: \"ryk\",\n    fold: \"brace\",\n    blockCommentStart: \"(*\",\n    blockCommentEnd: \"*)\",\n    lineComment: \"//\"\n  };\n});\n\nCodeMirror.defineMIME(\"text/x-fcl\", \"fcl\");\n});\n"]}