merge tokens of same type by default

This commit is contained in:
nightwing 2012-12-09 19:00:17 +04:00
commit 759fbaba44
39 changed files with 30 additions and 221 deletions

View file

@ -117,13 +117,13 @@ var AbapHighlightRules = function() {
], ],
"qstring" : [ "qstring" : [
{token : "constant.language.escape", regex : "''"}, {token : "constant.language.escape", regex : "''"},
{token : "string", regex : "'", next : "start", merge : true}, {token : "string", regex : "'", next : "start"},
{token : "string", regex : ".|\w+", merge : true} {token : "string", regex : ".|\w+"}
], ],
"string" : [ "string" : [
{token : "constant.language.escape", regex : "``"}, {token : "constant.language.escape", regex : "``"},
{token : "string", regex : "`", next : "start", merge : true}, {token : "string", regex : "`", next : "start"},
{token : "string", regex : ".|\w+", merge : true} {token : "string", regex : ".|\w+"}
] ]
} }
}; };

View file

@ -96,9 +96,9 @@ var AsciidocHighlightRules = function() {
// any word // any word
{token: "text", regex: identifierRe}, {token: "text", regex: identifierRe},
{token: ["keyword", "string", "keyword"], {token: ["keyword", "string", "keyword"],
regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/, merge: true}, regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/},
{token: "keyword", regex: /<<[\w\d\-$]+,?|>>/, merge: true}, {token: "keyword", regex: /<<[\w\d\-$]+,?|>>/},
{token: "constant.character", regex: /\({2,3}.*?\){2,3}/, merge: true}, {token: "constant.character", regex: /\({2,3}.*?\){2,3}/},
// Anchor // Anchor
{token: "keyword", regex: /\[\[.+?\]\]/}, {token: "keyword", regex: /\[\[.+?\]\]/},
// bibliography // bibliography
@ -122,26 +122,26 @@ var AsciidocHighlightRules = function() {
"listingBlock": [ "listingBlock": [
{token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, {token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"},
{token: "constant.numeric", regex: '<\\d+>'}, {token: "constant.numeric", regex: '<\\d+>'},
{token: "literal", regex: '[^<]+', merge: true}, {token: "literal", regex: '[^<]+'},
{token: "literal", regex: '<', merge: true} {token: "literal", regex: '<'}
], ],
"literalBlock": [ "literalBlock": [
{token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, {token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"},
{token: "constant.numeric", regex: '<\\d+>'}, {token: "constant.numeric", regex: '<\\d+>'},
{token: "literal", regex: '[^<]+', merge: true}, {token: "literal", regex: '[^<]+'},
{token: "literal", regex: '<', merge: true} {token: "literal", regex: '<'}
], ],
"passthroughBlock": [ "passthroughBlock": [
{token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, {token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"},
{token: "literal", regex: identifierRe + "|\\d+", merge: true}, {token: "literal", regex: identifierRe + "|\\d+"},
{include: "macros"}, {include: "macros"},
{token: "literal", regex: ".", merge: true} {token: "literal", regex: "."}
], ],
"smallPassthrough": [ "smallPassthrough": [
{token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, {token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"},
{token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock", merge: true}, {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"},
{token: "literal", regex: identifierRe + "|\\d+", merge: true}, {token: "literal", regex: identifierRe + "|\\d+"},
{include: "macros"} {include: "macros"}
], ],

View file

@ -58,7 +58,6 @@ var c_cppHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -66,7 +65,6 @@ var c_cppHighlightRules = function() {
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : '["].*\\\\$', regex : '["].*\\\\$',
next : "qqstring" next : "qqstring"
}, { }, {
@ -74,7 +72,6 @@ var c_cppHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : "['].*\\\\$", regex : "['].*\\\\$",
next : "qstring" next : "qstring"
}, { }, {
@ -120,7 +117,6 @@ var c_cppHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -131,7 +127,6 @@ var c_cppHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
], ],
@ -142,7 +137,6 @@ var c_cppHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
], ],

View file

@ -181,11 +181,9 @@ var ClojureHighlightRules = function() {
"string" : [ "string" : [
{ {
token : "constant.language.escape", token : "constant.language.escape",
merge : true,
regex : "\\\\.|\\\\$" regex : "\\\\.|\\\\$"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '[^"\\\\]+' regex : '[^"\\\\]+'
}, { }, {
token : "string", token : "string",

View file

@ -40,7 +40,6 @@ define(function(require, exports, module) {
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
var stringfill = { var stringfill = {
token : "string", token : "string",
merge : true,
regex : ".+" regex : ".+"
}; };
@ -113,32 +112,26 @@ define(function(require, exports, module) {
regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
}, { }, {
token : "string", token : "string",
merge : true,
regex : "'''", regex : "'''",
next : "qdoc" next : "qdoc"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '"""', regex : '"""',
next : "qqdoc" next : "qqdoc"
}, { }, {
token : "string", token : "string",
merge : true,
regex : "'", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '"', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "string", token : "string",
merge : true,
regex : "`", regex : "`",
next : "js" next : "js"
}, { }, {
token : "string.regex", token : "string.regex",
merge : true,
regex : "///", regex : "///",
next : "heregex" next : "heregex"
}, { }, {
@ -146,7 +139,6 @@ define(function(require, exports, module) {
regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : "###(?!#)", regex : "###(?!#)",
next : "comment" next : "comment"
}, { }, {
@ -281,20 +273,17 @@ define(function(require, exports, module) {
qstring : [{ qstring : [{
token : "string", token : "string",
regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
merge : true,
next : "start" next : "start"
}, stringfill], }, stringfill],
qqstring : [{ qqstring : [{
token : "string", token : "string",
regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
merge : true,
next : "start" next : "start"
}, stringfill], }, stringfill],
js : [{ js : [{
token : "string", token : "string",
merge : true,
regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`", regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",
next : "start" next : "start"
}, stringfill], }, stringfill],
@ -308,7 +297,6 @@ define(function(require, exports, module) {
regex : "\\s+(?:#.*)?" regex : "\\s+(?:#.*)?"
}, { }, {
token : "string.regex", token : "string.regex",
merge : true,
regex : "\\S+" regex : "\\S+"
}], }],
@ -318,7 +306,6 @@ define(function(require, exports, module) {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : ".+" regex : ".+"
}] }]
}; };

View file

@ -45,7 +45,6 @@ var ColdfusionHighlightRules = function() {
this.$rules = { this.$rules = {
start : [ { start : [ {
token : "text", token : "text",
merge : true,
regex : "<\\!\\[CDATA\\[", regex : "<\\!\\[CDATA\\[",
next : "cdata" next : "cdata"
}, { }, {
@ -53,7 +52,6 @@ var ColdfusionHighlightRules = function() {
regex : "<\\?.*?\\?>" regex : "<\\?.*?\\?>"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, { }, {
@ -82,11 +80,9 @@ var ColdfusionHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "text", token : "text",
merge : true,
regex : "\\s+" regex : "\\s+"
}, { }, {
token : "text", token : "text",
merge : true,
regex : ".+" regex : ".+"
} ], } ],
@ -96,7 +92,6 @@ var ColdfusionHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : ".+" regex : ".+"
} ] } ]
}; };

View file

@ -25,7 +25,6 @@ var CSharpHighlightRules = function() {
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
regex : "\\/\\*", regex : "\\/\\*",
merge : true,
next : "comment" next : "comment"
}, { }, {
token : "string.regexp", token : "string.regexp",
@ -74,7 +73,6 @@ var CSharpHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
] ]

View file

@ -63,7 +63,6 @@ var CssHighlightRules = function() {
var base_ruleset = [ var base_ruleset = [
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { }, {
@ -112,7 +111,6 @@ var CssHighlightRules = function() {
var base_comment = [{ var base_comment = [{
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
}]; }];
@ -140,7 +138,6 @@ var CssHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [{ "start" : [{
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -167,7 +164,6 @@ var CssHighlightRules = function() {
"media" : [ { "media" : [ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "media_comment" next : "media_comment"
}, { }, {

View file

@ -28,7 +28,6 @@ var DartHighlightRules = function() {
var stringfill = { var stringfill = {
token : "string", token : "string",
merge : true,
regex : ".+" regex : ".+"
}; };
@ -44,7 +43,6 @@ var DartHighlightRules = function() {
}, },
{ {
"token" : "comment", // multi line comment "token" : "comment", // multi line comment
"merge" : true,
"regex" : /\/\*/, "regex" : /\/\*/,
"next" : "comment" "next" : "comment"
}, },
@ -94,25 +92,21 @@ var DartHighlightRules = function() {
}, },
{ {
"token" : "string", "token" : "string",
"merge" : true,
"regex" : "'''", "regex" : "'''",
"next" : "qdoc" "next" : "qdoc"
}, },
{ {
"token" : "string", "token" : "string",
"merge" : true,
"regex" : '"""', "regex" : '"""',
"next" : "qqdoc" "next" : "qqdoc"
}, },
{ {
"token" : "string", "token" : "string",
"merge" : true,
"regex" : "'", "regex" : "'",
"next" : "qstring" "next" : "qstring"
}, },
{ {
"token" : "string", "token" : "string",
"merge" : true,
"regex" : '"', "regex" : '"',
"next" : "qqstring" "next" : "qqstring"
}, },
@ -145,11 +139,9 @@ var DartHighlightRules = function() {
{ {
token : "comment", // closing comment token : "comment", // closing comment
regex : ".*?\\*\\/", regex : ".*?\\*\\/",
merge : true,
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -171,7 +163,6 @@ var DartHighlightRules = function() {
{ {
"token" : "string", "token" : "string",
"regex" : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", "regex" : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
"merge" : true,
"next" : "start" "next" : "start"
}, stringfill], }, stringfill],
@ -179,7 +170,6 @@ var DartHighlightRules = function() {
{ {
"token" : "string", "token" : "string",
"regex" : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', "regex" : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
"merge" : true,
"next" : "start" "next" : "start"
}, stringfill] }, stringfill]
} }

View file

@ -42,19 +42,15 @@ var DocCommentHighlightRules = function() {
regex : "@[\\w\\d_]+" // TODO: fix email addresses regex : "@[\\w\\d_]+" // TODO: fix email addresses
}, { }, {
token : "comment.doc", token : "comment.doc",
merge : true,
regex : "\\s+" regex : "\\s+"
}, { }, {
token : "comment.doc", token : "comment.doc",
merge : true,
regex : "TODO" regex : "TODO"
}, { }, {
token : "comment.doc", token : "comment.doc",
merge : true,
regex : "[^@\\*]+" regex : "[^@\\*]+"
}, { }, {
token : "comment.doc", token : "comment.doc",
merge : true,
regex : "." regex : "."
}] }]
}; };
@ -65,7 +61,6 @@ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)", regex : "\\/\\*(?=\\*)",
next : start next : start
}; };
@ -74,7 +69,6 @@ DocCommentHighlightRules.getStartRule = function(start) {
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/", regex : "\\*\\/",
next : start next : start
}; };

View file

@ -27,7 +27,6 @@ define(function(require, exports, module) {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -35,7 +34,6 @@ define(function(require, exports, module) {
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : '["].*\\\\$', regex : '["].*\\\\$',
next : "qqstring" next : "qqstring"
}, { }, {
@ -43,7 +41,6 @@ define(function(require, exports, module) {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : "['].*\\\\$", regex : "['].*\\\\$",
next : "qstring" next : "qstring"
}, { }, {
@ -85,7 +82,6 @@ define(function(require, exports, module) {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -96,7 +92,6 @@ define(function(require, exports, module) {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
], ],
@ -107,7 +102,6 @@ define(function(require, exports, module) {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
] ]

View file

@ -72,7 +72,6 @@ var GroovyHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -127,7 +126,6 @@ var GroovyHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],

View file

@ -35,7 +35,6 @@ var HaxeHighlightRules = function() {
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
regex : "\\/\\*", regex : "\\/\\*",
merge : true,
next : "comment" next : "comment"
}, { }, {
token : "string.regexp", token : "string.regexp",
@ -84,7 +83,6 @@ var HaxeHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
] ]

View file

@ -64,7 +64,6 @@ var HtmlHighlightRules = function() {
this.$rules = { this.$rules = {
start : [{ start : [{
token : "text", token : "text",
merge : true,
regex : "<\\!\\[CDATA\\[", regex : "<\\!\\[CDATA\\[",
next : "cdata" next : "cdata"
}, { }, {
@ -72,7 +71,6 @@ var HtmlHighlightRules = function() {
regex : "<\\?.*?\\?>" regex : "<\\?.*?\\?>"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, { }, {
@ -107,11 +105,9 @@ var HtmlHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "text", token : "text",
merge : true,
regex : "\\s+" regex : "\\s+"
}, { }, {
token : "text", token : "text",
merge : true,
regex : ".+" regex : ".+"
} ], } ],
@ -121,7 +117,6 @@ var HtmlHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : ".+" regex : ".+"
} ] } ]
}; };

View file

@ -165,7 +165,6 @@ var JadeHighlightRules = function() {
}, },
{ {
"token": "comment.block.jade", "token": "comment.block.jade",
"merge" : true,
"regex" : ".+" "regex" : ".+"
} }
], ],
@ -264,17 +263,14 @@ var JadeHighlightRules = function() {
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+',
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "\\\\$",
next : "qqstring", next : "qqstring",
merge : true
}, { }, {
token : "string", token : "string",
regex : '"|$', regex : '"|$',
next : "tag_attributes", next : "tag_attributes",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -284,17 +280,14 @@ var JadeHighlightRules = function() {
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+",
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "\\\\$",
next : "qstring", next : "qstring",
merge : true
}, { }, {
token : "string", token : "string",
regex : "'|$", regex : "'|$",
next : "tag_attributes", next : "tag_attributes",
merge : true
} }
] ]
}; };

View file

@ -70,7 +70,6 @@ var JavaHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -117,7 +116,6 @@ var JavaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
] ]

View file

@ -90,7 +90,6 @@ var JavaScriptHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : /\/\*/, regex : /\/\*/,
next : "comment" next : "comment"
}, { }, {
@ -217,7 +216,6 @@ var JavaScriptHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment_regex_allowed" next : "comment_regex_allowed"
}, { }, {
@ -227,7 +225,6 @@ var JavaScriptHighlightRules = function() {
token: "string.regexp", token: "string.regexp",
regex: "\\/", regex: "\\/",
next: "regex", next: "regex",
merge: true
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
@ -249,7 +246,6 @@ var JavaScriptHighlightRules = function() {
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
merge: true
}, { }, {
// invalid operators // invalid operators
token : "invalid", token : "invalid",
@ -261,12 +257,10 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: /{|[^{\[\/\\(|)$^+*?]+/, regex: /{|[^{\[\/\\(|)$^+*?]+/,
merge: true
}, { }, {
token: "constant.language.escape", token: "constant.language.escape",
regex: /\[\^?/, regex: /\[\^?/,
next: "regex_character_class", next: "regex_character_class",
merge: true
}, { }, {
token: "empty", token: "empty",
regex: "", regex: "",
@ -281,14 +275,12 @@ var JavaScriptHighlightRules = function() {
token: "constant.language.escape", token: "constant.language.escape",
regex: "]", regex: "]",
next: "regex", next: "regex",
merge: true
}, { }, {
token: "constant.language.escape", token: "constant.language.escape",
regex: "-" regex: "-"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: /[^\]\-\\]+/, regex: /[^\]\-\\]+/,
merge: true
}, { }, {
token: "empty", token: "empty",
regex: "", regex: "",
@ -302,11 +294,9 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "punctuation.operator", token: "punctuation.operator",
regex: "[, ]+", regex: "[, ]+",
merge: true
}, { }, {
token: "punctuation.operator", token: "punctuation.operator",
regex: "$", regex: "$",
merge: true
}, { }, {
token: "empty", token: "empty",
regex: "", regex: "",
@ -317,11 +307,9 @@ var JavaScriptHighlightRules = function() {
{ {
token : "comment", // closing comment token : "comment", // closing comment
regex : ".*?\\*\\/", regex : ".*?\\*\\/",
merge : true,
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -329,11 +317,9 @@ var JavaScriptHighlightRules = function() {
{ {
token : "comment", // closing comment token : "comment", // closing comment
regex : ".*?\\*\\/", regex : ".*?\\*\\/",
merge : true,
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -345,16 +331,13 @@ var JavaScriptHighlightRules = function() {
token : "string", token : "string",
regex : "\\\\$", regex : "\\\\$",
next : "qqstring", next : "qqstring",
merge : true
}, { }, {
token : "string", token : "string",
regex : '"|$', regex : '"|$',
next : "start", next : "start",
merge : true
}, { }, {
token : "string", token : "string",
regex : '.|\\w+|\\s+', regex : '.|\\w+|\\s+',
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -365,16 +348,13 @@ var JavaScriptHighlightRules = function() {
token : "string", token : "string",
regex : "\\\\$", regex : "\\\\$",
next : "qstring", next : "qstring",
merge : true
}, { }, {
token : "string", token : "string",
regex : "'|$", regex : "'|$",
next : "start", next : "start",
merge : true
}, { }, {
token : "string", token : "string",
regex : '.|\\w+|\\s+', regex : '.|\\w+|\\s+',
merge : true
} }
] ]
}; };

View file

@ -80,17 +80,14 @@ var JsonHighlightRules = function() {
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+',
merge : true
}, { }, {
token : "string", token : "string",
regex : '"', regex : '"',
next : "start", next : "start",
merge : true
}, { }, {
token : "string", token : "string",
regex : "", regex : "",
next : "start", next : "start",
merge : true
} }
] ]
}; };

View file

@ -54,7 +54,6 @@ var JspHighlightRules = function() {
this.$rules["start"].unshift({ this.$rules["start"].unshift({
token : "comment", token : "comment",
merge : true,
regex : "<%--", regex : "<%--",
next : "comment" next : "comment"
}); });

View file

@ -37,7 +37,6 @@ define(function(require, exports, module) {
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
regex : "\\/\\*", regex : "\\/\\*",
merge : true,
next : "comment" next : "comment"
}, { }, {
token : "string.regexp", token : "string.regexp",
@ -106,7 +105,6 @@ define(function(require, exports, module) {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
] ]

View file

@ -177,7 +177,6 @@ var LessHighlightRules = function() {
}, },
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -257,7 +256,6 @@ var LessHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
] ]

View file

@ -83,7 +83,6 @@ var LiquidHighlightRules = function() {
next : "liquid_start" next : "liquid_start"
}, { }, {
token : "meta.tag", token : "meta.tag",
merge : true,
regex : "<\\!\\[CDATA\\[", regex : "<\\!\\[CDATA\\[",
next : "cdata" next : "cdata"
}, { }, {
@ -91,7 +90,6 @@ var LiquidHighlightRules = function() {
regex : "<\\?.*?\\?>" regex : "<\\?.*?\\?>"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, { }, {
@ -120,11 +118,9 @@ var LiquidHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "text", token : "text",
merge : true,
regex : "\\s+" regex : "\\s+"
}, { }, {
token : "text", token : "text",
merge : true,
regex : ".+" regex : ".+"
} ], } ],
@ -134,7 +130,6 @@ var LiquidHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : ".+" regex : ".+"
} ] , } ] ,

View file

@ -128,27 +128,22 @@ var LuaHighlightRules = function() {
{ {
token : "comment", // --[[ comment token : "comment", // --[[ comment
regex : strPre + '\\-\\-\\[\\[.*$', regex : strPre + '\\-\\-\\[\\[.*$',
merge : true,
next : "qcomment" next : "qcomment"
}, { }, {
token : "comment", // --[=[ comment token : "comment", // --[=[ comment
regex : strPre + '\\-\\-\\[\\=\\[.*$', regex : strPre + '\\-\\-\\[\\=\\[.*$',
merge : true,
next : "qcomment1" next : "qcomment1"
}, { }, {
token : "comment", // --[==[ comment token : "comment", // --[==[ comment
regex : strPre + '\\-\\-\\[\\={2}\\[.*$', regex : strPre + '\\-\\-\\[\\={2}\\[.*$',
merge : true,
next : "qcomment2" next : "qcomment2"
}, { }, {
token : "comment", // --[===[ comment token : "comment", // --[===[ comment
regex : strPre + '\\-\\-\\[\\={3}\\[.*$', regex : strPre + '\\-\\-\\[\\={3}\\[.*$',
merge : true,
next : "qcomment3" next : "qcomment3"
}, { }, {
token : "comment", // --[====[ comment token : "comment", // --[====[ comment
regex : strPre + '\\-\\-\\[\\={4}\\[.*$', regex : strPre + '\\-\\-\\[\\={4}\\[.*$',
merge : true,
next : "qcomment4" next : "qcomment4"
}, { }, {
token : function(value){ // --[====+[ comment token : function(value){ // --[====+[ comment
@ -164,7 +159,6 @@ var LuaHighlightRules = function() {
return "comment"; return "comment";
}, },
regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$', regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$',
merge : true,
next : "qcomment5" next : "qcomment5"
}, },
@ -199,27 +193,22 @@ var LuaHighlightRules = function() {
{ {
token : "string", // [[ string token : "string", // [[ string
regex : strPre + '\\[\\[.*$', regex : strPre + '\\[\\[.*$',
merge : true,
next : "qstring" next : "qstring"
}, { }, {
token : "string", // [=[ string token : "string", // [=[ string
regex : strPre + '\\[\\=\\[.*$', regex : strPre + '\\[\\=\\[.*$',
merge : true,
next : "qstring1" next : "qstring1"
}, { }, {
token : "string", // [==[ string token : "string", // [==[ string
regex : strPre + '\\[\\={2}\\[.*$', regex : strPre + '\\[\\={2}\\[.*$',
merge : true,
next : "qstring2" next : "qstring2"
}, { }, {
token : "string", // [===[ string token : "string", // [===[ string
regex : strPre + '\\[\\={3}\\[.*$', regex : strPre + '\\[\\={3}\\[.*$',
merge : true,
next : "qstring3" next : "qstring3"
}, { }, {
token : "string", // [====[ string token : "string", // [====[ string
regex : strPre + '\\[\\={4}\\[.*$', regex : strPre + '\\[\\={4}\\[.*$',
merge : true,
next : "qstring4" next : "qstring4"
}, { }, {
token : function(value){ // --[====+[ string token : function(value){ // --[====+[ string
@ -231,7 +220,6 @@ var LuaHighlightRules = function() {
return "string"; return "string";
}, },
regex : strPre + '\\[\\={5}\\=*\\[.*$', regex : strPre + '\\[\\={5}\\=*\\[.*$',
merge : true,
next : "qstring5" next : "qstring5"
}, },
@ -270,7 +258,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qcomment1": [ { "qcomment1": [ {
@ -279,7 +266,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qcomment2": [ { "qcomment2": [ {
@ -288,7 +274,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qcomment3": [ { "qcomment3": [ {
@ -297,7 +282,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qcomment4": [ { "qcomment4": [ {
@ -306,7 +290,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qcomment5": [ { "qcomment5": [ {
@ -328,7 +311,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
@ -338,7 +320,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qstring1": [ { "qstring1": [ {
@ -347,7 +328,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qstring2": [ { "qstring2": [ {
@ -356,7 +336,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qstring3": [ { "qstring3": [ {
@ -365,7 +344,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qstring4": [ { "qstring4": [ {
@ -374,7 +352,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qstring5": [ { "qstring5": [ {
@ -396,7 +373,6 @@ var LuaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ] } ]

View file

@ -41,7 +41,6 @@ var ObjectiveCHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, },
@ -299,7 +298,6 @@ var ObjectiveCHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],

View file

@ -257,7 +257,6 @@ var OcamlHighlightRules = function() {
}, },
{ {
token : "comment", token : "comment",
merge : true,
regex : '\\(\\*.*', regex : '\\(\\*.*',
next : "comment" next : "comment"
}, },
@ -271,7 +270,6 @@ var OcamlHighlightRules = function() {
}, },
{ {
token : "string", // " string token : "string", // " string
merge : true,
regex : '"', regex : '"',
next : "qstring" next : "qstring"
}, },
@ -316,7 +314,6 @@ var OcamlHighlightRules = function() {
}, },
{ {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -328,7 +325,6 @@ var OcamlHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
] ]

View file

@ -90,7 +90,6 @@ var PerlHighlightRules = function() {
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : '["].*\\\\$', regex : '["].*\\\\$',
next : "qqstring" next : "qqstring"
}, { }, {
@ -98,7 +97,6 @@ var PerlHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : "['].*\\\\$", regex : "['].*\\\\$",
next : "qstring" next : "qstring"
}, { }, {
@ -131,7 +129,6 @@ var PerlHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
], ],
@ -142,7 +139,6 @@ var PerlHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
] ]

View file

@ -449,7 +449,6 @@ var PgsqlHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi-line comment token : "comment", // multi-line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
},{ },{
@ -468,7 +467,6 @@ var PgsqlHighlightRules = function() {
regex : "--.*$" regex : "--.*$"
}, { }, {
token : "comment", // multi-line comment token : "comment", // multi-line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "commentStatement" next : "commentStatement"
}, { }, {
@ -500,7 +498,6 @@ var PgsqlHighlightRules = function() {
regex : "--.*$" regex : "--.*$"
}, { }, {
token : "comment", // multi-line comment token : "comment", // multi-line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "commentDollarSql" next : "commentDollarSql"
}, { }, {
@ -521,7 +518,6 @@ var PgsqlHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -533,7 +529,6 @@ var PgsqlHighlightRules = function() {
next : "statement" next : "statement"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -545,7 +540,6 @@ var PgsqlHighlightRules = function() {
next : "dollarSql" next : "dollarSql"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -557,7 +551,6 @@ var PgsqlHighlightRules = function() {
next : "statement" next : "statement"
}, { }, {
token : "string", // dollarstring spanning whole line token : "string", // dollarstring spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -569,7 +562,6 @@ var PgsqlHighlightRules = function() {
next : "dollarSql" next : "dollarSql"
}, { }, {
token : "string", // dollarstring spanning whole line token : "string", // dollarstring spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
] ]

View file

@ -127,15 +127,12 @@ var PowershellHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "doc.comment.tag", token : "doc.comment.tag",
merge : true,
regex : "^\\.\\w+" regex : "^\\.\\w+"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : "\\w+" regex : "\\w+"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : "." regex : "."
} }
] ]

View file

@ -93,7 +93,6 @@ var PythonHighlightRules = function() {
regex : strPre + '"{3}(?:[^\\\\]|\\\\.)*?"{3}' regex : strPre + '"{3}(?:[^\\\\]|\\\\.)*?"{3}'
}, { }, {
token : "string", // multi line """ string start token : "string", // multi line """ string start
merge : true,
regex : strPre + '"{3}.*$', regex : strPre + '"{3}.*$',
next : "qqstring" next : "qqstring"
}, { }, {
@ -104,7 +103,6 @@ var PythonHighlightRules = function() {
regex : strPre + "'{3}(?:[^\\\\]|\\\\.)*?'{3}" regex : strPre + "'{3}(?:[^\\\\]|\\\\.)*?'{3}"
}, { }, {
token : "string", // multi line ''' string start token : "string", // multi line ''' string start
merge : true,
regex : strPre + "'{3}.*$", regex : strPre + "'{3}.*$",
next : "qstring" next : "qstring"
}, { }, {
@ -144,7 +142,6 @@ var PythonHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ], } ],
"qstring" : [ { "qstring" : [ {
@ -153,7 +150,6 @@ var PythonHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ] } ]
}; };

View file

@ -134,7 +134,6 @@ var RubyHighlightRules = function() {
regex : "#.*$" regex : "#.*$"
}, { }, {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "^=begin\\s", regex : "^=begin\\s",
next : "comment" next : "comment"
}, { }, {
@ -193,7 +192,6 @@ var RubyHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
] ]

View file

@ -55,7 +55,6 @@ var scadHighlightRules = function() {
DocCommentHighlightRules.getStartRule("start"), DocCommentHighlightRules.getStartRule("start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -108,7 +107,6 @@ var scadHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -119,7 +117,6 @@ var scadHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
], ],
@ -130,7 +127,6 @@ var scadHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
] ]

View file

@ -67,7 +67,6 @@ var ScalaHighlightRules = function() {
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -119,7 +118,6 @@ var ScalaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -129,7 +127,6 @@ var ScalaHighlightRules = function() {
regex : '\\\\"' regex : '\\\\"'
}, { }, {
token : "string", token : "string",
merge : true,
regex : '"', regex : '"',
next : "start" next : "start"
}, { }, {
@ -138,8 +135,7 @@ var ScalaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
} }
], ],
"tstring" : [ "tstring" : [
@ -149,7 +145,6 @@ var ScalaHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", // comment spanning whole line token : "string", // comment spanning whole line
merge : true,
regex : ".+?" regex : ".+?"
} }
] ]

View file

@ -176,7 +176,6 @@ var ScssHighlightRules = function() {
}, },
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "comment" next : "comment"
}, { }, {
@ -184,7 +183,6 @@ var ScssHighlightRules = function() {
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : '["].*\\\\$', regex : '["].*\\\\$',
next : "qqstring" next : "qqstring"
}, { }, {
@ -192,7 +190,6 @@ var ScssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : "['].*\\\\$", regex : "['].*\\\\$",
next : "qstring" next : "qstring"
}, { }, {
@ -261,7 +258,6 @@ var ScssHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
@ -272,7 +268,6 @@ var ScssHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
], ],
@ -283,7 +278,6 @@ var ScssHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
] ]

View file

@ -29,7 +29,6 @@ var StylusHighlightRules = function() {
}, },
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true,
regex : /\/\*/, regex : /\/\*/,
next : "comment" next : "comment"
}, },
@ -118,50 +117,42 @@ var StylusHighlightRules = function() {
{ {
token : "comment", // closing comment token : "comment", // closing comment
regex : ".*?\\*\\/", regex : ".*?\\*\\/",
merge : true,
next : "start" next : "start"
}, { }, {
token : "comment", // comment spanning whole line token : "comment", // comment spanning whole line
merge : true,
regex : ".+" regex : ".+"
} }
], ],
"qqstring" : [ "qqstring" : [
{ {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, },
{ {
token : "string", token : "string",
regex : "\\\\$", regex : "\\\\$",
next : "qqstring", next : "qqstring"
merge : true
}, },
{ {
token : "string", token : "string",
regex : '"|$', regex : '"|$',
next : "start", next : "start"
merge : true
} }
], ],
"qstring" : [ "qstring" : [
{ {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, },
{ {
token : "string", token : "string",
regex : "\\\\$", regex : "\\\\$",
next : "qstring", next : "qstring"
merge : true
}, },
{ {
token : "string", token : "string",
regex : "'|$", regex : "'|$",
next : "start", next : "start"
merge : true
} }
] ]
} }

View file

@ -42,7 +42,6 @@ var TclHighlightRules = function() {
"start" : [ "start" : [
{ {
token : "comment", token : "comment",
merge : true,
regex : "#.*\\\\$", regex : "#.*\\\\$",
next : "commentfollow" next : "commentfollow"
}, { }, {
@ -64,12 +63,10 @@ var TclHighlightRules = function() {
regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // multi line """ string start token : "string", // multi line """ string start
merge : true,
regex : '[ ]*["]', regex : '[ ]*["]',
next : "qqstring" next : "qqstring"
}, { }, {
token : "variable.instancce", // variable xotcl with braces token : "variable.instancce", // variable xotcl with braces
merge : true,
regex : "[$]", regex : "[$]",
next : "variable" next : "variable"
}, { }, {
@ -96,7 +93,6 @@ var TclHighlightRules = function() {
"commandItem" : [ "commandItem" : [
{ {
token : "comment", token : "comment",
merge : true,
regex : "#.*\\\\$", regex : "#.*\\\\$",
next : "commentfollow" next : "commentfollow"
}, { }, {
@ -108,7 +104,6 @@ var TclHighlightRules = function() {
regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "variable.instancce", // variable xotcl with braces token : "variable.instancce", // variable xotcl with braces
merge : true,
regex : "[$]", regex : "[$]",
next : "variable" next : "variable"
}, { }, {
@ -138,7 +133,6 @@ var TclHighlightRules = function() {
next : "commentfollow" next : "commentfollow"
}, { }, {
token : "comment", token : "comment",
merge : true,
regex : '.+', regex : '.+',
next : "start" next : "start"
} ], } ],
@ -168,7 +162,6 @@ var TclHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} ] } ]
}; };

View file

@ -40,7 +40,7 @@ var XmlHighlightRules = function() {
start : [ start : [
{token : "text", regex : "<\\!\\[CDATA\\[", next : "cdata"}, {token : "text", regex : "<\\!\\[CDATA\\[", next : "cdata"},
{token : "xml-pe", regex : "<\\?.*?\\?>"}, {token : "xml-pe", regex : "<\\?.*?\\?>"},
{token : "comment", regex : "<\\!--", next : "comment", merge : true}, {token : "comment", regex : "<\\!--", next : "comment"},
{token : "xml-pe", regex : "<\\!.*?>"}, {token : "xml-pe", regex : "<\\!.*?>"},
{token : "meta.tag", regex : "<\\/?", next : "tag"}, {token : "meta.tag", regex : "<\\/?", next : "tag"},
{token : "text", regex : "\\s+"}, {token : "text", regex : "\\s+"},
@ -59,7 +59,7 @@ var XmlHighlightRules = function() {
comment : [ comment : [
{token : "comment", regex : ".*?-->", next : "start"}, {token : "comment", regex : ".*?-->", next : "start"},
{token : "comment", merge : true, regex : ".+"} {token : "comment", regex : ".+"}
] ]
}; };

View file

@ -50,7 +50,7 @@ function multiLineString(quote, state) {
token : "constant.language.escape", token : "constant.language.escape",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, },
{token : "string", merge : true, regex : '\\w+|.|\\s+'} {token : "string", regex : '\\w+|.|\\s+'}
]; ];
} }
@ -67,7 +67,6 @@ exports.tag = function(states, name, nextState, tagMap) {
else else
return "meta.tag.tag-name"; return "meta.tag.tag-name";
}, },
merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
@ -80,9 +79,8 @@ exports.tag = function(states, name, nextState, tagMap) {
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list"); states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
states[name + "_embed_attribute_list"] = [{ states[name + "_embed_attribute_list"] = [{
token : "meta.tag", token : "meta.tag.r",
merge : true, regex : "/?>",
regex : "\/?>",
next : nextState next : nextState
}, { }, {
token : "keyword.operator", token : "keyword.operator",

View file

@ -72,7 +72,6 @@ var YamlHighlightRules = function() {
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // multi line string start token : "string", // multi line string start
merge : true,
regex : '[\\|>]\\w*', regex : '[\\|>]\\w*',
next : "qqstring" next : "qqstring"
}, { }, {
@ -111,7 +110,6 @@ var YamlHighlightRules = function() {
next : "start" next : "start"
}, { }, {
token : "string", token : "string",
merge : true,
regex : '.+' regex : '.+'
} }
]}; ]};

View file

@ -159,7 +159,7 @@ var Tokenizer = function(rules, flag) {
if (!value[i]) if (!value[i])
continue; continue;
if ((!rule || rule.merge || type[i] === "text") && token.type === type[i]) { if ((!rule || rule.merge !== false) && token.type === type[i]) {
token.value += value[i]; token.value += value[i];
} else { } else {
if (token.type) if (token.type)