2023-01-16 22:26:34 +00:00
|
|
|
ace.define("ace/mode/eiffel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
|
2014-07-08 20:15:22 +00:00
|
|
|
var oop = require("../lib/oop");
|
|
|
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
2023-01-16 22:26:34 +00:00
|
|
|
var EiffelHighlightRules = function () {
|
2014-07-08 20:15:22 +00:00
|
|
|
var keywords = "across|agent|alias|all|attached|as|assign|attribute|check|" +
|
|
|
|
"class|convert|create|debug|deferred|detachable|do|else|elseif|end|" +
|
|
|
|
"ensure|expanded|export|external|feature|from|frozen|if|inherit|" +
|
|
|
|
"inspect|invariant|like|local|loop|not|note|obsolete|old|once|" +
|
|
|
|
"Precursor|redefine|rename|require|rescue|retry|select|separate|" +
|
|
|
|
"some|then|undefine|until|variant|when";
|
|
|
|
var operatorKeywords = "and|implies|or|xor";
|
|
|
|
var languageConstants = "Void";
|
|
|
|
var booleanConstants = "True|False";
|
|
|
|
var languageVariables = "Current|Result";
|
|
|
|
var keywordMapper = this.createKeywordMapper({
|
|
|
|
"constant.language": languageConstants,
|
|
|
|
"constant.language.boolean": booleanConstants,
|
|
|
|
"variable.language": languageVariables,
|
|
|
|
"keyword.operator": operatorKeywords,
|
|
|
|
"keyword": keywords
|
|
|
|
}, "identifier", true);
|
|
|
|
var simpleString = /(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)+?/;
|
|
|
|
this.$rules = {
|
|
|
|
"start": [{
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "string.quoted.other",
|
|
|
|
regex: /"\[/,
|
2014-07-08 20:15:22 +00:00
|
|
|
next: "aligned_verbatim_string"
|
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "string.quoted.other",
|
|
|
|
regex: /"\{/,
|
2014-07-08 20:15:22 +00:00
|
|
|
next: "non-aligned_verbatim_string"
|
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "string.quoted.double",
|
|
|
|
regex: /"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)*?"/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "comment.line.double-dash",
|
|
|
|
regex: /--.*/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "constant.character",
|
|
|
|
regex: /'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)'/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "constant.numeric",
|
|
|
|
regex: /\b0(?:[xX][\da-fA-F](?:_*[\da-fA-F])*|[cC][0-7](?:_*[0-7])*|[bB][01](?:_*[01])*)\b/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "constant.numeric",
|
|
|
|
regex: /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "paren.lparen",
|
|
|
|
regex: /[\[({]|<<|\|\(/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "paren.rparen",
|
|
|
|
regex: /[\])}]|>>|\|\)/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "keyword.operator",
|
|
|
|
regex: /:=|->|\.(?=\w)|[;,:?]/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "keyword.operator",
|
|
|
|
regex: /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: function (v) {
|
2016-03-13 23:26:27 +00:00
|
|
|
var result = keywordMapper(v);
|
|
|
|
if (result === "identifier" && v === v.toUpperCase()) {
|
2023-01-16 22:26:34 +00:00
|
|
|
result = "entity.name.type";
|
2014-07-08 20:15:22 +00:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
},
|
2023-01-16 22:26:34 +00:00
|
|
|
regex: /[a-zA-Z][a-zA-Z\d_]*\b/
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "text",
|
|
|
|
regex: /\s+/
|
2014-07-08 20:15:22 +00:00
|
|
|
}
|
|
|
|
],
|
2023-01-16 22:26:34 +00:00
|
|
|
"aligned_verbatim_string": [{
|
|
|
|
token: "string",
|
|
|
|
regex: /]"/,
|
|
|
|
next: "start"
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "string",
|
|
|
|
regex: simpleString
|
2014-07-08 20:15:22 +00:00
|
|
|
}
|
|
|
|
],
|
2023-01-16 22:26:34 +00:00
|
|
|
"non-aligned_verbatim_string": [{
|
|
|
|
token: "string.quoted.other",
|
|
|
|
regex: /}"/,
|
|
|
|
next: "start"
|
2014-07-08 20:15:22 +00:00
|
|
|
}, {
|
2023-01-16 22:26:34 +00:00
|
|
|
token: "string.quoted.other",
|
|
|
|
regex: simpleString
|
2014-07-08 20:15:22 +00:00
|
|
|
}
|
2023-01-16 22:26:34 +00:00
|
|
|
]
|
|
|
|
};
|
2014-07-08 20:15:22 +00:00
|
|
|
};
|
|
|
|
oop.inherits(EiffelHighlightRules, TextHighlightRules);
|
|
|
|
exports.EiffelHighlightRules = EiffelHighlightRules;
|
|
|
|
|
2023-01-16 22:26:34 +00:00
|
|
|
});
|
2014-07-08 20:15:22 +00:00
|
|
|
|
2023-01-16 22:26:34 +00:00
|
|
|
ace.define("ace/mode/eiffel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eiffel_highlight_rules"], function(require, exports, module){"use strict";
|
2014-07-08 20:15:22 +00:00
|
|
|
var oop = require("../lib/oop");
|
|
|
|
var TextMode = require("./text").Mode;
|
|
|
|
var EiffelHighlightRules = require("./eiffel_highlight_rules").EiffelHighlightRules;
|
2023-01-16 22:26:34 +00:00
|
|
|
var Mode = function () {
|
2014-07-08 20:15:22 +00:00
|
|
|
this.HighlightRules = EiffelHighlightRules;
|
2017-02-05 20:05:00 +00:00
|
|
|
this.$behaviour = this.$defaultBehaviour;
|
2014-07-08 20:15:22 +00:00
|
|
|
};
|
|
|
|
oop.inherits(Mode, TextMode);
|
2023-01-16 22:26:34 +00:00
|
|
|
(function () {
|
2014-07-08 20:15:22 +00:00
|
|
|
this.lineCommentStart = "--";
|
|
|
|
this.$id = "ace/mode/eiffel";
|
|
|
|
}).call(Mode.prototype);
|
|
|
|
exports.Mode = Mode;
|
|
|
|
|
2020-04-14 12:14:48 +00:00
|
|
|
}); (function() {
|
|
|
|
ace.require(["ace/mode/eiffel"], function(m) {
|
|
|
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
|
|
module.exports = m;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
|