mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-23 13:38:41 +00:00
8 lines
11 KiB
JavaScript
8 lines
11 KiB
JavaScript
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e="abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while|var",t="null|Infinity|NaN|undefined",n="AbstractMethodError|AssertionError|ClassCircularityError|ClassFormatError|Deprecated|EnumConstantNotPresentException|ExceptionInInitializerError|IllegalAccessError|IllegalThreadStateException|InstantiationError|InternalError|NegativeArraySizeException|NoSuchFieldError|Override|Process|ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|SuppressWarnings|TypeNotPresentException|UnknownError|UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|InstantiationException|IndexOutOfBoundsException|ArrayIndexOutOfBoundsException|CloneNotSupportedException|NoSuchFieldException|IllegalArgumentException|NumberFormatException|SecurityException|Void|InheritableThreadLocal|IllegalStateException|InterruptedException|NoSuchMethodException|IllegalAccessException|UnsupportedOperationException|Enum|StrictMath|Package|Compiler|Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|Character|Boolean|StackTraceElement|Appendable|StringBuffer|Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|StackOverflowError|OutOfMemoryError|VirtualMachineError|ArrayStoreException|ClassCastException|LinkageError|NoClassDefFoundError|ClassNotFoundException|RuntimeException|Exception|ThreadDeath|Error|Throwable|System|ClassLoader|Cloneable|Class|CharSequence|Comparable|String|Object",r=this.createKeywordMapper({"variable.language":"this",keyword:e,"constant.language":t,"support.function":n},"identifier");this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/},{token:"constant.numeric",regex:/[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{regex:"(open(?:\\s+))?module(?=\\s*\\w)",token:"keyword",next:[{regex:"{",token:"paren.lparen",next:[{regex:"}",token:"paren.rparen",next:"start"},{regex:"\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b",token:"keyword"}]},{token:"text",regex:"\\s+"},{token:"identifier",regex:"\\w+"},{token:"punctuation.operator",regex:"."},{token:"text",regex:"\\s+"},{regex:"",next:"start"}]},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\||\\^|\\*|\\/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?|\\:|\\*=|\\/=|%=|\\+=|\\-=|&=|\\|=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(o,s),t.JavaHighlightRules=o}),ace.define("ace/mode/drools_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/java_highlight_rules","ace/mode/doc_comment_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=e("./java_highlight_rules").JavaHighlightRules,o=e("./doc_comment_highlight_rules").DocCommentHighlightRules,u="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*",a="[a-zA-Z\\$_\u00a1-\uffff][\\.a-zA-Z\\d\\$_\u00a1-\uffff]*",f=function(){var e="date|effective|expires|lock|on|active|no|loop|auto|focus|activation|group|agenda|ruleflow|duration|timer|calendars|refract|direct|dialect|salience|enabled|attributes|extends|template|function|contains|matches|eval|excludes|soundslike|memberof|not|in|or|and|exists|forall|over|from|entry|point|accumulate|acc|collect|action|reverse|result|end|init|instanceof|extends|super|boolean|char|byte|short|int|long|float|double|this|void|class|new|case|final|if|else|for|while|do|default|try|catch|finally|switch|synchronized|return|throw|break|continue|assert|modify|static|public|protected|private|abstract|native|transient|volatile|strictfp|throws|interface|enum|implements|type|window|trait|no-loop|str",t="AbstractMethodError|AssertionError|ClassCircularityError|ClassFormatError|Deprecated|EnumConstantNotPresentException|ExceptionInInitializerError|IllegalAccessError|IllegalThreadStateException|InstantiationError|InternalError|NegativeArraySizeException|NoSuchFieldError|Override|Process|ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|SuppressWarnings|TypeNotPresentException|UnknownError|UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|InstantiationException|IndexOutOfBoundsException|ArrayIndexOutOfBoundsException|CloneNotSupportedException|NoSuchFieldException|IllegalArgumentException|NumberFormatException|SecurityException|Void|InheritableThreadLocal|IllegalStateException|InterruptedException|NoSuchMethodException|IllegalAccessException|UnsupportedOperationException|Enum|StrictMath|Package|Compiler|Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|Character|Boolean|StackTraceElement|Appendable|StringBuffer|Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|StackOverflowError|OutOfMemoryError|VirtualMachineError|ArrayStoreException|ClassCastException|LinkageError|NoClassDefFoundError|ClassNotFoundException|RuntimeException|Exception|ThreadDeath|Error|Throwable|System|ClassLoader|Cloneable|Class|CharSequence|Comparable|String|Object",n=this.createKeywordMapper({"variable.language":"this",keyword:e,"constant.language":"null","support.class":t,"support.function":"retract|update|modify|insert"},"identifier"),r=function(){return[{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}]},i=function(e){return[{token:"comment",regex:"\\/\\/.*$"},o.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:e},{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"}]},f=function(e){return[{token:"comment.block",regex:"\\*\\/",next:e},{defaultToken:"comment.block"}]},l=function(){return[{token:n,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}]};this.$rules={start:[].concat(i("block.comment"),[{token:"entity.name.type",regex:"@[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:["keyword","text","entity.name.type"],regex:"(package)(\\s+)("+a+")"},{token:["keyword","text","keyword","text","entity.name.type"],regex:"(import)(\\s+)(function)(\\s+)("+a+")"},{token:["keyword","text","entity.name.type"],regex:"(import)(\\s+)("+a+")"},{token:["keyword","text","entity.name.type","text","variable"],regex:"(global)(\\s+)("+a+")(\\s+)("+u+")"},{token:["keyword","text","keyword","text","entity.name.type"],regex:"(declare)(\\s+)(trait)(\\s+)("+u+")"},{token:["keyword","text","entity.name.type"],regex:"(declare)(\\s+)("+u+")"},{token:["keyword","text","entity.name.type"],regex:"(extends)(\\s+)("+a+")"},{token:["keyword","text"],regex:"(rule)(\\s+)",next:"asset.name"}],r(),[{token:["variable.other","text","text"],regex:"("+u+")(\\s*)(:)"},{token:["keyword","text"],regex:"(query)(\\s+)",next:"asset.name"},{token:["keyword","text"],regex:"(when)(\\s*)"},{token:["keyword","text"],regex:"(then)(\\s*)",next:"java-start"},{token:"paren.lparen",regex:/[\[({]/},{token:"paren.rparen",regex:/[\])}]/}],l()),"block.comment":f("start"),"asset.name":[{token:"entity.name",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"entity.name",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"entity.name",regex:u},{regex:"",token:"empty",next:"start"}]},this.embedRules(o,"doc-",[o.getEndRule("start")]),this.embedRules(s,"java-",[{token:"support.function",regex:"\\b(insert|modify|retract|update)\\b"},{token:"keyword",regex:"\\bend\\b",next:"start"}])};r.inherits(f,i),t.DroolsHighlightRules=f}),ace.define("ace/mode/folding/drools",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=e("../../token_iterator").TokenIterator,u=t.FoldMode=function(){};r.inherits(u,s),function(){this.foldingStartMarker=/\b(rule|declare|query|when|then)\b/,this.foldingStopMarker=/\bend\b/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),s=r.match(this.foldingStartMarker);if(s){var u=s.index;if(s[1]){var a={row:n,column:r.length},f=new o(e,a.row,a.column),l="end",c=f.getCurrentToken();c.value=="when"&&(l="then");while(c){if(c.value==l)return i.fromPoints(a,{row:f.getCurrentTokenRow(),column:f.getCurrentTokenColumn()});c=f.stepForward()}}}}}.call(u.prototype)}),ace.define("ace/mode/drools",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/drools_highlight_rules","ace/mode/folding/drools"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./drools_highlight_rules").DroolsHighlightRules,o=e("./folding/drools").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="//",this.$id="ace/mode/drools",this.snippetFileId="ace/snippets/drools"}.call(u.prototype),t.Mode=u}); (function() {
|
|
ace.require(["ace/mode/drools"], function(m) {
|
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
module.exports = m;
|
|
}
|
|
});
|
|
})();
|
|
|