mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 17:04:16 +00:00
feature(ace) 1.1.3
This commit is contained in:
parent
cf4b3c3e37
commit
eada8693cf
229 changed files with 110049 additions and 35797 deletions
|
|
@ -63,7 +63,7 @@ oop.inherits(Mode, TextMode);
|
|||
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[]\s*$/);
|
||||
var startingClassOrMethod = line.match(/^\s*(class|def)\s.*$/);
|
||||
var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
|
||||
var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
|
||||
var startingConditional = line.match(/^\s*(if|else)\s*/)
|
||||
if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
|
||||
|
|
@ -85,6 +85,7 @@ oop.inherits(Mode, TextMode);
|
|||
doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
|
||||
};
|
||||
|
||||
this.$id = "ace/mode/ruby";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
|
|
@ -243,11 +244,13 @@ var RubyHighlightRules = function() {
|
|||
rules: {
|
||||
heredoc: [{
|
||||
onMatch: function(value, currentState, stack) {
|
||||
if (value == stack[1]) {
|
||||
if (value === stack[1]) {
|
||||
stack.shift();
|
||||
stack.shift();
|
||||
this.next = stack[0] || "start";
|
||||
return "support.class";
|
||||
}
|
||||
this.next = "";
|
||||
return "string";
|
||||
},
|
||||
regex: ".*$",
|
||||
|
|
@ -258,17 +261,27 @@ var RubyHighlightRules = function() {
|
|||
regex: "^ +"
|
||||
}, {
|
||||
onMatch: function(value, currentState, stack) {
|
||||
if (value == stack[1]) {
|
||||
if (value === stack[1]) {
|
||||
stack.shift();
|
||||
stack.shift();
|
||||
this.next = stack[0] || "start";
|
||||
return "support.class";
|
||||
}
|
||||
this.next = "";
|
||||
return "string";
|
||||
},
|
||||
regex: ".*$",
|
||||
next: "start"
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
regex : "$",
|
||||
token : "empty",
|
||||
next : function(currentState, stack) {
|
||||
if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
|
||||
return stack[0];
|
||||
return currentState;
|
||||
}
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue