This commit is contained in:
Fabian Jakobs 2011-12-05 16:02:58 +01:00
commit 494a21d9e2
43 changed files with 206 additions and 205 deletions

View file

@ -6166,6 +6166,7 @@ var Tokenizer = function(rules) {
this.regExps = {}; this.regExps = {};
this.matchMappings = {}; this.matchMappings = {};
var flag = flag ? "g" + flag : "g";
for ( var key in this.rules) { for ( var key in this.rules) {
var rule = this.rules[key]; var rule = this.rules[key];
var state = rule; var state = rule;
@ -6192,7 +6193,7 @@ var Tokenizer = function(rules) {
ruleRegExps.push(adjustedregex); ruleRegExps.push(adjustedregex);
} }
this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g"); this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag);
} }
}; };
@ -10298,20 +10299,23 @@ oop.inherits(FoldMode, BaseFoldMode);
var start = {row: row, column: i+1}; var start = {row: row, column: i+1};
var end = session.$findClosingBracket(match[1], start); var end = session.$findClosingBracket(match[1], start);
if (end) { if (!end)
var fw = session.foldWidgets[end.row]; return;
if (fw == null)
fw = this.getFoldWidget(session, end.row);
if (fw == "start"){ var fw = session.foldWidgets[end.row];
end.row--; if (fw == null)
end.column = session.getLine(end.row).length; fw = this.getFoldWidget(session, end.row);
}
if (fw == "start") {
end.row --;
end.column = session.getLine(end.row).length;
} }
return Range.fromPoints(start, end); return Range.fromPoints(start, end);
} }
if (foldStyle !== "markbeginend")
return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
@ -10322,10 +10326,11 @@ oop.inherits(FoldMode, BaseFoldMode);
var end = {row: row, column: i}; var end = {row: row, column: i};
var start = session.$findOpeningBracket(match[1], end); var start = session.$findOpeningBracket(match[1], end);
if (start) { if (!start)
start.column++; return;
end.column--;
} start.column++;
end.column--;
return Range.fromPoints(start, end); return Range.fromPoints(start, end);
} }
@ -12378,10 +12383,9 @@ var JavaScriptHighlightRules = function() {
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "\\/(?:(?:\\[(?:\\\\]|[^\\]])+\\])" regex: "\\/",
+ "|(?:\\\\/|[^\\]/]))*" next: "regex",
+ "[/]\\w*", merge: true
next: "start"
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
@ -12393,6 +12397,54 @@ var JavaScriptHighlightRules = function() {
next: "start" next: "start"
} }
], ],
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, {
// flag
token: "string.regexp",
regex: "/\\w*",
next: "start",
merge: true
}, {
token: "string.regexp",
regex: "[^\\\\/\\[]+",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
regex: "\\[",
next: "regex_character_class",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"regex_character_class": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, {
token: "string.regexp.charachterclass",
regex: "]",
next: "regex",
merge: true
}, {
token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+",
next: "regex_character_class",
merge: true
}, {
token: "empty",
regex: "",
next: "start"
}
],
"comment_regex_allowed" : [ "comment_regex_allowed" : [
{ {
token : "comment", // closing comment token : "comment", // closing comment
@ -12497,7 +12549,7 @@ var WorkerClient = require("../worker/worker_client").WorkerClient;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() { var Mode = function() {
this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules()); this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
@ -12668,20 +12720,6 @@ var CssHighlightRules = function() {
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
function ic(str) {
var re = [];
var chars = str.split("");
for (var i=0; i<chars.length; i++) {
re.push(
"[",
chars[i].toLowerCase(),
chars[i].toUpperCase(),
"]"
);
}
return re.join("");
}
var base_ruleset = [ var base_ruleset = [
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
@ -12696,61 +12734,13 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : "constant.numeric", token : "constant.numeric",
regex : numRe + ic("em") regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
}, {
token : "constant.numeric",
regex : numRe + ic("ex")
}, {
token : "constant.numeric",
regex : numRe + ic("px")
}, {
token : "constant.numeric",
regex : numRe + ic("cm")
}, {
token : "constant.numeric",
regex : numRe + ic("mm")
}, {
token : "constant.numeric",
regex : numRe + ic("in")
}, {
token : "constant.numeric",
regex : numRe + ic("pt")
}, {
token : "constant.numeric",
regex : numRe + ic("pc")
}, {
token : "constant.numeric",
regex : numRe + ic("deg")
}, {
token : "constant.numeric",
regex : numRe + ic("rad")
}, {
token : "constant.numeric",
regex : numRe + ic("grad")
}, {
token : "constant.numeric",
regex : numRe + ic("ms")
}, {
token : "constant.numeric",
regex : numRe + ic("s")
}, {
token : "constant.numeric",
regex : numRe + ic("hz")
}, {
token : "constant.numeric",
regex : numRe + ic("khz")
}, {
token : "constant.numeric",
regex : numRe + "%"
}, {
token : "constant.numeric",
regex : numRe
}, { }, {
token : "constant.numeric", // hex6 color token : "constant.numeric", // hex6 color
regex : "#[a-fA-F0-9]{6}" regex : "#[a-f0-9]{6}"
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-fA-F0-9]{3}" regex : "#[a-f0-9]{3}"
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -12826,20 +12816,20 @@ var CssHighlightRules = function() {
next: "ruleset" next: "ruleset"
}, { }, {
token: "string", token: "string",
regex: "@media.*?{", regex: "@.*?{",
next: "media" next: "media"
},{ },{
token: "keyword", token: "keyword",
regex: "#[a-zA-Z0-9-_]+" regex: "#[a-z0-9-_]+"
},{ },{
token: "variable", token: "variable",
regex: "\\.[a-zA-Z0-9-_]+" regex: "\\.[a-z0-9-_]+"
},{ },{
token: "string", token: "string",
regex: ":[a-zA-Z0-9-_]+" regex: ":[a-z0-9-_]+"
},{ },{
token: "constant", token: "constant",
regex: "[a-zA-Z0-9-_]+" regex: "[a-z0-9-_]+"
}], }],
"media" : [ { "media" : [ {
@ -12857,16 +12847,16 @@ var CssHighlightRules = function() {
next: "start" next: "start"
},{ },{
token: "keyword", token: "keyword",
regex: "#[a-zA-Z0-9-_]+" regex: "#[a-z0-9-_]+"
},{ },{
token: "variable", token: "variable",
regex: "\\.[a-zA-Z0-9-_]+" regex: "\\.[a-z0-9-_]+"
},{ },{
token: "string", token: "string",
regex: ":[a-zA-Z0-9-_]+" regex: ":[a-z0-9-_]+"
},{ },{
token: "constant", token: "constant",
regex: "[a-zA-Z0-9-_]+" regex: "[a-z0-9-_]+"
}], }],
"comment" : comment, "comment" : comment,
@ -17851,7 +17841,7 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() { var Mode = function() {
this.$tokenizer = new Tokenizer(new ScssHighlightRules().getRules()); this.$tokenizer = new Tokenizer(new ScssHighlightRules().getRules(), "i");
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
@ -18062,21 +18052,6 @@ var ScssHighlightRules = function() {
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
function ic(str) {
var re = [];
var chars = str.split("");
for (var i=0; i<chars.length; i++) {
re.push(
"[",
chars[i].toLowerCase(),
chars[i].toUpperCase(),
"]"
);
}
return re.join("");
}
// regexp must not have capturing parentheses. Use (?:) instead. // regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
@ -18109,58 +18084,13 @@ var ScssHighlightRules = function() {
next : "qstring" next : "qstring"
}, { }, {
token : "constant.numeric", token : "constant.numeric",
regex : numRe + ic("em") regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
}, {
token : "constant.numeric",
regex : numRe + ic("ex")
}, {
token : "constant.numeric",
regex : numRe + ic("px")
}, {
token : "constant.numeric",
regex : numRe + ic("cm")
}, {
token : "constant.numeric",
regex : numRe + ic("mm")
}, {
token : "constant.numeric",
regex : numRe + ic("in")
}, {
token : "constant.numeric",
regex : numRe + ic("pt")
}, {
token : "constant.numeric",
regex : numRe + ic("pc")
}, {
token : "constant.numeric",
regex : numRe + ic("deg")
}, {
token : "constant.numeric",
regex : numRe + ic("rad")
}, {
token : "constant.numeric",
regex : numRe + ic("grad")
}, {
token : "constant.numeric",
regex : numRe + ic("ms")
}, {
token : "constant.numeric",
regex : numRe + ic("s")
}, {
token : "constant.numeric",
regex : numRe + ic("hz")
}, {
token : "constant.numeric",
regex : numRe + ic("khz")
}, {
token : "constant.numeric",
regex : numRe + "%"
}, { }, {
token : "constant.numeric", // hex6 color token : "constant.numeric", // hex6 color
regex : "#[a-fA-F0-9]{6}" regex : "#[a-f0-9]{6}"
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-fA-F0-9]{3}" regex : "#[a-f0-9]{3}"
}, { }, {
token : "constant.numeric", token : "constant.numeric",
regex : numRe regex : numRe
@ -18181,22 +18111,22 @@ var ScssHighlightRules = function() {
else else
return "text"; return "text";
}, },
regex : "\\-?[@a-zA-Z_][@a-zA-Z0-9_\\-]*" regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
}, { }, {
token : "variable", token : "variable",
regex : "[a-zA-Z_\\-$][a-zA-Z0-9_\\-$]*\\b" regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b"
}, { }, {
token: "variable.language", token: "variable.language",
regex: "#[a-zA-Z0-9-_]+" regex: "#[a-z0-9-_]+"
}, { }, {
token: "variable.language", token: "variable.language",
regex: "\\.[a-zA-Z0-9-_]+" regex: "\\.[a-z0-9-_]+"
}, { }, {
token: "variable.language", token: "variable.language",
regex: ":[a-zA-Z0-9-_]+" regex: ":[a-z0-9-_]+"
}, { }, {
token: "constant", token: "constant",
regex: "[a-zA-Z0-9-_]+" regex: "[a-z0-9-_]+"
}, { }, {
token : "keyword.operator", token : "keyword.operator",
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
@ -19156,6 +19086,29 @@ define("text!kitchen-sink/docs/css.css", [], ".text-layer {\n" +
" font-family: Monaco, \"Courier New\", monospace;\n" + " font-family: Monaco, \"Courier New\", monospace;\n" +
" font-size: 12px;\n" + " font-size: 12px;\n" +
" cursor: text;\n" + " cursor: text;\n" +
"}\n" +
"\n" +
".blinker {\n" +
" animation-duration: 1s;\n" +
" animation-name: blink;\n" +
" animation-iteration-count: infinite;\n" +
" animation-direction: alternate;\n" +
" animation-timing-function: linear;\n" +
"}\n" +
"\n" +
"@keyframes blink {\n" +
" 0% {\n" +
" opacity: 0;\n" +
" }\n" +
" 40% {\n" +
" opacity: 0;\n" +
" }\n" +
" 40.5% {\n" +
" opacity: 1\n" +
" }\n" +
" 100% {\n" +
" opacity: 1\n" +
" }\n" +
"}"); "}");
define("text!kitchen-sink/docs/scss.scss", [], "/* style.scss */\n" + define("text!kitchen-sink/docs/scss.scss", [], "/* style.scss */\n" +

File diff suppressed because one or more lines are too long

View file

@ -11,7 +11,7 @@
Ace Ace
version 0.2.0 version 0.2.0
commit 9fee4b7d96a32dd6896ee2addc379f95e18313c5 commit 4ff215fb728b42fca00e81bc18cda31a3ff2dcb4
--> -->

View file

@ -8071,6 +8071,7 @@ var Tokenizer = function(rules) {
this.regExps = {}; this.regExps = {};
this.matchMappings = {}; this.matchMappings = {};
var flag = flag ? "g" + flag : "g";
for ( var key in this.rules) { for ( var key in this.rules) {
var rule = this.rules[key]; var rule = this.rules[key];
var state = rule; var state = rule;
@ -8097,7 +8098,7 @@ var Tokenizer = function(rules) {
ruleRegExps.push(adjustedregex); ruleRegExps.push(adjustedregex);
} }
this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g"); this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag);
} }
}; };
@ -14138,6 +14139,29 @@ define("text!kitchen-sink/docs/css.css", [], ".text-layer {\n" +
" font-family: Monaco, \"Courier New\", monospace;\n" + " font-family: Monaco, \"Courier New\", monospace;\n" +
" font-size: 12px;\n" + " font-size: 12px;\n" +
" cursor: text;\n" + " cursor: text;\n" +
"}\n" +
"\n" +
".blinker {\n" +
" animation-duration: 1s;\n" +
" animation-name: blink;\n" +
" animation-iteration-count: infinite;\n" +
" animation-direction: alternate;\n" +
" animation-timing-function: linear;\n" +
"}\n" +
"\n" +
"@keyframes blink {\n" +
" 0% {\n" +
" opacity: 0;\n" +
" }\n" +
" 40% {\n" +
" opacity: 0;\n" +
" }\n" +
" 40.5% {\n" +
" opacity: 1\n" +
" }\n" +
" 100% {\n" +
" opacity: 1\n" +
" }\n" +
"}"); "}");
define("text!kitchen-sink/styles.css", [], "html {\n" + define("text!kitchen-sink/styles.css", [], "html {\n" +

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -8025,6 +8025,7 @@ var Tokenizer = function(rules) {
this.regExps = {}; this.regExps = {};
this.matchMappings = {}; this.matchMappings = {};
var flag = flag ? "g" + flag : "g";
for ( var key in this.rules) { for ( var key in this.rules) {
var rule = this.rules[key]; var rule = this.rules[key];
var state = rule; var state = rule;
@ -8051,7 +8052,7 @@ var Tokenizer = function(rules) {
ruleRegExps.push(adjustedregex); ruleRegExps.push(adjustedregex);
} }
this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g"); this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag);
} }
}; };
@ -14092,6 +14093,29 @@ __ace_shadowed__.define("text!kitchen-sink/docs/css.css", [], ".text-layer {\n"
" font-family: Monaco, \"Courier New\", monospace;\n" + " font-family: Monaco, \"Courier New\", monospace;\n" +
" font-size: 12px;\n" + " font-size: 12px;\n" +
" cursor: text;\n" + " cursor: text;\n" +
"}\n" +
"\n" +
".blinker {\n" +
" animation-duration: 1s;\n" +
" animation-name: blink;\n" +
" animation-iteration-count: infinite;\n" +
" animation-direction: alternate;\n" +
" animation-timing-function: linear;\n" +
"}\n" +
"\n" +
"@keyframes blink {\n" +
" 0% {\n" +
" opacity: 0;\n" +
" }\n" +
" 40% {\n" +
" opacity: 0;\n" +
" }\n" +
" 40.5% {\n" +
" opacity: 1\n" +
" }\n" +
" 100% {\n" +
" opacity: 1\n" +
" }\n" +
"}"); "}");
__ace_shadowed__.define("text!kitchen-sink/styles.css", [], "html {\n" + __ace_shadowed__.define("text!kitchen-sink/styles.css", [], "html {\n" +

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long