fix error in objectivec_highlight_rules when Array.prototype is modified
This commit is contained in:
parent
d2072604f3
commit
8f6f6c6e3d
1 changed files with 11 additions and 21 deletions
|
|
@ -17,12 +17,10 @@ var ObjectiveCHighlightRules = function() {
|
||||||
"222|" +
|
"222|" +
|
||||||
"x[a-zA-Z0-9]+)";
|
"x[a-zA-Z0-9]+)";
|
||||||
|
|
||||||
var specialVariables = [
|
var specialVariables = [{
|
||||||
{
|
|
||||||
"regex": "\\b_cmd\\b",
|
"regex": "\\b_cmd\\b",
|
||||||
"token": "variable.other.selector.objc"
|
"token": "variable.other.selector.objc"
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
"regex": "\\b(?:self|super)\\b",
|
"regex": "\\b(?:self|super)\\b",
|
||||||
"token": "variable.language.objc"
|
"token": "variable.language.objc"
|
||||||
}
|
}
|
||||||
|
|
@ -31,8 +29,7 @@ var ObjectiveCHighlightRules = function() {
|
||||||
var cObj = new CHighlightRules();
|
var cObj = new CHighlightRules();
|
||||||
var cRules = cObj.getRules();
|
var cRules = cObj.getRules();
|
||||||
|
|
||||||
this.$rules =
|
this.$rules = {
|
||||||
{
|
|
||||||
"start": [
|
"start": [
|
||||||
{
|
{
|
||||||
token : "comment",
|
token : "comment",
|
||||||
|
|
@ -312,24 +309,17 @@ var ObjectiveCHighlightRules = function() {
|
||||||
|
|
||||||
// copy in C-Rules directly
|
// copy in C-Rules directly
|
||||||
for (var r in cRules) {
|
for (var r in cRules) {
|
||||||
if (r == "start") {
|
if (this.$rules[r]) {
|
||||||
for (var key in cRules[r]) {
|
if (this.$rules[r].push)
|
||||||
this.$rules.start.push(cRules[r][key])
|
this.$rules[r].push.apply(this.$rules[r], cRules[r]);
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.$rules[r] = cRules[r];
|
this.$rules[r] = cRules[r];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var startRules = this.$rules.start;
|
this.$rules.bracketed_content = this.$rules.bracketed_content.concat(
|
||||||
for (var s in startRules) {
|
this.$rules.start, specialVariables
|
||||||
this.$rules.bracketed_content.push(startRules[s]);
|
);
|
||||||
}
|
|
||||||
for (var s in specialVariables) {
|
|
||||||
this.$rules.bracketed_content.push(specialVariables[s]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
this.embedRules(DocCommentHighlightRules, "doc-",
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
||||||
[ DocCommentHighlightRules.getEndRule("start") ]);
|
[ DocCommentHighlightRules.getEndRule("start") ]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue