1{"version":3,"sources":["../../node_modules/codemirror/mode/turtle/turtle.js"],"names":["mod","exports","module","require","define","amd","CodeMirror","defineMode","config","indentUnit","curPunc","wordRegexp","words","RegExp","join","ops","keywords","operatorChars","tokenBase","stream","state","ch","next","match","tokenize","tokenLiteral","test","skipToEnd","eatWhile","peek","word","current","quote","escaped","pushContext","type","col","context","prev","indent","popContext","startState","token","sol","align","indentation","eatSpace","style","column","textAfter","firstChar","charAt","closing","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,SAAU,SAASC,GACvC,GAAIC,GAAaD,EAAOC,UACxB,IAAIC,EAEJ,SAASC,GAAWC,GAClB,MAAO,IAAIC,QAAO,OAASD,EAAME,KAAK,KAAO,KAAM,KAErD,GAAIC,GAAMJ,KACV,IAAIK,GAAWL,GAAY,UAAW,QAAS,KAC/C,IAAIM,GAAgB,aAEpB,SAASC,GAAUC,EAAQC,GACzB,GAAIC,GAAKF,EAAOG,MAChBZ,GAAU,IACV,IAAIW,GAAM,MAAQF,EAAOI,MAAM,eAAgB,OAAQ,CACrDJ,EAAOI,MAAM,mBACb,OAAO,WAEJ,IAAIF,GAAM,KAAQA,GAAM,IAAK,CAChCD,EAAMI,SAAWC,EAAaJ,EAC9B,OAAOD,GAAMI,SAASL,EAAQC,OAE3B,IAAI,mBAAmBM,KAAKL,GAAK,CACpCX,EAAUW,CACV,OAAO,UAEJ,IAAIA,GAAM,IAAK,CAClBF,EAAOQ,WACP,OAAO,cAEJ,IAAIV,EAAcS,KAAKL,GAAK,CAC/BF,EAAOS,SAASX,EAChB,OAAO,UAEJ,IAAII,GAAM,IAAK,CACd,MAAO,eACF,CACTF,EAAOS,SAAS,UAChB,IAAGT,EAAOU,QAAU,IAAK,CAC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O6B,cAC9C,IAAItC,GAAW,IAAKwB,EAAYd,EAAO,IAAKD,EAAO6B,cACnD,IAAItC,GAAW,IAAKwB,EAAYd,EAAO,IAAKD,EAAO6B,cACnD,IAAI,WAAWtB,KAAKhB,GAAU,CACjC,MAAOU,EAAMiB,SAAWjB,EAAMiB,QAAQF,MAAQ,UAAWK,EAAWpB,EACpE,IAAIA,EAAMiB,SAAW3B,GAAWU,EAAMiB,QAAQF,KAAMK,EAAWpB,OAE5D,IAAIV,GAAW,KAAOU,EAAMiB,SAAWjB,EAAMiB,QAAQF,MAAQ,UAAWK,EAAWpB,OACnF,IAAI,uBAAuBM,KAAKqB,IAAU3B,EAAMiB,QAAS,CAC5D,GAAI,SAASX,KAAKN,EAAMiB,QAAQF,MAC9BD,EAAYd,EAAO,UAAWD,EAAO6B,cAClC,IAAI5B,EAAMiB,QAAQF,MAAQ,YAAcf,EAAMiB,QAAQO,MAAO,CAChExB,EAAMiB,QAAQO,MAAQ,IACtBxB,GAAMiB,QAAQD,IAAMjB,EAAO6B,UAI/B,MAAOD,IAGTR,OAAQ,SAASnB,EAAO6B,GACtB,GAAIC,GAAYD,GAAaA,EAAUE,OAAO,EAC9C,IAAId,GAAUjB,EAAMiB,OACpB,IAAI,SAASX,KAAKwB,GAChB,MAAOb,GAAWA,EAAQF,MAAQ,UAAWE,EAAUA,EAAQC,IAEjE,IAAIc,GAAUf,GAAWa,GAAab,EAAQF,IAC9C,KAAKE,EACH,MAAO,OACJ,IAAIA,EAAQF,MAAQ,UACvB,MAAOE,GAAQD,QACZ,IAAIC,EAAQO,MACf,MAAOP,GAAQD,KAAOgB,EAAU,EAAI,OAEpC,OAAOf,GAAQE,QAAUa,EAAU,EAAI3C,IAG3C4C,YAAa,MAIjB/C,GAAWgD,WAAW,cAAe","file":"turtle.min.js","sourcesContent":["// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT 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(\"turtle\", function(config) {\n  var indentUnit = config.indentUnit;\n  var curPunc;\n\n  function wordRegexp(words) {\n    return new RegExp(\"^(?:\" + words.join(\"|\") + \")$\", \"i\");\n  }\n  var ops = wordRegexp([]);\n  var keywords = wordRegexp([\"@prefix\", \"@base\", \"a\"]);\n  var operatorChars = /[*+\\-<>=&|]/;\n\n  function tokenBase(stream, state) {\n    var ch = stream.next();\n    curPunc = null;\n    if (ch == \"<\" && !stream.match(/^[\\s\\u00a0=]/, false)) {\n      stream.match(/^[^\\s\\u00a0>]*>?/);\n      return \"atom\";\n    }\n    else if (ch == \"\\\"\" || ch == \"'\") {\n      state.tokenize = tokenLiteral(ch);\n      return state.tokenize(stream, state);\n    }\n    else if (/[{}\\(\\),\\.;\\[\\]]/.test(ch)) {\n      curPunc = ch;\n      return null;\n    }\n    else if (ch == \"#\") {\n      stream.skipToEnd();\n      return \"comment\";\n    }\n    else if (operatorChars.test(ch)) {\n      stream.eatWhile(operatorChars);\n      return null;\n    }\n    else if (ch == \":\") {\n          return \"operator\";\n        } else {\n      stream.eatWhile(/[_\\w\\d]/);\n      if(stream.peek() == \":\") {\n        return \"variable-3\";\n      } else {\n             var word = stream.current();\n\n             if(keywords.test(word)) {\n                        return \"meta\";\n             }\n\n             if(ch >= \"A\" && ch <= \"Z\") {\n                    return \"comment\";\n                 } else {\n                        return \"keyword\";\n                 }\n      }\n      var word = stream.current();\n      if (ops.test(word))\n        return null;\n      else if (keywords.test(word))\n        return \"meta\";\n      else\n        return \"variable\";\n    }\n  }\n\n  function tokenLiteral(quote) {\n    return function(stream, state) {\n      var escaped = false, ch;\n      while ((ch = stream.next()) != null) {\n        if (ch == quote && !escaped) {\n          state.tokenize = tokenBase;\n          break;\n        }\n        escaped = !escaped && ch == \"\\\\\";\n      }\n      return \"string\";\n    };\n  }\n\n  function pushContext(state, type, col) {\n    state.context = {prev: state.context, indent: state.indent, col: col, type: type};\n  }\n  function popContext(state) {\n    state.indent = state.context.indent;\n    state.context = state.context.prev;\n  }\n\n  return {\n    startState: function() {\n      return {tokenize: tokenBase,\n              context: null,\n              indent: 0,\n              col: 0};\n    },\n\n    token: function(stream, state) {\n      if (stream.sol()) {\n        if (state.context && state.context.align == null) state.context.align = false;\n        state.indent = stream.indentation();\n      }\n      if (stream.eatSpace()) return null;\n      var style = state.tokenize(stream, state);\n\n      if (style != \"comment\" && state.context && state.context.align == null && state.context.type != \"pattern\") {\n        state.context.align = true;\n      }\n\n      if (curPunc == \"(\") pushContext(state, \")\", stream.column());\n      else if (curPunc == \"[\") pushContext(state, \"]\", stream.column());\n      else if (curPunc == \"{\") pushContext(state, \"}\", stream.column());\n      else if (/[\\]\\}\\)]/.test(curPunc)) {\n        while (state.context && state.context.type == \"pattern\") popContext(state);\n        if (state.context && curPunc == state.context.type) popContext(state);\n      }\n      else if (curPunc == \".\" && state.context && state.context.type == \"pattern\") popContext(state);\n      else if (/atom|string|variable/.test(style) && state.context) {\n        if (/[\\}\\]]/.test(state.context.type))\n          pushContext(state, \"pattern\", stream.column());\n        else if (state.context.type == \"pattern\" && !state.context.align) {\n          state.context.align = true;\n          state.context.col = stream.column();\n        }\n      }\n\n      return style;\n    },\n\n    indent: function(state, textAfter) {\n      var firstChar = textAfter && textAfter.charAt(0);\n      var context = state.context;\n      if (/[\\]\\}]/.test(firstChar))\n        while (context && context.type == \"pattern\") context = context.prev;\n\n      var closing = context && firstChar == context.type;\n      if (!context)\n        return 0;\n      else if (context.type == \"pattern\")\n        return context.col;\n      else if (context.align)\n        return context.col + (closing ? 0 : 1);\n      else\n        return context.indent + (closing ? 0 : indentUnit);\n    },\n\n    lineComment: \"#\"\n  };\n});\n\nCodeMirror.defineMIME(\"text/turtle\", \"turtle\");\n\n});\n"]}