mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-15 11:30:52 +00:00
7254cda535
Updated to
6b88b939c2
Includes fixes for drag delay (bug 60432)
and chrome useragent detection: Github issue
https://github.com/ajaxorg/ace/issues/1950
Bug: T62432
Change-Id: I5ac67a812f09ac43e73475613afc9a3f1ddc9a75
108 lines
3.2 KiB
JavaScript
108 lines
3.2 KiB
JavaScript
define("ace/mode/scheme_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
|
|
"use strict";
|
|
|
|
var oop = require("../lib/oop");
|
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
|
|
|
var SchemeHighlightRules = function() {
|
|
var keywordControl = "case|do|let|loop|if|else|when";
|
|
var keywordOperator = "eq?|eqv?|equal?|and|or|not|null?";
|
|
var constantLanguage = "#t|#f";
|
|
var supportFunctions = "cons|car|cdr|cond|lambda|lambda*|syntax-rules|format|set!|quote|eval|append|list|list?|member?|load";
|
|
|
|
var keywordMapper = this.createKeywordMapper({
|
|
"keyword.control": keywordControl,
|
|
"keyword.operator": keywordOperator,
|
|
"constant.language": constantLanguage,
|
|
"support.function": supportFunctions
|
|
}, "identifier", true);
|
|
|
|
this.$rules =
|
|
{
|
|
"start": [
|
|
{
|
|
token : "comment",
|
|
regex : ";.*$"
|
|
},
|
|
{
|
|
"token": ["storage.type.function-type.scheme", "text", "entity.name.function.scheme"],
|
|
"regex": "(?:\\b(?:(define|define-syntax|define-macro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"
|
|
},
|
|
{
|
|
"token": "punctuation.definition.constant.character.scheme",
|
|
"regex": "#:\\S+"
|
|
},
|
|
{
|
|
"token": ["punctuation.definition.variable.scheme", "variable.other.global.scheme", "punctuation.definition.variable.scheme"],
|
|
"regex": "(\\*)(\\S*)(\\*)"
|
|
},
|
|
{
|
|
"token" : "constant.numeric", // hex
|
|
"regex" : "#[xXoObB][0-9a-fA-F]+"
|
|
},
|
|
{
|
|
"token" : "constant.numeric", // float
|
|
"regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?"
|
|
},
|
|
{
|
|
"token" : keywordMapper,
|
|
"regex" : "[a-zA-Z_#][a-zA-Z0-9_\\-\\?\\!\\*]*"
|
|
},
|
|
{
|
|
"token" : "string",
|
|
"regex" : '"(?=.)',
|
|
"next" : "qqstring"
|
|
}
|
|
],
|
|
"qqstring": [
|
|
{
|
|
"token": "constant.character.escape.scheme",
|
|
"regex": "\\\\."
|
|
},
|
|
{
|
|
"token" : "string",
|
|
"regex" : '[^"\\\\]+',
|
|
"merge" : true
|
|
}, {
|
|
"token" : "string",
|
|
"regex" : "\\\\$",
|
|
"next" : "qqstring",
|
|
"merge" : true
|
|
}, {
|
|
"token" : "string",
|
|
"regex" : '"|$',
|
|
"next" : "start",
|
|
"merge" : true
|
|
}
|
|
]
|
|
}
|
|
|
|
};
|
|
|
|
oop.inherits(SchemeHighlightRules, TextHighlightRules);
|
|
|
|
exports.SchemeHighlightRules = SchemeHighlightRules;
|
|
});
|
|
|
|
define("ace/mode/scheme",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scheme_highlight_rules"], function(require, exports, module) {
|
|
"use strict";
|
|
|
|
var oop = require("../lib/oop");
|
|
var TextMode = require("./text").Mode;
|
|
var SchemeHighlightRules = require("./scheme_highlight_rules").SchemeHighlightRules;
|
|
|
|
var Mode = function() {
|
|
this.HighlightRules = SchemeHighlightRules;
|
|
};
|
|
oop.inherits(Mode, TextMode);
|
|
|
|
(function() {
|
|
|
|
this.lineCommentStart = ";";
|
|
|
|
this.$id = "ace/mode/scheme";
|
|
}).call(Mode.prototype);
|
|
|
|
exports.Mode = Mode;
|
|
});
|