some mode fixes

This commit is contained in:
Fabian Jakobs 2012-04-06 13:01:39 +02:00
commit 5f9af07e9b
3 changed files with 13 additions and 13 deletions

View file

@ -138,9 +138,9 @@ var ClojureHighlightRules = function() {
token : "comment", token : "comment",
regex : ";.*$" regex : ";.*$"
}, { }, {
token : "comment", // multi line comment token : "comment", // multi line comment
regex : "^\=begin$", regex : "^=begin$",
next : "comment" next : "comment"
}, { }, {
token : "keyword", //parens token : "keyword", //parens
regex : "[\\(|\\)]" regex : "[\\(|\\)]"
@ -193,17 +193,17 @@ var ClojureHighlightRules = function() {
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // symbol token : "string", // symbol
regex : "[:](?:[a-zA-Z]|\d)+" regex : "[:](?:[a-zA-Z]|\\d)+"
}, { }, {
token : "string.regexp", //Regular Expressions token : "string.regexp", //Regular Expressions
regex : '/#"(?:\.|(\\\")|[^\""\n])*"/g' regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g'
} }
], ],
"comment" : [ "comment" : [
{ {
token : "comment", // closing comment token : "comment", // closing comment
regex : "^\=end$", regex : "^=end$",
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line

View file

@ -64,7 +64,7 @@ var MarkdownHighlightRules = function() {
token : "empty_line", token : "empty_line",
regex : '^$' regex : '^$'
}, { // code span ` }, { // code span `
token : "support.function", token : ["support.function", "support.function", "support.function"],
regex : "(`+)([^\\r]*?[^`])(\\1)" regex : "(`+)([^\\r]*?[^`])(\\1)"
}, { // code block }, { // code block
token : "support.function", token : "support.function",
@ -94,7 +94,7 @@ var MarkdownHighlightRules = function() {
next : "blockquote" next : "blockquote"
}, { // reference }, { // reference
token : ["text", "constant", "text", "url", "string", "text"], token : ["text", "constant", "text", "url", "string", "text"],
regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?\\s*)$" regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
}, { // link by reference }, { // link by reference
token : ["text", "string", "text", "constant", "text"], token : ["text", "string", "text", "constant", "text"],
regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])" regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"
@ -120,10 +120,10 @@ var MarkdownHighlightRules = function() {
regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
next : "listblock" next : "listblock"
}, { // strong ** __ }, { // strong ** __
token : "string", token : ["string", "string", "string"],
regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)" regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
}, { // emphasis * _ }, { // emphasis * _
token : "string", token : ["string", "string", "string"],
regex : "([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)" regex : "([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
}, { // }, { //
token : ["text", "url", "text"], token : ["text", "url", "text"],

View file

@ -62,7 +62,7 @@ var Tokenizer = function(rules, flag) {
}); });
if (matchcount > 1 && state[i].token.length !== matchcount-1) 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] = { mapping[matchTotal] = {
rule: i, rule: i,