笙默考试管理系统-MyExamTest----codemirror(64)
笙默考试管理系统-MyExamTest----codemirror(64)
??
目录
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
四、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
?compareStates: function(a, b) {
????????????if (a.indented != b.indented || a.tokenize != b.tokenize) return false;
????????????for (var ca = a.context, cb = b.context; ; ca = ca.prev, cb = cb.prev) {
????????????????if (!ca || !cb) return ca == cb;
????????????????if (ca.tagName != cb.tagName) return false;
????????????}
????????},
????????electricChars: "/"
????};
});
CodeMirror.defineMIME("application/xml", "xml");
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
CodeMirror.defineMode("javascript", function(config, parserConfig) {
????var indentUnit = config.indentUnit;
????var jsonMode = parserConfig.json;
????// Tokenizer
????var keywords = function(){
????????function kw(type) {return {type: type, style: "keyword"};}
????????var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
????????var operator = kw("operator"), atom = {type: "atom", style: "atom"};
????????return {
????????????"if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
????????????"return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C,
????????????"var": kw("var"), "const": kw("var"), "let": kw("var"),
????????????"function": kw("function"), "catch": kw("catch"),
????????????"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
????????????"in": operator, "typeof": operator, "instanceof": operator,
????????????"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
????????};
????}();
????var isOperatorChar = /[+\-*&%=<>!?|]/;
????function chain(stream, state, f) {
????????state.tokenize = f;
????????return f(stream, state);
????}
????function nextUntilUnescaped(stream, end) {
????????var escaped = false, next;
????????while ((next = stream.next()) != null) {
????????????if (next == end && !escaped)
????????????????return false;
????????????escaped = !escaped && next == "\\";
????????}
????????return escaped;
????}
????// Used as scratch variables to communicate multiple values without
????// consing up tons of objects.
????var type, content;
????function ret(tp, style, cont) {
????????type = tp; content = cont;
????????return style;
????}
????function jsTokenBase(stream, state) {
????????var ch = stream.next();
????????if (ch == '"' || ch == "'")
????????????return chain(stream, state, jsTokenString(ch));
????????else if (/[\[\]{}\(\),;\:\.]/.test(ch))
????????????return ret(ch);
????????else if (ch == "0" && stream.eat(/x/i)) {
????????????stream.eatWhile(/[\da-f]/i);
????????????return ret("number", "number");
????????}
????????else if (/\d/.test(ch)) {
????????????stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
????????????return ret("number", "number");
????????}
????????else if (ch == "/") {
????????????if (stream.eat("*")) {
????????????????return chain(stream, state, jsTokenComment);
????????????}
????????????else if (stream.eat("/")) {
????????????????stream.skipToEnd();
????????????????return ret("comment", "comment");
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!