2023-01-16 22:26:34 +00:00
|
|
|
ace.define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
|
2013-12-30 15:00:16 +00:00
|
|
|
var oop = require("../lib/oop");
|
|
|
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
2023-01-16 22:26:34 +00:00
|
|
|
var AdaHighlightRules = function () {
|
|
|
|
var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" +
|
|
|
|
"access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" +
|
|
|
|
"array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" +
|
|
|
|
"body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" +
|
|
|
|
"|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor";
|
|
|
|
var builtinConstants = ("true|false|null");
|
|
|
|
var builtinFunctions = ("count|min|max|avg|sum|rank|now|coalesce|main");
|
2013-12-30 15:00:16 +00:00
|
|
|
var keywordMapper = this.createKeywordMapper({
|
|
|
|
"support.function": builtinFunctions,
|
|
|
|
"keyword": keywords,
|
|
|
|
"constant.language": builtinConstants
|
|
|
|
}, "identifier", true);
|
|
|
|
this.$rules = {
|
2023-01-16 22:26:34 +00:00
|
|
|
"start": [{
|
|
|
|
token: "comment",
|
|
|
|
regex: "--.*$"
|
|
|
|
}, {
|
|
|
|
token: "string",
|
|
|
|
regex: '".*?"'
|
|
|
|
}, {
|
|
|
|
token: "string",
|
|
|
|
regex: "'.'"
|
|
|
|
}, {
|
|
|
|
token: "constant.numeric",
|
|
|
|
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
|
|
|
}, {
|
|
|
|
token: keywordMapper,
|
|
|
|
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
|
|
|
}, {
|
|
|
|
token: "keyword.operator",
|
|
|
|
regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
|
|
|
|
}, {
|
|
|
|
token: "paren.lparen",
|
|
|
|
regex: "[\\(]"
|
|
|
|
}, {
|
|
|
|
token: "paren.rparen",
|
|
|
|
regex: "[\\)]"
|
|
|
|
}, {
|
|
|
|
token: "text",
|
|
|
|
regex: "\\s+"
|
|
|
|
}]
|
2013-12-30 15:00:16 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
oop.inherits(AdaHighlightRules, TextHighlightRules);
|
|
|
|
exports.AdaHighlightRules = AdaHighlightRules;
|
2014-07-08 20:15:22 +00:00
|
|
|
|
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/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules","ace/range"], 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 AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules;
|
2020-04-14 12:14:48 +00:00
|
|
|
var Range = require("../range").Range;
|
2023-01-16 22:26:34 +00:00
|
|
|
var Mode = function () {
|
2014-07-08 20:15:22 +00:00
|
|
|
this.HighlightRules = AdaHighlightRules;
|
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 = "--";
|
2023-01-16 22:26:34 +00:00
|
|
|
this.getNextLineIndent = function (state, line, tab) {
|
2020-04-14 12:14:48 +00:00
|
|
|
var indent = this.$getIndent(line);
|
|
|
|
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
|
|
|
|
var tokens = tokenizedLine.tokens;
|
2023-01-16 22:26:34 +00:00
|
|
|
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
|
2020-04-14 12:14:48 +00:00
|
|
|
return indent;
|
|
|
|
}
|
|
|
|
if (state == "start") {
|
|
|
|
var match = line.match(/^.*(begin|loop|then|is|do)\s*$/);
|
|
|
|
if (match) {
|
|
|
|
indent += tab;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return indent;
|
|
|
|
};
|
2023-01-16 22:26:34 +00:00
|
|
|
this.checkOutdent = function (state, line, input) {
|
2020-04-14 12:14:48 +00:00
|
|
|
var complete_line = line + input;
|
|
|
|
if (complete_line.match(/^\s*(begin|end)$/)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
2023-01-16 22:26:34 +00:00
|
|
|
this.autoOutdent = function (state, session, row) {
|
2020-04-14 12:14:48 +00:00
|
|
|
var line = session.getLine(row);
|
|
|
|
var prevLine = session.getLine(row - 1);
|
|
|
|
var prevIndent = this.$getIndent(prevLine).length;
|
|
|
|
var indent = this.$getIndent(line).length;
|
|
|
|
if (indent <= prevIndent) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
session.outdentRows(new Range(row, 0, row + 2, 0));
|
|
|
|
};
|
2014-07-08 20:15:22 +00:00
|
|
|
this.$id = "ace/mode/ada";
|
|
|
|
}).call(Mode.prototype);
|
|
|
|
exports.Mode = Mode;
|
|
|
|
|
2020-04-14 12:14:48 +00:00
|
|
|
}); (function() {
|
|
|
|
ace.require(["ace/mode/ada"], function(m) {
|
|
|
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
|
|
module.exports = m;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|
|
|
|
|