!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";var e={mscgen:{keywords:["msc"],options:["hscale","width","arcgradient","wordwraparcs"],constants:["true","false","on","off"],attributes:["label","idurl","id","url","linecolor","linecolour","textcolor","textcolour","textbgcolor","textbgcolour","arclinecolor","arclinecolour","arctextcolor","arctextcolour","arctextbgcolor","arctextbgcolour","arcskip"],brackets:["\\{","\\}"],arcsWords:["note","abox","rbox","box"],arcsOthers:["\\|\\|\\|","\\.\\.\\.","---","--","<->","==","<<=>>","<=>","\\.\\.","<<>>","::","<:>","->","=>>","=>",">>",":>","<-","<<=","<=","<<","<:","x-","-x"],singlecomment:["//","#"],operators:["="]},xu:{keywords:["msc","xu"],options:["hscale","width","arcgradient","wordwraparcs","wordwrapentities","watermark"],constants:["true","false","on","off","auto"],attributes:["label","idurl","id","url","linecolor","linecolour","textcolor","textcolour","textbgcolor","textbgcolour","arclinecolor","arclinecolour","arctextcolor","arctextcolour","arctextbgcolor","arctextbgcolour","arcskip","title","deactivate","activate","activation"],brackets:["\\{","\\}"],arcsWords:["note","abox","rbox","box","alt","else","opt","break","par","seq","strict","neg","critical","ignore","consider","assert","loop","ref","exc"],arcsOthers:["\\|\\|\\|","\\.\\.\\.","---","--","<->","==","<<=>>","<=>","\\.\\.","<<>>","::","<:>","->","=>>","=>",">>",":>","<-","<<=","<=","<<","<:","x-","-x"],singlecomment:["//","#"],operators:["="]},msgenny:{keywords:null,options:["hscale","width","arcgradient","wordwraparcs","wordwrapentities","watermark"],constants:["true","false","on","off","auto"],attributes:null,brackets:["\\{","\\}"],arcsWords:["note","abox","rbox","box","alt","else","opt","break","par","seq","strict","neg","critical","ignore","consider","assert","loop","ref","exc"],arcsOthers:["\\|\\|\\|","\\.\\.\\.","---","--","<->","==","<<=>>","<=>","\\.\\.","<<>>","::","<:>","->","=>>","=>",">>",":>","<-","<<=","<=","<<","<:","x-","-x"],singlecomment:["//","#"],operators:["="]}};function n(t){return new RegExp("\\b("+t.join("|")+")\\b","i")}function o(t){return new RegExp("("+t.join("|")+")","i")}function i(){return{inComment:!1,inString:!1,inAttributeList:!1,inScript:!1}}function c(t){return{inComment:t.inComment,inString:t.inString,inAttributeList:t.inAttributeList,inScript:t.inScript}}t.defineMode("mscgen",function(t,r){return{startState:i,copyState:c,token:function(e){return function(t,r){if(t.match(o(e.brackets),!0,!0))return"bracket";if(!r.inComment){if(t.match(/\/\*[^\*\/]*/,!0,!0))return r.inComment=!0,"comment";if(t.match(o(e.singlecomment),!0,!0))return t.skipToEnd(),"comment"}if(r.inComment)return t.match(/[^\*\/]*\*\//,!0,!0)?r.inComment=!1:t.skipToEnd(),"comment";if(!r.inString&&t.match(/\"(\\\"|[^\"])*/,!0,!0))return r.inString=!0,"string";if(r.inString)return t.match(/[^\"]*\"/,!0,!0)?r.inString=!1:t.skipToEnd(),"string";if(e.keywords&&t.match(n(e.keywords),!0,!0))return"keyword";if(t.match(n(e.options),!0,!0))return"keyword";if(t.match(n(e.arcsWords),!0,!0))return"keyword";if(t.match(o(e.arcsOthers),!0,!0))return"keyword";if(e.operators&&t.match(o(e.operators),!0,!0))return"operator";if(e.constants&&t.match(o(e.constants),!0,!0))return"variable";if(!e.inAttributeList&&e.attributes&&t.match(/\[/,!0,!0))return e.inAttributeList=!0,"bracket";if(e.inAttributeList){if(null!==e.attributes&&t.match(n(e.attributes),!0,!0))return"attribute";if(t.match(/]/,!0,!0))return e.inAttributeList=!1,"bracket"}return t.next(),"base"}}(e[r&&r.language||"mscgen"]),lineComment:"#",blockCommentStart:"/*",blockCommentEnd:"*/"}}),t.defineMIME("text/x-mscgen","mscgen"),t.defineMIME("text/x-xu",{name:"mscgen",language:"xu"}),t.defineMIME("text/x-msgenny",{name:"mscgen",language:"msgenny"})});