discourse/public/javascripts/ace/mode-velocity.js

1 line
34 KiB
JavaScript
Raw Normal View History

define("ace/mode/velocity",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/velocity_highlight_rules","ace/mode/folding/velocity","ace/mode/behaviour/html"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./velocity_highlight_rules").VelocityHighlightRules,u=e("./folding/velocity").FoldMode,a=e("./behaviour/html").HtmlBehaviour,f=function(){var e=new o;this.foldingRules=new u,this.$tokenizer=new s(e.getRules()),this.$behaviour=new a};r.inherits(f,i),function(){this.lineCommentStart="##",this.blockComment={start:"#*",end:"*#"}}.call(f.prototype),t.Mode=f}),define("ace/mode/velocity_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/xml_util","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./xml_util"),o=e("./text_highlight_rules").TextHighlightRules,u=e("./css_highlight_rules").CssHighlightRules,a=e("./javascript_highlight_rules").JavaScriptHighlightRules,f=function(){var e=i.arrayToMap("true|false|null".split("|")),t=i.arrayToMap("_DateTool|_DisplayTool|_EscapeTool|_FieldTool|_MathTool|_NumberTool|_SerializerTool|_SortTool|_StringTool|_XPathTool".split("|")),n=i.arrayToMap("$contentRoot|$foreach".split("|")),r=i.arrayToMap("#set|#macro|#include|#parse|#if|#elseif|#else|#foreach|#break|#end|#stop".split("|"));this.$rules={start:[{token:"meta.tag",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml-pe",regex:"<\\?.*?\\?>"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"meta.tag",regex:"<(?=\\s*script\\b)",next:"script"},{token:"meta.tag",regex:"<(?=\\s*style\\b)",next:"style"},{token:"meta.tag",regex:"<\\/?(?=[a-z])",next:"tag"},{token:"comment",regex:"##.*$"},{token:"comment.block",regex:"#\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(i){return r.hasOwnProperty(i)?"keyword":e.hasOwnProperty(i)?"constant.language":n.hasOwnProperty(i)?"variable.language":t.hasOwnProperty(i)||t.hasOwnProperty(i.substring(1))?"support.function":i=="debugger"?"invalid.deprecated":i.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*)$/)?"variable":"identifier"},regex:"[a-zA-Z$#][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"!|&|\\*|\\-|\\+|=|!=|<=|>=|<|>|&&|\\|\\|"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:".+"}],comment:[{token:"comment",regex:"\\*#|-->",next:"start"},{defaultToken:"comment"}],vm_start:[{token:"variable",regex:"}",next:"start"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(i){return r.hasOwnProperty(i)?"keyword":e.hasOwnProperty(i)?"constant.language":n.hasOwnProperty(i)?"variable.language":t.hasOwnProperty(i)||t.hasOwnProperty(i.substring(1))?"support.function":i=="debugger"?"invalid.deprecated":i.match(/^(\$[a-zA-Z_$][a-zA-Z0-9_]*)$/)?"variable":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|&|\\*|\\-|\\+|=|!=|<=|>=|<|>|&&|\\|\\|"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}]},s.tag(this.$rules,"tag","start"),s.tag(this.$rules,"style","css-start"),s.tag(this.$rul