diff --git a/lib/ace/mode/clojure_highlight_rules.js b/lib/ace/mode/clojure_highlight_rules.js index 91a744f9..d5e8ed88 100644 --- a/lib/ace/mode/clojure_highlight_rules.js +++ b/lib/ace/mode/clojure_highlight_rules.js @@ -138,9 +138,9 @@ var ClojureHighlightRules = function() { token : "comment", regex : ";.*$" }, { - token : "comment", // multi line comment - regex : "^\=begin$", - next : "comment" + token : "comment", // multi line comment + regex : "^=begin$", + next : "comment" }, { token : "keyword", //parens regex : "[\\(|\\)]" @@ -193,17 +193,17 @@ var ClojureHighlightRules = function() { regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' }, { token : "string", // symbol - regex : "[:](?:[a-zA-Z]|\d)+" + regex : "[:](?:[a-zA-Z]|\\d)+" }, { - token : "string.regexp", //Regular Expressions - regex : '/#"(?:\.|(\\\")|[^\""\n])*"/g' + token : "string.regexp", //Regular Expressions + regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g' } - + ], "comment" : [ { token : "comment", // closing comment - regex : "^\=end$", + regex : "^=end$", next : "start" }, { token : "comment", // comment spanning whole line diff --git a/lib/ace/mode/markdown_highlight_rules.js b/lib/ace/mode/markdown_highlight_rules.js index 319284fc..554d464e 100644 --- a/lib/ace/mode/markdown_highlight_rules.js +++ b/lib/ace/mode/markdown_highlight_rules.js @@ -64,7 +64,7 @@ var MarkdownHighlightRules = function() { token : "empty_line", regex : '^$' }, { // code span ` - token : "support.function", + token : ["support.function", "support.function", "support.function"], regex : "(`+)([^\\r]*?[^`])(\\1)" }, { // code block token : "support.function", @@ -94,7 +94,7 @@ var MarkdownHighlightRules = function() { next : "blockquote" }, { // reference token : ["text", "constant", "text", "url", "string", "text"], - regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?\\s*)$" + regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" }, { // link by reference token : ["text", "string", "text", "constant", "text"], regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])" @@ -120,10 +120,10 @@ var MarkdownHighlightRules = function() { regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", next : "listblock" }, { // strong ** __ - token : "string", + token : ["string", "string", "string"], regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)" }, { // emphasis * _ - token : "string", + token : ["string", "string", "string"], regex : "([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)" }, { // token : ["text", "url", "text"], diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index a471aa76..afd50b76 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -62,7 +62,7 @@ var Tokenizer = function(rules, flag) { }); if (matchcount > 1 && state[i].token.length !== matchcount-1) - throw new Error("Matching groups and length of the token array don't match"); + throw new Error("Matching groups and length of the token array don't match in rule #" + i + " of state " + key); mapping[matchTotal] = { rule: i,