| 1 |
ace.define("ace/mode/eiffel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict"; |
| 2 |
var oop = require("../lib/oop"); |
| 3 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
| 4 |
var EiffelHighlightRules = function () { |
| 5 |
var keywords = "across|agent|alias|all|attached|as|assign|attribute|check|" + |
| 6 |
"class|convert|create|debug|deferred|detachable|do|else|elseif|end|" + |
| 7 |
"ensure|expanded|export|external|feature|from|frozen|if|inherit|" + |
| 8 |
"inspect|invariant|like|local|loop|not|note|obsolete|old|once|" + |
| 9 |
"Precursor|redefine|rename|require|rescue|retry|select|separate|" + |
| 10 |
"some|then|undefine|until|variant|when"; |
| 11 |
var operatorKeywords = "and|implies|or|xor"; |
| 12 |
var languageConstants = "Void"; |
| 13 |
var booleanConstants = "True|False"; |
| 14 |
var languageVariables = "Current|Result"; |
| 15 |
var keywordMapper = this.createKeywordMapper({ |
| 16 |
"constant.language": languageConstants, |
| 17 |
"constant.language.boolean": booleanConstants, |
| 18 |
"variable.language": languageVariables, |
| 19 |
"keyword.operator": operatorKeywords, |
| 20 |
"keyword": keywords |
| 21 |
}, "identifier", true); |
| 22 |
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)*)\/)+?/; |
| 23 |
this.$rules = { |
| 24 |
"start": [{ |
| 25 |
token: "string.quoted.other", |
| 26 |
regex: /"\[/, |
| 27 |
next: "aligned_verbatim_string" |
| 28 |
}, { |
| 29 |
token: "string.quoted.other", |
| 30 |
regex: /"\{/, |
| 31 |
next: "non-aligned_verbatim_string" |
| 32 |
}, { |
| 33 |
token: "string.quoted.double", |
| 34 |
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)*)\/)*?"/ |
| 35 |
}, { |
| 36 |
token: "comment.line.double-dash", |
| 37 |
regex: /--.*/ |
| 38 |
}, { |
| 39 |
token: "constant.character", |
| 40 |
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)*)\/)'/ |
| 41 |
}, { |
| 42 |
token: "constant.numeric", |
| 43 |
regex: /\b0(?:[xX][\da-fA-F](?:_*[\da-fA-F])*|[cC][0-7](?:_*[0-7])*|[bB][01](?:_*[01])*)\b/ |
| 44 |
}, { |
| 45 |
token: "constant.numeric", |
| 46 |
regex: /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/ |
| 47 |
}, { |
| 48 |
token: "paren.lparen", |
| 49 |
regex: /[\[({]|<<|\|\(/ |
| 50 |
}, { |
| 51 |
token: "paren.rparen", |
| 52 |
regex: /[\])}]|>>|\|\)/ |
| 53 |
}, { |
| 54 |
token: "keyword.operator", |
| 55 |
regex: /:=|->|\.(?=\w)|[;,:?]/ |
| 56 |
}, { |
| 57 |
token: "keyword.operator", |
| 58 |
regex: /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/ |
| 59 |
}, { |
| 60 |
token: function (v) { |
| 61 |
var result = keywordMapper(v); |
| 62 |
if (result === "identifier" && v === v.toUpperCase()) { |
| 63 |
result = "entity.name.type"; |
| 64 |
} |
| 65 |
return result; |
| 66 |
}, |
| 67 |
regex: /[a-zA-Z][a-zA-Z\d_]*\b/ |
| 68 |
}, { |
| 69 |
token: "text", |
| 70 |
regex: /\s+/ |
| 71 |
} |
| 72 |
], |
| 73 |
"aligned_verbatim_string": [{ |
| 74 |
token: "string", |
| 75 |
regex: /]"/, |
| 76 |
next: "start" |
| 77 |
}, { |
| 78 |
token: "string", |
| 79 |
regex: simpleString |
| 80 |
} |
| 81 |
], |
| 82 |
"non-aligned_verbatim_string": [{ |
| 83 |
token: "string.quoted.other", |
| 84 |
regex: /}"/, |
| 85 |
next: "start" |
| 86 |
}, { |
| 87 |
token: "string.quoted.other", |
| 88 |
regex: simpleString |
| 89 |
} |
| 90 |
] |
| 91 |
}; |
| 92 |
}; |
| 93 |
oop.inherits(EiffelHighlightRules, TextHighlightRules); |
| 94 |
exports.EiffelHighlightRules = EiffelHighlightRules; |
| 95 |
|
| 96 |
}); |
| 97 |
|
| 98 |
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"; |
| 99 |
var oop = require("../lib/oop"); |
| 100 |
var TextMode = require("./text").Mode; |
| 101 |
var EiffelHighlightRules = require("./eiffel_highlight_rules").EiffelHighlightRules; |
| 102 |
var Mode = function () { |
| 103 |
this.HighlightRules = EiffelHighlightRules; |
| 104 |
this.$behaviour = this.$defaultBehaviour; |
| 105 |
}; |
| 106 |
oop.inherits(Mode, TextMode); |
| 107 |
(function () { |
| 108 |
this.lineCommentStart = "--"; |
| 109 |
this.$id = "ace/mode/eiffel"; |
| 110 |
}).call(Mode.prototype); |
| 111 |
exports.Mode = Mode; |
| 112 |
|
| 113 |
}); (function() { |
| 114 |
ace.require(["ace/mode/eiffel"], function(m) { |
| 115 |
if (typeof module == "object" && typeof exports == "object" && module) { |
| 116 |
module.exports = m; |
| 117 |
} |
| 118 |
}); |
| 119 |
})(); |
| 120 |
|