diff --git a/lib/ace/mode/_test/test_highlight_rules.js b/lib/ace/mode/_test/test_highlight_rules.js index 3286c125..9ba7ba34 100644 --- a/lib/ace/mode/_test/test_highlight_rules.js +++ b/lib/ace/mode/_test/test_highlight_rules.js @@ -21,6 +21,8 @@ function generateTestData() { docs.forEach(function(docName) { var p = docName.toLowerCase().split("."); + if (!p[1]) + return; var modeName; if (modes.indexOf(p[0]) != -1) modeName = p[0]; @@ -35,7 +37,12 @@ function generateTestData() { } var text = fs.readFileSync(cwd + filePath, "utf8"); - var Mode = require("../" + modeName).Mode; + try { + var Mode = require("../" + modeName).Mode; + } catch(e) { + console.warn("Can't load mode :" + modeName, e); + return; + } var tokenizer = new Mode().getTokenizer(); var state = "start"; diff --git a/lib/ace/mode/_test/text_javascript.txt b/lib/ace/mode/_test/text_javascript.txt index 1e8d3676..0b284556 100644 --- a/lib/ace/mode/_test/text_javascript.txt +++ b/lib/ace/mode/_test/text_javascript.txt @@ -3,6 +3,9 @@ function foo(items, nada) { alert(items[i] + "juhu\n"); } // Real Tab. } + +r = /d{1,2}?f{e}++r*?\d+?[]r[^r-o\f\f[\f]?r{7}+r\{7}+rr--rr$^(?:d|s)(?=a|)(?!y)[]|$?|^*/ o +a=/a/ jk = / / / / / /************************************/ /** total mess, tricky to highlight**/ diff --git a/lib/ace/mode/_test/tokens_javascript.json b/lib/ace/mode/_test/tokens_javascript.json index fc012829..cb175a09 100644 --- a/lib/ace/mode/_test/tokens_javascript.json +++ b/lib/ace/mode/_test/tokens_javascript.json @@ -140,6 +140,151 @@ "paren.rparen" ] }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "r", + " ", + "=", + " ", + "/d", + "{1,2}", + "?", + "f{e}", + "++", + "r", + "*?", + "\\d", + "+?[]", + "r", + "[^", + "r", + "-", + "o", + "\\f", + "\\f", + "[", + "\\f", + "]", + "?", + "r", + "{7}+", + "r", + "\\{", + "7}", + "+", + "rr--rr", + "$", + "^", + "(?:", + "d|s", + ")", + "(?=", + "a|", + ")", + "(?!", + "y", + ")[]", + "|", + "$", + "?", + "|", + "^*", + "/", + " ", + "o" + ], + "types": [ + "identifier", + "text", + "keyword.operator", + "text", + "string.regexp", + "constant.language.escape", + "constant.language.escape", + "string.regexp", + "invalid", + "string.regexp", + "constant.language.escape", + "regexp.keyword.operator", + "constant.language.escape", + "string.regexp", + "constant.language.escape", + "string.regexp.charachterclass", + "constant.language.escape", + "string.regexp.charachterclass", + "regexp.keyword.operator", + "regexp.keyword.operator", + "string.regexp.charachterclass", + "regexp.keyword.operator", + "constant.language.escape", + "constant.language.escape", + "string.regexp", + "invalid", + "string.regexp", + "regexp.keyword.operator", + "string.regexp", + "constant.language.escape", + "string.regexp", + "constant.language.escape", + "constant.language.escape", + "constant.language.escape", + "string.regexp", + "constant.language.escape", + "constant.language.escape", + "string.regexp", + "constant.language.escape", + "constant.language.escape", + "string.regexp", + "constant.language.escape", + "constant.language.escape", + "constant.language.escape", + "constant.language.escape", + "constant.language.escape", + "invalid", + "string.regexp", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "a", + "=", + "/a/", + " ", + "jk", + " ", + "=", + " ", + "/ /", + " ", + "/", + " ", + "/ /" + ], + "types": [ + "identifier", + "keyword.operator", + "string.regexp", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "string.regexp", + "text", + "keyword.operator", + "text", + "string.regexp" + ] + }, { "state": "start", "values": [ @@ -223,7 +368,8 @@ " ", "/u", "\\t", - "*/" + "*", + "/" ], "types": [ "text", @@ -233,6 +379,7 @@ "text", "string.regexp", "regexp.keyword.operator", + "constant.language.escape", "string.regexp" ] }, diff --git a/lib/ace/mode/_test/tokens_markdown.json b/lib/ace/mode/_test/tokens_markdown.json index 4c306d12..c1dc0e2e 100644 --- a/lib/ace/mode/_test/tokens_markdown.json +++ b/lib/ace/mode/_test/tokens_markdown.json @@ -59,7 +59,7 @@ "--------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -215,7 +215,7 @@ "--------------------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -290,7 +290,7 @@ "-------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -327,7 +327,7 @@ "----------------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -338,7 +338,7 @@ { "state": "start", "values": [ - "Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the Mozilla tri-license (MPL/GPL/LGPL), the same license used by Firefox. This license is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!" + "Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!" ], "types": [ "text" @@ -414,7 +414,7 @@ "-------------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -1166,7 +1166,7 @@ "-------------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -1255,7 +1255,7 @@ "-----------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -1384,7 +1384,7 @@ "-----------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -1559,7 +1559,7 @@ "----------------------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, { @@ -1716,7 +1716,7 @@ "------------" ], "types": [ - "markup.heading.1" + "markup.heading.2" ] }, {