Merge branch 'doc/api'

Conflicts:
	lib/ace/editor.js
This commit is contained in:
Fabian Jakobs 2012-04-28 15:52:53 +02:00
commit cd9da075b1
349 changed files with 12166 additions and 15607 deletions

View file

@ -1,3 +1,5 @@
.PHONY : doc build clean dist
build: build:
git rev-parse HEAD > .git-ref git rev-parse HEAD > .git-ref
mkdir -p build/src mkdir -p build/src
@ -12,6 +14,9 @@ build:
./Makefile.dryice.js demo ./Makefile.dryice.js demo
./Makefile.dryice.js bm ./Makefile.dryice.js bm
doc:
cd doc; node build.js
clean: clean:
rm -rf build rm -rf build
rm -rf ace-* rm -rf ace-*

File diff suppressed because it is too large Load diff

View file

@ -204,7 +204,7 @@ var c_cppHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -303,7 +303,7 @@ var c_cppHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(c_cppHighlightRules, TextHighlightRules); oop.inherits(c_cppHighlightRules, TextHighlightRules);
@ -381,24 +381,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -195,9 +195,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -205,9 +202,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -357,7 +351,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
@ -1360,7 +1354,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1368,11 +1362,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -1392,10 +1386,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -1407,8 +1402,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -1419,10 +1413,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1431,20 +1426,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1453,20 +1450,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -1475,17 +1474,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -1536,7 +1535,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1564,9 +1562,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -1574,6 +1573,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -1589,7 +1589,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -1598,24 +1599,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -1653,18 +1637,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -1673,24 +1650,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1768,24 +1738,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -2288,7 +2261,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -2296,7 +2293,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -2314,8 +2331,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -2323,7 +2338,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -2331,7 +2346,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -2341,12 +2356,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {

View file

@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -155,7 +155,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -163,7 +187,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -181,8 +225,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -190,7 +232,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -198,7 +240,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -208,12 +250,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {

View file

@ -304,7 +304,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -312,11 +312,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -336,10 +336,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -351,8 +352,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -363,10 +363,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -375,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -397,20 +400,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -419,17 +424,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -480,7 +485,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -508,9 +512,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -518,6 +523,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -533,7 +539,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -542,24 +549,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -597,18 +587,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -617,24 +600,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -712,24 +688,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1478,7 +1457,7 @@ var GroovyHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1548,7 +1527,7 @@ var GroovyHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(GroovyHighlightRules, TextHighlightRules); oop.inherits(GroovyHighlightRules, TextHighlightRules);

View file

@ -84,7 +84,7 @@ var HaxeHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
regex : "\\/\\*", regex : "\\/\\*",
@ -153,7 +153,7 @@ var HaxeHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(HaxeHighlightRules, TextHighlightRules); oop.inherits(HaxeHighlightRules, TextHighlightRules);
@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -363,7 +363,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -371,11 +371,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -395,10 +395,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -410,8 +411,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -422,10 +422,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -434,20 +435,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -456,20 +459,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -478,17 +483,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -539,7 +544,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -567,9 +571,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -577,6 +582,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -592,7 +598,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -601,24 +608,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -656,18 +646,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -676,24 +659,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -771,24 +747,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1628,7 +1607,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -1636,7 +1639,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -1654,8 +1677,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -1663,7 +1684,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -1671,7 +1692,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -1681,12 +1702,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -1887,9 +1902,6 @@ var HtmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*script\\b)", regex : "<(?=\s*script\\b)",
@ -1905,9 +1917,6 @@ var HtmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -2077,7 +2086,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -420,17 +425,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1480,7 +1459,7 @@ var JavaHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1550,7 +1529,7 @@ var JavaHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaHighlightRules, TextHighlightRules); oop.inherits(JavaHighlightRules, TextHighlightRules);

View file

@ -280,7 +280,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -288,11 +288,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -312,10 +312,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -327,8 +328,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -339,10 +339,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -351,20 +352,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -373,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -395,17 +400,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -456,7 +461,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -484,9 +488,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -494,6 +499,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -509,7 +515,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -518,24 +525,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -573,18 +563,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -593,24 +576,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -688,24 +664,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -1,654 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* John Roepke <john AT justjohn DOT us>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/less', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/less_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/cstyle'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
this.$tokenizer = new Tokenizer(new LessHighlightRules().getRules(), "i");
this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
// ignore braces in comments
var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent;
}
var match = line.match(/^.*\{\s*$/);
if (match) {
indent += tab;
}
return indent;
};
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
}).call(Mode.prototype);
exports.Mode = Mode;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* John Roepke <john AT justjohn DOT us>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/less_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var LessHighlightRules = function() {
var properties = lang.arrayToMap( (function () {
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
"background-size|binding|border-bottom-colors|border-left-colors|" +
"border-right-colors|border-top-colors|border-end|border-end-color|" +
"border-end-style|border-end-width|border-image|border-start|" +
"border-start-color|border-start-style|border-start-width|box-align|" +
"box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
"box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
"column-rule-width|column-rule-style|column-rule-color|float-edge|" +
"font-feature-settings|font-language-override|force-broken-image-icon|" +
"image-region|margin-end|margin-start|opacity|outline|outline-color|" +
"outline-offset|outline-radius|outline-radius-bottomleft|" +
"outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
"outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
"tab-size|text-blink|text-decoration-color|text-decoration-line|" +
"text-decoration-style|transform|transform-origin|transition|" +
"transition-delay|transition-duration|transition-property|" +
"transition-timing-function|user-focus|user-input|user-modify|user-select|" +
"window-shadow|border-radius").split("|");
var properties = ("azimuth|background-attachment|background-color|background-image|" +
"background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|opacity|orphans|outline-color|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|");
//The return array
var ret = [];
//All prefixProperties will get the browserPrefix in
//the begning by join the prefixProperties array with the value of browserPrefix
for (var i=0, ln=browserPrefix.length; i<ln; i++) {
Array.prototype.push.apply(
ret,
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
);
}
//Add also prefixProperties and properties without any browser prefix
Array.prototype.push.apply(ret, prefixProperties);
Array.prototype.push.apply(ret, properties);
return ret;
})() );
var functions = lang.arrayToMap(
("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|" +
"desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|" +
"alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|" +
"iskeyword|isurl|ispixel|ispercentage|isem").split("|")
);
var constants = lang.arrayToMap(
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
);
var colors = lang.arrayToMap(
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
"purple|red|silver|teal|white|yellow").split("|")
);
var keywords = lang.arrayToMap(
("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|" +
"@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|" +
"def|end|declare|when|not|and").split("|")
);
var tags = lang.arrayToMap(
("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
"big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
"command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
"figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
"header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
"link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
"option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
"small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
"textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
);
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
},
{
token : "comment", // multi line comment
merge : true,
regex : "\\/\\*",
next : "comment"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric",
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
}, {
token : "constant.numeric", // hex6 color
regex : "#[a-f0-9]{6}"
}, {
token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}"
}, {
token : "constant.numeric",
regex : numRe
}, {
token : function(value) {
if (keywords.hasOwnProperty(value))
return "keyword";
else
return "variable";
},
regex : "@[a-z0-9_\\-@]*\\b"
}, {
token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase()))
return "support.type";
else if (keywords.hasOwnProperty(value))
return "keyword";
else if (constants.hasOwnProperty(value))
return "constant.language";
else if (functions.hasOwnProperty(value))
return "support.function";
else if (colors.hasOwnProperty(value.toLowerCase()))
return "support.constant.color";
else if (tags.hasOwnProperty(value.toLowerCase()))
return "variable.language";
else
return "text";
},
regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
}, {
token: "variable.language",
regex: "#[a-z0-9-_]+"
}, {
token: "variable.language",
regex: "\\.[a-z0-9-_]+"
}, {
token: "variable.language",
regex: ":[a-z0-9-_]+"
}, {
token: "constant",
regex: "[a-z0-9-_]+"
}, {
token : "keyword.operator",
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
}, {
token : "paren.lparen",
regex : "[[({]"
}, {
token : "paren.rparen",
regex : "[\\])}]"
}, {
token : "text",
regex : "\\s+"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : ".*?\\*\\/",
next : "start"
}, {
token : "comment", // comment spanning whole line
merge : true,
regex : ".+"
}
]
};
};
oop.inherits(LessHighlightRules, TextHighlightRules);
exports.LessHighlightRules = LessHighlightRules;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function() {};
(function() {
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match) return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column});
if (!openBracePos || openBracePos.row == row) return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent);
};
this.$getIndent = function(line) {
var match = line.match(/^(\s+)/);
if (match) {
return match[1];
}
return "";
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length);
range.end.column -= 2;
return range;
}
if (foldStyle !== "markbeginend")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[2]) {
var range = session.getCommentFoldRange(row, i);
range.end.column -= 2;
return range;
}
var end = {row: row, column: i};
var start = session.$findOpeningBracket(match[1], end);
if (!start)
return;
start.column++;
end.column--;
return Range.fromPoints(start, end);
}
};
}).call(FoldMode.prototype);
});/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
"use strict";
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function() {};
(function() {
this.foldingStartMarker = null;
this.foldingStopMarker = null;
// must return "" if there's no fold, to enable caching
this.getFoldWidget = function(session, foldStyle, row) {
var line = session.getLine(row);
if (this.foldingStartMarker.test(line))
return "start";
if (foldStyle == "markbeginend"
&& this.foldingStopMarker
&& this.foldingStopMarker.test(line))
return "end";
return "";
};
this.getFoldWidgetRange = function(session, foldStyle, row) {
return null;
};
this.indentationBlock = function(session, row, column) {
var re = /^\s*/;
var startRow = row;
var endRow = row;
var line = session.getLine(row);
var startColumn = column || line.length;
var startLevel = line.match(re)[0].length;
var maxRow = session.getLength()
while (++row < maxRow) {
line = session.getLine(row);
var level = line.match(re)[0].length;
if (level == line.length)
continue;
if (level <= startLevel)
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.openingBracketBlock = function(session, bracket, row, column) {
var start = {row: row, column: column + 1};
var end = session.$findClosingBracket(bracket, start);
if (!end)
return;
var fw = session.foldWidgets[end.row];
if (fw == null)
fw = this.getFoldWidget(session, end.row);
if (fw == "start") {
end.row --;
end.column = session.getLine(end.row).length;
}
return Range.fromPoints(start, end);
};
}).call(FoldMode.prototype);
});

View file

@ -381,7 +381,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -389,7 +413,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -407,8 +451,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -416,7 +458,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -424,7 +466,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -434,12 +476,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -694,7 +730,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -702,11 +738,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -726,10 +762,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -741,8 +778,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -753,10 +789,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -765,20 +802,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -787,20 +826,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -809,17 +850,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -870,7 +911,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -898,9 +938,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -908,6 +949,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -923,7 +965,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -932,24 +975,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -987,18 +1013,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -1007,24 +1026,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1102,24 +1114,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1238,7 +1253,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",

View file

@ -360,7 +360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -368,11 +368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -392,10 +392,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -407,8 +408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -419,10 +419,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -431,20 +432,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -453,20 +456,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -475,17 +480,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -536,7 +541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -564,9 +568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -574,6 +579,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -589,7 +595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -598,24 +605,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -653,18 +643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -673,24 +656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -768,24 +744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1594,9 +1573,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -1604,9 +1580,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -1756,7 +1729,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
@ -2380,7 +2353,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -2388,7 +2385,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -2406,8 +2423,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -2415,7 +2430,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -2423,7 +2438,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -2433,12 +2448,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -2639,9 +2648,6 @@ var HtmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*script\\b)", regex : "<(?=\s*script\\b)",
@ -2657,9 +2663,6 @@ var HtmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"

View file

@ -520,7 +520,7 @@ var PgsqlHighlightRules = function() {
token : "comment", token : "comment",
regex : "--.*$" regex : "--.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi-line comment token : "comment", // multi-line comment
merge : true, merge : true,
@ -649,7 +649,7 @@ var PgsqlHighlightRules = function() {
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); this.embedRules(DocCommentHighlightRules, "doc-", [ new DocCommentHighlightRules().getEndRule("start") ]);
this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]); this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]); this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
}; };
@ -730,24 +730,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -164,7 +164,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var PhpHighlightRules = function() { var PhpHighlightRules = function() {
var docComment = DocCommentHighlightRules; var docComment = new DocCommentHighlightRules();
// http://php.net/quickref.php // http://php.net/quickref.php
var builtinFunctions = lang.arrayToMap( var builtinFunctions = lang.arrayToMap(
('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' + ('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' +
@ -1269,7 +1269,7 @@ var PhpHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(PhpHighlightRules, TextHighlightRules); oop.inherits(PhpHighlightRules, TextHighlightRules);
@ -1347,24 +1347,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -197,7 +197,7 @@ var scadHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("start"), new DocCommentHighlightRules().getStartRule("start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -291,7 +291,7 @@ var scadHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(scadHighlightRules, TextHighlightRules); oop.inherits(scadHighlightRules, TextHighlightRules);
@ -369,24 +369,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -420,17 +425,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1480,7 +1459,7 @@ var ScalaHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1550,7 +1529,7 @@ var ScalaHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(ScalaHighlightRules, TextHighlightRules); oop.inherits(ScalaHighlightRules, TextHighlightRules);

View file

@ -164,8 +164,6 @@ exports.Mode = Mode;
* *
* Contributor(s): * Contributor(s):
* Rich Healey <richo AT psych0tik DOT net> * Rich Healey <richo AT psych0tik DOT net>
* Javier Perez-Griffo <javier AT besol DOT es>
* James Tan <jamestyj AT gmail DOT com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -193,20 +191,14 @@ var ShHighlightRules = function() {
var reservedKeywords = lang.arrayToMap( var reservedKeywords = lang.arrayToMap(
('!|{|}|case|do|done|elif|else|'+ ('!|{|}|case|do|done|elif|else|'+
'esac|fi|for|if|in|then|until|while|'+ 'esac|fi|for|if|in|then|until|while|'+
'&|;|export|local|read|typeset|unset|'+ '&|;'
'elif|select|set'
).split('|') ).split('|')
); );
var languageConstructs = lang.arrayToMap( var languageConstructs = lang.arrayToMap(
('[|]|alias|bg|bind|break|builtin|'+ // TODO
'cd|command|compgen|complete|continue|'+ ('echo|exit|eval|source|[|]|test|'+
'dirs|disown|echo|enable|eval|exec|'+ 'true|false|read'
'exit|fc|fg|getopts|hash|help|history|'+
'jobs|kill|let|logout|popd|printf|pushd|'+
'pwd|return|set|shift|shopt|source|'+
'suspend|test|times|trap|type|ulimit|'+
'umask|unalias|wait'
).split('|') ).split('|')
); );

View file

@ -202,9 +202,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -212,9 +209,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -364,7 +358,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
@ -1367,7 +1361,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1375,11 +1369,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -1399,10 +1393,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -1414,8 +1409,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -1426,10 +1420,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1438,20 +1433,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1460,20 +1457,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -1482,17 +1481,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -1543,7 +1542,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1571,9 +1569,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -1581,6 +1580,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -1596,7 +1596,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -1605,24 +1606,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -1660,18 +1644,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -1680,24 +1657,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1775,24 +1745,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -124,9 +124,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -134,9 +131,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -286,7 +280,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #000000;\ border-bottom: 1px solid #000000;\
}\ }\
\ \
.ace-clouds .ace_marker-layer .ace_selection {\ .ace-clouds .ace_marker-layer .ace_selection {\
background: #BDD5FC;\ background: #BDD5FC;\
}\ }\
\ \
.ace-clouds.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #FFFFFF;\
border-radius: 2px;\
}\
\
.ace-clouds .ace_marker-layer .ace_step {\ .ace-clouds .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-clouds .ace_marker-layer .ace_selected_word {\ .ace-clouds .ace_marker-layer .ace_selected_word {\
border: 1px solid #BDD5FC;\ border: 1px solid #BDD5FC;\
}\ }\
\ \
.ace-clouds .ace_invisible {\ .ace-clouds .ace_invisible {\
color: #BFBFBF;\ color: #BFBFBF;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #7DA5DC;\ border-bottom: 1px solid #7DA5DC;\
}\ }\
\ \
.ace-clouds-midnight .ace_marker-layer .ace_selection {\ .ace-clouds-midnight .ace_marker-layer .ace_selection {\
background: #000000;\ background: #000000;\
}\ }\
\ \
.ace-clouds-midnight.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #191919;\
border-radius: 2px;\
}\
\
.ace-clouds-midnight .ace_marker-layer .ace_step {\ .ace-clouds-midnight .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-clouds-midnight .ace_marker-layer .ace_selected_word {\ .ace-clouds-midnight .ace_marker-layer .ace_selected_word {\
border: 1px solid #000000;\ border: 1px solid #000000;\
}\ }\
\ \
.ace-clouds-midnight .ace_invisible {\ .ace-clouds-midnight .ace_invisible {\
color: #BFBFBF;\ color: #BFBFBF;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #FFFFFF;\ border-bottom: 1px solid #FFFFFF;\
}\ }\
\ \
.ace-cobalt .ace_marker-layer .ace_selection {\ .ace-cobalt .ace_marker-layer .ace_selection {\
background: rgba(179, 101, 57, 0.75);\ background: rgba(179, 101, 57, 0.75);\
}\ }\
\ \
.ace-cobalt.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #002240;\
border-radius: 2px;\
}\
\
.ace-cobalt .ace_marker-layer .ace_step {\ .ace-cobalt .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-cobalt .ace_marker-layer .ace_selected_word {\ .ace-cobalt .ace_marker-layer .ace_selected_word {\
border: 1px solid rgba(179, 101, 57, 0.75);\ border: 1px solid rgba(179, 101, 57, 0.75);\
}\ }\
\ \
.ace-cobalt .ace_invisible {\ .ace-cobalt .ace_invisible {\
color: rgba(255, 255, 255, 0.15);\ color: rgba(255, 255, 255, 0.15);\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:#FF628C;\ color:#FF628C;\
}\ }\
\ \
.ace-cobalt .ace_constant.ace_character, {\
color:#FF628C;\
}\
\
.ace-cobalt .ace_constant.ace_character.ace_escape, {\
color:#FF628C;\
}\
\
.ace-cobalt .ace_invalid {\ .ace-cobalt .ace_invalid {\
color:#F8F8F8;\ color:#F8F8F8;\
background-color:#800F00;\ background-color:#800F00;\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #000000;\ border-bottom: 1px solid #000000;\
}\ }\
\ \
.ace-dawn .ace_marker-layer .ace_selection {\ .ace-dawn .ace_marker-layer .ace_selection {\
background: rgba(39, 95, 255, 0.30);\ background: rgba(39, 95, 255, 0.30);\
}\ }\
\ \
.ace-dawn.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #F9F9F9;\
border-radius: 2px;\
}\
\
.ace-dawn .ace_marker-layer .ace_step {\ .ace-dawn .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-dawn .ace_marker-layer .ace_selected_word {\ .ace-dawn .ace_marker-layer .ace_selected_word {\
border: 1px solid rgba(39, 95, 255, 0.30);\ border: 1px solid rgba(39, 95, 255, 0.30);\
}\ }\
\ \
.ace-dawn .ace_invisible {\ .ace-dawn .ace_invisible {\
color: rgba(75, 75, 126, 0.50);\ color: rgba(75, 75, 126, 0.50);\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:#811F24;\ color:#811F24;\
}\ }\
\ \
.ace-dawn .ace_constant.ace_character, {\
color:#811F24;\
}\
\
.ace-dawn .ace_constant.ace_character.ace_escape, {\
color:#811F24;\
}\
\
.ace-dawn .ace_invalid.ace_illegal {\ .ace-dawn .ace_invalid.ace_illegal {\
text-decoration:underline;\ text-decoration:underline;\
font-style:italic;\ font-style:italic;\

View file

@ -67,7 +67,7 @@ exports.cssText = ".ace-eclipse .ace_editor {\
}\ }\
\ \
.ace-eclipse .ace_cursor {\ .ace-eclipse .ace_cursor {\
border-left: 2px solid black;\ border-left: 1px solid black;\
}\ }\
\ \
.ace-eclipse .ace_line .ace_storage,\ .ace-eclipse .ace_line .ace_storage,\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #91FF00;\ border-bottom: 1px solid #91FF00;\
}\ }\
\ \
.ace-idle-fingers .ace_marker-layer .ace_selection {\ .ace-idle-fingers .ace_marker-layer .ace_selection {\
background: rgba(90, 100, 126, 0.88);\ background: rgba(90, 100, 126, 0.88);\
}\ }\
\ \
.ace-idle-fingers.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #323232;\
border-radius: 2px;\
}\
\
.ace-idle-fingers .ace_marker-layer .ace_step {\ .ace-idle-fingers .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-idle-fingers .ace_marker-layer .ace_selected_word {\ .ace-idle-fingers .ace_marker-layer .ace_selected_word {\
border: 1px solid rgba(90, 100, 126, 0.88);\ border: 1px solid rgba(90, 100, 126, 0.88);\
}\ }\
\ \
.ace-idle-fingers .ace_invisible {\ .ace-idle-fingers .ace_invisible {\
color: #404040;\ color: #404040;\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:#6C99BB;\ color:#6C99BB;\
}\ }\
\ \
.ace-idle-fingers .ace_constant.ace_character, {\
color:#6C99BB;\
}\
\
.ace-idle-fingers .ace_constant.ace_character.ace_escape, {\
color:#6C99BB;\
}\
\
.ace-idle-fingers .ace_invalid {\ .ace-idle-fingers .ace_invalid {\
color:#FFFFFF;\ color:#FFFFFF;\
background-color:#FF0000;\ background-color:#FF0000;\
@ -171,7 +158,7 @@ color:#BC9458;\
\ \
.ace-idle-fingers .ace_collab.ace_user1 {\ .ace-idle-fingers .ace_collab.ace_user1 {\
color:#323232;\ color:#323232;\
background-color:#FFF980;\ background-color:#FFF980; \
}"; }";
var dom = require("../lib/dom"); var dom = require("../lib/dom");

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #FF9900;\ border-bottom: 1px solid #FF9900;\
}\ }\
\ \
.ace-kr-theme .ace_marker-layer .ace_selection {\ .ace-kr-theme .ace_marker-layer .ace_selection {\
background: rgba(170, 0, 255, 0.45);\ background: rgba(170, 0, 255, 0.45);\
}\ }\
\ \
.ace-kr-theme.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #0B0A09;\
border-radius: 2px;\
}\
\
.ace-kr-theme .ace_marker-layer .ace_step {\ .ace-kr-theme .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-kr-theme .ace_marker-layer .ace_selected_word {\ .ace-kr-theme .ace_marker-layer .ace_selected_word {\
border: 1px solid rgba(170, 0, 255, 0.45);\ border: 1px solid rgba(170, 0, 255, 0.45);\
}\ }\
\ \
.ace-kr-theme .ace_invisible {\ .ace-kr-theme .ace_invisible {\
color: rgba(255, 177, 111, 0.32);\ color: rgba(255, 177, 111, 0.32);\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:rgba(210, 117, 24, 0.76);\ color:rgba(210, 117, 24, 0.76);\
}\ }\
\ \
.ace-kr-theme .ace_constant.ace_character, {\
color:rgba(210, 117, 24, 0.76);\
}\
\
.ace-kr-theme .ace_constant.ace_character.ace_escape, {\
color:rgba(210, 117, 24, 0.76);\
}\
\
.ace-kr-theme .ace_invalid {\ .ace-kr-theme .ace_invalid {\
color:#F8F8F8;\ color:#F8F8F8;\
background-color:#A41300;\ background-color:#A41300;\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #FFFFFF;\ border-bottom: 1px solid #FFFFFF;\
}\ }\
\ \
.ace-merbivore .ace_marker-layer .ace_selection {\ .ace-merbivore .ace_marker-layer .ace_selection {\
background: #454545;\ background: #454545;\
}\ }\
\ \
.ace-merbivore.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #161616;\
border-radius: 2px;\
}\
\
.ace-merbivore .ace_marker-layer .ace_step {\ .ace-merbivore .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-merbivore .ace_marker-layer .ace_selected_word {\ .ace-merbivore .ace_marker-layer .ace_selected_word {\
border: 1px solid #454545;\ border: 1px solid #454545;\
}\ }\
\ \
.ace-merbivore .ace_invisible {\ .ace-merbivore .ace_invisible {\
color: #404040;\ color: #404040;\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:#1EDAFB;\ color:#1EDAFB;\
}\ }\
\ \
.ace-merbivore .ace_constant.ace_character, {\
color:#1EDAFB;\
}\
\
.ace-merbivore .ace_constant.ace_character.ace_escape, {\
color:#1EDAFB;\
}\
\
.ace-merbivore .ace_constant.ace_language {\ .ace-merbivore .ace_constant.ace_language {\
color:#FDC251;\ color:#FDC251;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #FFFFFF;\ border-bottom: 1px solid #FFFFFF;\
}\ }\
\ \
.ace-merbivore-soft .ace_marker-layer .ace_selection {\ .ace-merbivore-soft .ace_marker-layer .ace_selection {\
background: #494949;\ background: #494949;\
}\ }\
\ \
.ace-merbivore-soft.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #1C1C1C;\
border-radius: 2px;\
}\
\
.ace-merbivore-soft .ace_marker-layer .ace_step {\ .ace-merbivore-soft .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-merbivore-soft .ace_marker-layer .ace_selected_word {\ .ace-merbivore-soft .ace_marker-layer .ace_selected_word {\
border: 1px solid #494949;\ border: 1px solid #494949;\
}\ }\
\ \
.ace-merbivore-soft .ace_invisible {\ .ace-merbivore-soft .ace_invisible {\
color: #404040;\ color: #404040;\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:#68C1D8;\ color:#68C1D8;\
}\ }\
\ \
.ace-merbivore-soft .ace_constant.ace_character, {\
color:#68C1D8;\
}\
\
.ace-merbivore-soft .ace_constant.ace_character.ace_escape, {\
color:#68C1D8;\
}\
\
.ace-merbivore-soft .ace_constant.ace_language {\ .ace-merbivore-soft .ace_constant.ace_language {\
color:#E1C582;\ color:#E1C582;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #FFFFFF;\ border-bottom: 1px solid #FFFFFF;\
}\ }\
\ \
.ace-mono-industrial .ace_marker-layer .ace_selection {\ .ace-mono-industrial .ace_marker-layer .ace_selection {\
background: rgba(145, 153, 148, 0.40);\ background: rgba(145, 153, 148, 0.40);\
}\ }\
\ \
.ace-mono-industrial.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #222C28;\
border-radius: 2px;\
}\
\
.ace-mono-industrial .ace_marker-layer .ace_step {\ .ace-mono-industrial .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-mono-industrial .ace_marker-layer .ace_selected_word {\ .ace-mono-industrial .ace_marker-layer .ace_selected_word {\
border: 1px solid rgba(145, 153, 148, 0.40);\ border: 1px solid rgba(145, 153, 148, 0.40);\
}\ }\
\ \
.ace-mono-industrial .ace_invisible {\ .ace-mono-industrial .ace_invisible {\
color: rgba(102, 108, 104, 0.50);\ color: rgba(102, 108, 104, 0.50);\
}\ }\
@ -118,14 +113,6 @@ exports.cssText = "\
color:#E98800;\ color:#E98800;\
}\ }\
\ \
.ace-mono-industrial .ace_constant.ace_character, {\
color:#E98800;\
}\
\
.ace-mono-industrial .ace_constant.ace_character.ace_escape, {\
color:#E98800;\
}\
\
.ace-mono-industrial .ace_constant.ace_numeric {\ .ace-mono-industrial .ace_constant.ace_numeric {\
color:#E98800;\ color:#E98800;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #F8F8F0;\ border-bottom: 1px solid #F8F8F0;\
}\ }\
\ \
.ace-monokai .ace_marker-layer .ace_selection {\ .ace-monokai .ace_marker-layer .ace_selection {\
background: #49483E;\ background: #49483E;\
}\ }\
\ \
.ace-monokai.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #272822;\
border-radius: 2px;\
}\
\
.ace-monokai .ace_marker-layer .ace_step {\ .ace-monokai .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-monokai .ace_marker-layer .ace_selected_word {\ .ace-monokai .ace_marker-layer .ace_selected_word {\
border: 1px solid #49483E;\ border: 1px solid #49483E;\
}\ }\
\ \
.ace-monokai .ace_invisible {\ .ace-monokai .ace_invisible {\
color: #49483E;\ color: #49483E;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #A7A7A7;\ border-bottom: 1px solid #A7A7A7;\
}\ }\
\ \
.ace-pastel-on-dark .ace_marker-layer .ace_selection {\ .ace-pastel-on-dark .ace_marker-layer .ace_selection {\
background: rgba(221, 240, 255, 0.20);\ background: rgba(221, 240, 255, 0.20);\
}\ }\
\ \
.ace-pastel-on-dark.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #2C2828;\
border-radius: 2px;\
}\
\
.ace-pastel-on-dark .ace_marker-layer .ace_step {\ .ace-pastel-on-dark .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-pastel-on-dark .ace_marker-layer .ace_selected_word {\ .ace-pastel-on-dark .ace_marker-layer .ace_selected_word {\
border: 1px solid rgba(221, 240, 255, 0.20);\ border: 1px solid rgba(221, 240, 255, 0.20);\
}\ }\
\ \
.ace-pastel-on-dark .ace_invisible {\ .ace-pastel-on-dark .ace_invisible {\
color: rgba(255, 255, 255, 0.25);\ color: rgba(255, 255, 255, 0.25);\
}\ }\
@ -118,14 +113,6 @@ exports.cssText = "\
color:#4FB7C5;\ color:#4FB7C5;\
}\ }\
\ \
.ace-pastel-on-dark .ace_constant.ace_character, {\
color:#4FB7C5;\
}\
\
.ace-pastel-on-dark .ace_constant.ace_character.ace_escape, {\
color:#4FB7C5;\
}\
\
.ace-pastel-on-dark .ace_constant.ace_language {\ .ace-pastel-on-dark .ace_constant.ace_language {\
color:#DE8E30;\ color:#DE8E30;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #D30102;\ border-bottom: 1px solid #D30102;\
}\ }\
\ \
.ace-solarized-dark .ace_marker-layer .ace_selection {\ .ace-solarized-dark .ace_marker-layer .ace_selection {\
background: #073642;\ background: #073642;\
}\ }\
\ \
.ace-solarized-dark.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #002B36;\
border-radius: 2px;\
}\
\
.ace-solarized-dark .ace_marker-layer .ace_step {\ .ace-solarized-dark .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-solarized-dark .ace_marker-layer .ace_selected_word {\ .ace-solarized-dark .ace_marker-layer .ace_selected_word {\
border: 1px solid #073642;\ border: 1px solid #073642;\
}\ }\
\ \
.ace-solarized-dark .ace_invisible {\ .ace-solarized-dark .ace_invisible {\
color: rgba(147, 161, 161, 0.50);\ color: rgba(147, 161, 161, 0.50);\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #000000;\ border-bottom: 1px solid #000000;\
}\ }\
\ \
.ace-solarized-light .ace_marker-layer .ace_selection {\ .ace-solarized-light .ace_marker-layer .ace_selection {\
background: #073642;\ background: #073642;\
}\ }\
\ \
.ace-solarized-light.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #FDF6E3;\
border-radius: 2px;\
}\
\
.ace-solarized-light .ace_marker-layer .ace_step {\ .ace-solarized-light .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-solarized-light .ace_marker-layer .ace_selected_word {\ .ace-solarized-light .ace_marker-layer .ace_selected_word {\
border: 1px solid #073642;\ border: 1px solid #073642;\
}\ }\
\ \
.ace-solarized-light .ace_invisible {\ .ace-solarized-light .ace_invisible {\
color: rgba(147, 161, 161, 0.50);\ color: rgba(147, 161, 161, 0.50);\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #AEAFAD;\ border-bottom: 1px solid #AEAFAD;\
}\ }\
\ \
.ace-tomorrow .ace_marker-layer .ace_selection {\ .ace-tomorrow .ace_marker-layer .ace_selection {\
background: #D6D6D6;\ background: #D6D6D6;\
}\ }\
\ \
.ace-tomorrow.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #FFFFFF;\
border-radius: 2px;\
}\
\
.ace-tomorrow .ace_marker-layer .ace_step {\ .ace-tomorrow .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-tomorrow .ace_marker-layer .ace_selected_word {\ .ace-tomorrow .ace_marker-layer .ace_selected_word {\
border: 1px solid #D6D6D6;\ border: 1px solid #D6D6D6;\
}\ }\
\ \
.ace-tomorrow .ace_invisible {\ .ace-tomorrow .ace_invisible {\
color: #D1D1D1;\ color: #D1D1D1;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #AEAFAD;\ border-bottom: 1px solid #AEAFAD;\
}\ }\
\ \
.ace-tomorrow-night .ace_marker-layer .ace_selection {\ .ace-tomorrow-night .ace_marker-layer .ace_selection {\
background: #373B41;\ background: #373B41;\
}\ }\
\ \
.ace-tomorrow-night.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #1D1F21;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night .ace_marker-layer .ace_step {\ .ace-tomorrow-night .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-tomorrow-night .ace_marker-layer .ace_selected_word {\ .ace-tomorrow-night .ace_marker-layer .ace_selected_word {\
border: 1px solid #373B41;\ border: 1px solid #373B41;\
}\ }\
\ \
.ace-tomorrow-night .ace_invisible {\ .ace-tomorrow-night .ace_invisible {\
color: #4B4E55;\ color: #4B4E55;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #FFFFFF;\ border-bottom: 1px solid #FFFFFF;\
}\ }\
\ \
.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\ .ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\
background: #003F8E;\ background: #003F8E;\
}\ }\
\ \
.ace-tomorrow-night-blue.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #002451;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\ .ace-tomorrow-night-blue .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {\ .ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {\
border: 1px solid #003F8E;\ border: 1px solid #003F8E;\
}\ }\
\ \
.ace-tomorrow-night-blue .ace_invisible {\ .ace-tomorrow-night-blue .ace_invisible {\
color: #404F7D;\ color: #404F7D;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #9F9F9F;\ border-bottom: 1px solid #9F9F9F;\
}\ }\
\ \
.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {\ .ace-tomorrow-night-bright .ace_marker-layer .ace_selection {\
background: #424242;\ background: #424242;\
}\ }\
\ \
.ace-tomorrow-night-bright.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #000000;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\ .ace-tomorrow-night-bright .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word {\ .ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word {\
border: 1px solid #424242;\ border: 1px solid #424242;\
}\ }\
\ \
.ace-tomorrow-night-bright .ace_invisible {\ .ace-tomorrow-night-bright .ace_invisible {\
color: #343434;\ color: #343434;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #CCCCCC;\ border-bottom: 1px solid #CCCCCC;\
}\ }\
\ \
.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {\ .ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {\
background: #515151;\ background: #515151;\
}\ }\
\ \
.ace-tomorrow-night-eighties.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #2D2D2D;\
border-radius: 2px;\
}\
\
.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\ .ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected_word {\ .ace-tomorrow-night-eighties .ace_marker-layer .ace_selected_word {\
border: 1px solid #515151;\ border: 1px solid #515151;\
}\ }\
\ \
.ace-tomorrow-night-eighties .ace_invisible {\ .ace-tomorrow-night-eighties .ace_invisible {\
color: #6A6A6A;\ color: #6A6A6A;\
}\ }\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #A7A7A7;\ border-bottom: 1px solid #A7A7A7;\
}\ }\
\ \
.ace-twilight .ace_marker-layer .ace_selection {\ .ace-twilight .ace_marker-layer .ace_selection {\
background: rgba(221, 240, 255, 0.20);\ background: rgba(221, 240, 255, 0.20);\
}\ }\
\ \
.ace-twilight.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #141414;\
border-radius: 2px;\
}\
\
.ace-twilight .ace_marker-layer .ace_step {\ .ace-twilight .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-twilight .ace_marker-layer .ace_selected_word {\ .ace-twilight .ace_marker-layer .ace_selected_word {\
border: 1px solid rgba(221, 240, 255, 0.20);\ border: 1px solid rgba(221, 240, 255, 0.20);\
}\ }\
\ \
.ace-twilight .ace_invisible {\ .ace-twilight .ace_invisible {\
color: rgba(255, 255, 255, 0.25);\ color: rgba(255, 255, 255, 0.25);\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:#CF6A4C;\ color:#CF6A4C;\
}\ }\
\ \
.ace-twilight .ace_constant.ace_character, {\
color:#CF6A4C;\
}\
\
.ace-twilight .ace_constant.ace_character.ace_escape, {\
color:#CF6A4C;\
}\
\
.ace-twilight .ace_invalid.ace_illegal {\ .ace-twilight .ace_invalid.ace_illegal {\
color:#F8F8F8;\ color:#F8F8F8;\
background-color:rgba(86, 45, 86, 0.75);\ background-color:rgba(86, 45, 86, 0.75);\

View file

@ -75,16 +75,11 @@ exports.cssText = "\
border-left: 0px;\ border-left: 0px;\
border-bottom: 1px solid #FFFFFF;\ border-bottom: 1px solid #FFFFFF;\
}\ }\
\ \
.ace-vibrant-ink .ace_marker-layer .ace_selection {\ .ace-vibrant-ink .ace_marker-layer .ace_selection {\
background: #6699CC;\ background: #6699CC;\
}\ }\
\ \
.ace-vibrant-ink.multiselect .ace_selection.start {\
box-shadow: 0 0 3px 0px #0F0F0F;\
border-radius: 2px;\
}\
\
.ace-vibrant-ink .ace_marker-layer .ace_step {\ .ace-vibrant-ink .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\ background: rgb(198, 219, 174);\
}\ }\
@ -101,7 +96,7 @@ exports.cssText = "\
.ace-vibrant-ink .ace_marker-layer .ace_selected_word {\ .ace-vibrant-ink .ace_marker-layer .ace_selected_word {\
border: 1px solid #6699CC;\ border: 1px solid #6699CC;\
}\ }\
\ \
.ace-vibrant-ink .ace_invisible {\ .ace-vibrant-ink .ace_invisible {\
color: #404040;\ color: #404040;\
}\ }\
@ -114,14 +109,6 @@ exports.cssText = "\
color:#339999;\ color:#339999;\
}\ }\
\ \
.ace-vibrant-ink .ace_constant.ace_character, {\
color:#339999;\
}\
\
.ace-vibrant-ink .ace_constant.ace_character.ace_escape, {\
color:#339999;\
}\
\
.ace-vibrant-ink .ace_constant.ace_numeric {\ .ace-vibrant-ink .ace_constant.ace_numeric {\
color:#99CC99;\ color:#99CC99;\
}\ }\

View file

@ -2096,7 +2096,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
}; };
(function() { (function() {
this.isEqual = function(range) { this.isEequal = function(range) {
return this.start.row == range.start.row && return this.start.row == range.start.row &&
this.end.row == range.end.row && this.end.row == range.end.row &&
this.start.column == range.start.column && this.start.column == range.start.column &&
@ -2162,11 +2162,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
} }
this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
this.isEnd = function(row, column) { this.isEnd = function(row, column) {
return this.end.row == row && this.end.column == column; return this.end.row == row && this.end.column == column;
} }
@ -2326,21 +2321,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return Range.fromPoints(start || this.start, end || this.end); return Range.fromPoints(start || this.start, end || this.end);
}; };
this.fixOrientation = function() {
if (
this.start.row < this.end.row
|| (this.start.row == this.end.row && this.start.column < this.end.column)
) {
return false;
}
var temp = this.start;
this.end = this.start;
this.start = temp;
return true;
};
this.isEmpty = function() { this.isEmpty = function() {
return (this.start.row == this.end.row && this.start.column == this.end.column); return (this.start.row == this.end.row && this.start.column == this.end.column);
}; };

View file

@ -2070,7 +2070,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
}; };
(function() { (function() {
this.isEqual = function(range) { this.isEequal = function(range) {
return this.start.row == range.start.row && return this.start.row == range.start.row &&
this.end.row == range.end.row && this.end.row == range.end.row &&
this.start.column == range.start.column && this.start.column == range.start.column &&
@ -2136,11 +2136,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
} }
this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
this.isEnd = function(row, column) { this.isEnd = function(row, column) {
return this.end.row == row && this.end.column == column; return this.end.row == row && this.end.column == column;
} }
@ -2300,21 +2295,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return Range.fromPoints(start || this.start, end || this.end); return Range.fromPoints(start || this.start, end || this.end);
}; };
this.fixOrientation = function() {
if (
this.start.row < this.end.row
|| (this.start.row == this.end.row && this.start.column < this.end.column)
) {
return false;
}
var temp = this.start;
this.end = this.start;
this.start = temp;
return true;
};
this.isEmpty = function() { this.isEmpty = function() {
return (this.start.row == this.end.row && this.start.column == this.end.column); return (this.start.row == this.end.row && this.start.column == this.end.column);
}; };

View file

@ -2092,7 +2092,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
}; };
(function() { (function() {
this.isEqual = function(range) { this.isEequal = function(range) {
return this.start.row == range.start.row && return this.start.row == range.start.row &&
this.end.row == range.end.row && this.end.row == range.end.row &&
this.start.column == range.start.column && this.start.column == range.start.column &&
@ -2158,11 +2158,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
} }
this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
this.isEnd = function(row, column) { this.isEnd = function(row, column) {
return this.end.row == row && this.end.column == column; return this.end.row == row && this.end.column == column;
} }
@ -2322,21 +2317,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return Range.fromPoints(start || this.start, end || this.end); return Range.fromPoints(start || this.start, end || this.end);
}; };
this.fixOrientation = function() {
if (
this.start.row < this.end.row
|| (this.start.row == this.end.row && this.start.column < this.end.column)
) {
return false;
}
var temp = this.start;
this.end = this.start;
this.start = temp;
return true;
};
this.isEmpty = function() { this.isEmpty = function() {
return (this.start.row == this.end.row && this.start.column == this.end.column); return (this.start.row == this.end.row && this.start.column == this.end.column);
}; };
@ -9969,7 +9949,7 @@ var strictKeywords = {
"implements": true, "implements": true,
"interface": true, "interface": true,
"let": true, "let": true,
//"module": true, "module": true,
"package": true, "package": true,
"private": true, "private": true,
"protected": true, "protected": true,

View file

@ -2107,7 +2107,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
}; };
(function() { (function() {
this.isEqual = function(range) { this.isEequal = function(range) {
return this.start.row == range.start.row && return this.start.row == range.start.row &&
this.end.row == range.end.row && this.end.row == range.end.row &&
this.start.column == range.start.column && this.start.column == range.start.column &&
@ -2173,11 +2173,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
} }
this.intersects = function(range) {
var cmp = this.compareRange(range);
return (cmp == -1 || cmp == 0 || cmp == 1);
}
this.isEnd = function(row, column) { this.isEnd = function(row, column) {
return this.end.row == row && this.end.column == column; return this.end.row == row && this.end.column == column;
} }
@ -2337,21 +2332,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
return Range.fromPoints(start || this.start, end || this.end); return Range.fromPoints(start || this.start, end || this.end);
}; };
this.fixOrientation = function() {
if (
this.start.row < this.end.row
|| (this.start.row == this.end.row && this.start.column < this.end.column)
) {
return false;
}
var temp = this.start;
this.end = this.start;
this.start = temp;
return true;
};
this.isEmpty = function() { this.isEmpty = function() {
return (this.start.row == this.end.row && this.start.column == this.end.column); return (this.start.row == this.end.row && this.start.column == this.end.column);
}; };

View file

@ -7,13 +7,13 @@
<title>Ace Kitchen Sink</title> <title>Ace Kitchen Sink</title>
<meta name="author" content="Fabian Jakobs"> <meta name="author" content="Fabian Jakobs">
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8"> <link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
<!-- <!--
Ace Ace
version 0.2.0 version 0.2.0
commit 8584581a329ae949529d42717daf5a65ab401d3a commit cbd29bc541998e7c2bee817d048aead94760f557
--> -->
</head> </head>
<body> <body>
@ -133,13 +133,6 @@
<input type="checkbox" name="show_hscroll" id="show_hscroll"> <input type="checkbox" name="show_hscroll" id="show_hscroll">
</td> </td>
</tr> </tr>
<tr>
<td >
<label for="animate_scroll">Animate scrolling</label>
</td><td>
<input type="checkbox" name="animate_scroll" id="animate_scroll">
</td>
</tr>
<tr> <tr>
<td > <td >
<label for="keybinding">Key Binding</label> <label for="keybinding">Key Binding</label>
@ -218,7 +211,7 @@
<script src="demo/kitchen-sink/require.js" data-main="demo/kitchen-sink/demo" type="text/javascript"></script> <script src="demo/kitchen-sink/require.js" data-main="demo/kitchen-sink/demo" type="text/javascript"></script>
--> -->
<script src="demo/kitchen-sink/kitchen-sink-uncompressed.js" data-ace-suffix="-uncompressed.js" data-ace-base="demo/kitchen-sink" type="text/javascript" charset="utf-8"></script> <script src="demo/kitchen-sink/kitchen-sink-uncompressed.js" data-ace-suffix="-uncompressed.js" data-ace-base="demo/kitchen-sink" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -204,7 +204,7 @@ var c_cppHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -303,7 +303,7 @@ var c_cppHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(c_cppHighlightRules, TextHighlightRules); oop.inherits(c_cppHighlightRules, TextHighlightRules);
@ -381,24 +381,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -204,7 +204,7 @@ var c_cppHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -303,7 +303,7 @@ var c_cppHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(c_cppHighlightRules, TextHighlightRules); oop.inherits(c_cppHighlightRules, TextHighlightRules);
@ -381,24 +381,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -195,9 +195,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -205,9 +202,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -357,7 +351,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
@ -1360,7 +1354,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1368,11 +1362,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -1392,10 +1386,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -1407,8 +1402,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -1419,10 +1413,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1431,20 +1426,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1453,20 +1450,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -1475,17 +1474,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -1536,7 +1535,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1564,9 +1562,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -1574,6 +1573,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -1589,7 +1589,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -1598,24 +1599,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -1653,18 +1637,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -1673,24 +1650,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1768,24 +1738,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -2122,7 +2095,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -2130,7 +2127,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -2148,8 +2165,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -2157,7 +2172,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -2165,7 +2180,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -2175,12 +2190,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {

View file

@ -195,9 +195,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -205,9 +202,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -357,7 +351,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
@ -1360,7 +1354,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1368,11 +1362,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -1392,10 +1386,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -1407,8 +1402,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -1419,10 +1413,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1431,20 +1426,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -1453,20 +1450,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -1475,17 +1474,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -1536,7 +1535,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1564,9 +1562,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -1574,6 +1573,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -1589,7 +1589,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -1598,24 +1599,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -1653,18 +1637,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -1673,24 +1650,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1768,24 +1738,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -2122,7 +2095,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -2130,7 +2127,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -2148,8 +2165,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -2157,7 +2172,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -2165,7 +2180,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -2175,12 +2190,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -155,7 +155,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -163,7 +187,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -181,8 +225,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -190,7 +232,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -198,7 +240,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -208,12 +250,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {

View file

@ -155,7 +155,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -163,7 +187,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -181,8 +225,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -190,7 +232,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -198,7 +240,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -208,12 +250,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -304,7 +304,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -312,11 +312,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -336,10 +336,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -351,8 +352,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -363,10 +363,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -375,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -397,20 +400,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -419,17 +424,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -480,7 +485,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -508,9 +512,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -518,6 +523,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -533,7 +539,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -542,24 +549,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -597,18 +587,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -617,24 +600,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -712,24 +688,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1312,7 +1291,7 @@ var GroovyHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1382,7 +1361,7 @@ var GroovyHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(GroovyHighlightRules, TextHighlightRules); oop.inherits(GroovyHighlightRules, TextHighlightRules);

View file

@ -304,7 +304,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -312,11 +312,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -336,10 +336,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -351,8 +352,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -363,10 +363,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -375,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -397,20 +400,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -419,17 +424,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -480,7 +485,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -508,9 +512,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -518,6 +523,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -533,7 +539,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -542,24 +549,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -597,18 +587,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -617,24 +600,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -712,24 +688,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1312,7 +1291,7 @@ var GroovyHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1382,7 +1361,7 @@ var GroovyHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(GroovyHighlightRules, TextHighlightRules); oop.inherits(GroovyHighlightRules, TextHighlightRules);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -84,7 +84,7 @@ var HaxeHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
regex : "\\/\\*", regex : "\\/\\*",
@ -153,7 +153,7 @@ var HaxeHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(HaxeHighlightRules, TextHighlightRules); oop.inherits(HaxeHighlightRules, TextHighlightRules);
@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -84,7 +84,7 @@ var HaxeHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
regex : "\\/\\*", regex : "\\/\\*",
@ -153,7 +153,7 @@ var HaxeHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(HaxeHighlightRules, TextHighlightRules); oop.inherits(HaxeHighlightRules, TextHighlightRules);
@ -231,24 +231,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -363,7 +363,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -371,11 +371,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -395,10 +395,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -410,8 +411,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -422,10 +422,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -434,20 +435,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -456,20 +459,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -478,17 +483,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -539,7 +544,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -567,9 +571,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -577,6 +582,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -592,7 +598,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -601,24 +608,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -656,18 +646,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -676,24 +659,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -771,24 +747,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1462,7 +1441,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -1470,7 +1473,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -1488,8 +1511,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -1497,7 +1518,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -1505,7 +1526,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -1515,12 +1536,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -1721,9 +1736,6 @@ var HtmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*script\\b)", regex : "<(?=\s*script\\b)",
@ -1739,9 +1751,6 @@ var HtmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -1911,7 +1920,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",

View file

@ -363,7 +363,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -371,11 +371,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -395,10 +395,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -410,8 +411,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -422,10 +422,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -434,20 +435,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -456,20 +459,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -478,17 +483,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -539,7 +544,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -567,9 +571,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -577,6 +582,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -592,7 +598,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -601,24 +608,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -656,18 +646,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -676,24 +659,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -771,24 +747,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1462,7 +1441,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -1470,7 +1473,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -1488,8 +1511,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -1497,7 +1518,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -1505,7 +1526,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -1515,12 +1536,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -1721,9 +1736,6 @@ var HtmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*script\\b)", regex : "<(?=\s*script\\b)",
@ -1739,9 +1751,6 @@ var HtmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -1911,7 +1920,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -420,17 +425,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1314,7 +1293,7 @@ var JavaHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1384,7 +1363,7 @@ var JavaHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaHighlightRules, TextHighlightRules); oop.inherits(JavaHighlightRules, TextHighlightRules);

View file

@ -305,7 +305,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -313,11 +313,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -337,10 +337,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -352,8 +353,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -364,10 +364,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -376,20 +377,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -398,20 +401,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -420,17 +425,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -481,7 +486,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -509,9 +513,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -519,6 +524,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -534,7 +540,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -543,24 +550,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -598,18 +588,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -618,24 +601,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -713,24 +689,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1314,7 +1293,7 @@ var JavaHighlightRules = function() {
token : "comment", token : "comment",
regex : "\\/\\/.*$" regex : "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -1384,7 +1363,7 @@ var JavaHighlightRules = function() {
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaHighlightRules, TextHighlightRules); oop.inherits(JavaHighlightRules, TextHighlightRules);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -280,7 +280,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -288,11 +288,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -312,10 +312,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -327,8 +328,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -339,10 +339,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -351,20 +352,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -373,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -395,17 +400,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -456,7 +461,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -484,9 +488,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -494,6 +499,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -509,7 +515,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -518,24 +525,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -573,18 +563,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -593,24 +576,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -688,24 +664,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

View file

@ -280,7 +280,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -288,11 +288,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -312,10 +312,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -327,8 +328,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -339,10 +339,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -351,20 +352,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -373,20 +376,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -395,17 +400,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -456,7 +461,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -484,9 +488,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -494,6 +499,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -509,7 +515,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -518,24 +525,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -573,18 +563,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -593,24 +576,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -688,24 +664,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,654 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* John Roepke <john AT justjohn DOT us>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
ace.define('ace/mode/less', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/less_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/cstyle'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
this.$tokenizer = new Tokenizer(new LessHighlightRules().getRules(), "i");
this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
// ignore braces in comments
var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent;
}
var match = line.match(/^.*\{\s*$/);
if (match) {
indent += tab;
}
return indent;
};
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
}).call(Mode.prototype);
exports.Mode = Mode;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* John Roepke <john AT justjohn DOT us>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
ace.define('ace/mode/less_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var LessHighlightRules = function() {
var properties = lang.arrayToMap( (function () {
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
"background-size|binding|border-bottom-colors|border-left-colors|" +
"border-right-colors|border-top-colors|border-end|border-end-color|" +
"border-end-style|border-end-width|border-image|border-start|" +
"border-start-color|border-start-style|border-start-width|box-align|" +
"box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
"box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
"column-rule-width|column-rule-style|column-rule-color|float-edge|" +
"font-feature-settings|font-language-override|force-broken-image-icon|" +
"image-region|margin-end|margin-start|opacity|outline|outline-color|" +
"outline-offset|outline-radius|outline-radius-bottomleft|" +
"outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
"outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
"tab-size|text-blink|text-decoration-color|text-decoration-line|" +
"text-decoration-style|transform|transform-origin|transition|" +
"transition-delay|transition-duration|transition-property|" +
"transition-timing-function|user-focus|user-input|user-modify|user-select|" +
"window-shadow|border-radius").split("|");
var properties = ("azimuth|background-attachment|background-color|background-image|" +
"background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|opacity|orphans|outline-color|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|");
//The return array
var ret = [];
//All prefixProperties will get the browserPrefix in
//the begning by join the prefixProperties array with the value of browserPrefix
for (var i=0, ln=browserPrefix.length; i<ln; i++) {
Array.prototype.push.apply(
ret,
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
);
}
//Add also prefixProperties and properties without any browser prefix
Array.prototype.push.apply(ret, prefixProperties);
Array.prototype.push.apply(ret, properties);
return ret;
})() );
var functions = lang.arrayToMap(
("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|" +
"desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|" +
"alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|" +
"iskeyword|isurl|ispixel|ispercentage|isem").split("|")
);
var constants = lang.arrayToMap(
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
);
var colors = lang.arrayToMap(
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
"purple|red|silver|teal|white|yellow").split("|")
);
var keywords = lang.arrayToMap(
("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|" +
"@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|" +
"def|end|declare|when|not|and").split("|")
);
var tags = lang.arrayToMap(
("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
"big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
"command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
"figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
"header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
"link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
"option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
"small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
"textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
);
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
},
{
token : "comment", // multi line comment
merge : true,
regex : "\\/\\*",
next : "comment"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric",
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
}, {
token : "constant.numeric", // hex6 color
regex : "#[a-f0-9]{6}"
}, {
token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}"
}, {
token : "constant.numeric",
regex : numRe
}, {
token : function(value) {
if (keywords.hasOwnProperty(value))
return "keyword";
else
return "variable";
},
regex : "@[a-z0-9_\\-@]*\\b"
}, {
token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase()))
return "support.type";
else if (keywords.hasOwnProperty(value))
return "keyword";
else if (constants.hasOwnProperty(value))
return "constant.language";
else if (functions.hasOwnProperty(value))
return "support.function";
else if (colors.hasOwnProperty(value.toLowerCase()))
return "support.constant.color";
else if (tags.hasOwnProperty(value.toLowerCase()))
return "variable.language";
else
return "text";
},
regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
}, {
token: "variable.language",
regex: "#[a-z0-9-_]+"
}, {
token: "variable.language",
regex: "\\.[a-z0-9-_]+"
}, {
token: "variable.language",
regex: ":[a-z0-9-_]+"
}, {
token: "constant",
regex: "[a-z0-9-_]+"
}, {
token : "keyword.operator",
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
}, {
token : "paren.lparen",
regex : "[[({]"
}, {
token : "paren.rparen",
regex : "[\\])}]"
}, {
token : "text",
regex : "\\s+"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : ".*?\\*\\/",
next : "start"
}, {
token : "comment", // comment spanning whole line
merge : true,
regex : ".+"
}
]
};
};
oop.inherits(LessHighlightRules, TextHighlightRules);
exports.LessHighlightRules = LessHighlightRules;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function() {};
(function() {
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match) return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column});
if (!openBracePos || openBracePos.row == row) return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent);
};
this.$getIndent = function(line) {
var match = line.match(/^(\s+)/);
if (match) {
return match[1];
}
return "";
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length);
range.end.column -= 2;
return range;
}
if (foldStyle !== "markbeginend")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[2]) {
var range = session.getCommentFoldRange(row, i);
range.end.column -= 2;
return range;
}
var end = {row: row, column: i};
var start = session.$findOpeningBracket(match[1], end);
if (!start)
return;
start.column++;
end.column--;
return Range.fromPoints(start, end);
}
};
}).call(FoldMode.prototype);
});/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
"use strict";
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function() {};
(function() {
this.foldingStartMarker = null;
this.foldingStopMarker = null;
// must return "" if there's no fold, to enable caching
this.getFoldWidget = function(session, foldStyle, row) {
var line = session.getLine(row);
if (this.foldingStartMarker.test(line))
return "start";
if (foldStyle == "markbeginend"
&& this.foldingStopMarker
&& this.foldingStopMarker.test(line))
return "end";
return "";
};
this.getFoldWidgetRange = function(session, foldStyle, row) {
return null;
};
this.indentationBlock = function(session, row, column) {
var re = /^\s*/;
var startRow = row;
var endRow = row;
var line = session.getLine(row);
var startColumn = column || line.length;
var startLevel = line.match(re)[0].length;
var maxRow = session.getLength()
while (++row < maxRow) {
line = session.getLine(row);
var level = line.match(re)[0].length;
if (level == line.length)
continue;
if (level <= startLevel)
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.openingBracketBlock = function(session, bracket, row, column) {
var start = {row: row, column: column + 1};
var end = session.$findClosingBracket(bracket, start);
if (!end)
return;
var fw = session.foldWidgets[end.row];
if (fw == null)
fw = this.getFoldWidget(session, end.row);
if (fw == "start") {
end.row --;
end.column = session.getLine(end.row).length;
}
return Range.fromPoints(start, end);
};
}).call(FoldMode.prototype);
});

View file

@ -1,654 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* John Roepke <john AT justjohn DOT us>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/less', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/less_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/cstyle'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
this.$tokenizer = new Tokenizer(new LessHighlightRules().getRules(), "i");
this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
// ignore braces in comments
var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent;
}
var match = line.match(/^.*\{\s*$/);
if (match) {
indent += tab;
}
return indent;
};
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
}).call(Mode.prototype);
exports.Mode = Mode;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
* John Roepke <john AT justjohn DOT us>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/less_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var LessHighlightRules = function() {
var properties = lang.arrayToMap( (function () {
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
"background-size|binding|border-bottom-colors|border-left-colors|" +
"border-right-colors|border-top-colors|border-end|border-end-color|" +
"border-end-style|border-end-width|border-image|border-start|" +
"border-start-color|border-start-style|border-start-width|box-align|" +
"box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
"box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
"column-rule-width|column-rule-style|column-rule-color|float-edge|" +
"font-feature-settings|font-language-override|force-broken-image-icon|" +
"image-region|margin-end|margin-start|opacity|outline|outline-color|" +
"outline-offset|outline-radius|outline-radius-bottomleft|" +
"outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
"outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
"tab-size|text-blink|text-decoration-color|text-decoration-line|" +
"text-decoration-style|transform|transform-origin|transition|" +
"transition-delay|transition-duration|transition-property|" +
"transition-timing-function|user-focus|user-input|user-modify|user-select|" +
"window-shadow|border-radius").split("|");
var properties = ("azimuth|background-attachment|background-color|background-image|" +
"background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|opacity|orphans|outline-color|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|");
//The return array
var ret = [];
//All prefixProperties will get the browserPrefix in
//the begning by join the prefixProperties array with the value of browserPrefix
for (var i=0, ln=browserPrefix.length; i<ln; i++) {
Array.prototype.push.apply(
ret,
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
);
}
//Add also prefixProperties and properties without any browser prefix
Array.prototype.push.apply(ret, prefixProperties);
Array.prototype.push.apply(ret, properties);
return ret;
})() );
var functions = lang.arrayToMap(
("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|" +
"desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|" +
"alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|" +
"iskeyword|isurl|ispixel|ispercentage|isem").split("|")
);
var constants = lang.arrayToMap(
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
);
var colors = lang.arrayToMap(
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
"purple|red|silver|teal|white|yellow").split("|")
);
var keywords = lang.arrayToMap(
("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|" +
"@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|" +
"def|end|declare|when|not|and").split("|")
);
var tags = lang.arrayToMap(
("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
"big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
"command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
"figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
"header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
"link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
"option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
"small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
"textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
);
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
},
{
token : "comment", // multi line comment
merge : true,
regex : "\\/\\*",
next : "comment"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric",
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
}, {
token : "constant.numeric", // hex6 color
regex : "#[a-f0-9]{6}"
}, {
token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}"
}, {
token : "constant.numeric",
regex : numRe
}, {
token : function(value) {
if (keywords.hasOwnProperty(value))
return "keyword";
else
return "variable";
},
regex : "@[a-z0-9_\\-@]*\\b"
}, {
token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase()))
return "support.type";
else if (keywords.hasOwnProperty(value))
return "keyword";
else if (constants.hasOwnProperty(value))
return "constant.language";
else if (functions.hasOwnProperty(value))
return "support.function";
else if (colors.hasOwnProperty(value.toLowerCase()))
return "support.constant.color";
else if (tags.hasOwnProperty(value.toLowerCase()))
return "variable.language";
else
return "text";
},
regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
}, {
token: "variable.language",
regex: "#[a-z0-9-_]+"
}, {
token: "variable.language",
regex: "\\.[a-z0-9-_]+"
}, {
token: "variable.language",
regex: ":[a-z0-9-_]+"
}, {
token: "constant",
regex: "[a-z0-9-_]+"
}, {
token : "keyword.operator",
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
}, {
token : "paren.lparen",
regex : "[[({]"
}, {
token : "paren.rparen",
regex : "[\\])}]"
}, {
token : "text",
regex : "\\s+"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : ".*?\\*\\/",
next : "start"
}, {
token : "comment", // comment spanning whole line
merge : true,
regex : ".+"
}
]
};
};
oop.inherits(LessHighlightRules, TextHighlightRules);
exports.LessHighlightRules = LessHighlightRules;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function() {};
(function() {
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match) return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column});
if (!openBracePos || openBracePos.row == row) return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent);
};
this.$getIndent = function(line) {
var match = line.match(/^(\s+)/);
if (match) {
return match[1];
}
return "";
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length);
range.end.column -= 2;
return range;
}
if (foldStyle !== "markbeginend")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[2]) {
var range = session.getCommentFoldRange(row, i);
range.end.column -= 2;
return range;
}
var end = {row: row, column: i};
var start = session.$findOpeningBracket(match[1], end);
if (!start)
return;
start.column++;
end.column--;
return Range.fromPoints(start, end);
}
};
}).call(FoldMode.prototype);
});/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
"use strict";
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function() {};
(function() {
this.foldingStartMarker = null;
this.foldingStopMarker = null;
// must return "" if there's no fold, to enable caching
this.getFoldWidget = function(session, foldStyle, row) {
var line = session.getLine(row);
if (this.foldingStartMarker.test(line))
return "start";
if (foldStyle == "markbeginend"
&& this.foldingStopMarker
&& this.foldingStopMarker.test(line))
return "end";
return "";
};
this.getFoldWidgetRange = function(session, foldStyle, row) {
return null;
};
this.indentationBlock = function(session, row, column) {
var re = /^\s*/;
var startRow = row;
var endRow = row;
var line = session.getLine(row);
var startColumn = column || line.length;
var startLevel = line.match(re)[0].length;
var maxRow = session.getLength()
while (++row < maxRow) {
line = session.getLine(row);
var level = line.match(re)[0].length;
if (level == line.length)
continue;
if (level <= startLevel)
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.openingBracketBlock = function(session, bracket, row, column) {
var start = {row: row, column: column + 1};
var end = session.$findClosingBracket(bracket, start);
if (!end)
return;
var fw = session.foldWidgets[end.row];
if (fw == null)
fw = this.getFoldWidget(session, end.row);
if (fw == "start") {
end.row --;
end.column = session.getLine(end.row).length;
}
return Range.fromPoints(start, end);
};
}).call(FoldMode.prototype);
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -381,7 +381,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -389,7 +413,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -407,8 +451,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -416,7 +458,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -424,7 +466,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -434,12 +476,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -694,7 +730,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -702,11 +738,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -726,10 +762,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -741,8 +778,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -753,10 +789,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -765,20 +802,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -787,20 +826,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -809,17 +850,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -870,7 +911,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -898,9 +938,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -908,6 +949,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -923,7 +965,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -932,24 +975,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -987,18 +1013,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -1007,24 +1026,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1102,24 +1114,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1238,7 +1253,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",

View file

@ -381,7 +381,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -389,7 +413,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -407,8 +451,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -416,7 +458,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -424,7 +466,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -434,12 +476,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -694,7 +730,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -702,11 +738,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -726,10 +762,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -741,8 +778,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -753,10 +789,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -765,20 +802,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -787,20 +826,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -809,17 +850,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -870,7 +911,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -898,9 +938,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -908,6 +949,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -923,7 +965,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -932,24 +975,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -987,18 +1013,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -1007,24 +1026,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -1102,24 +1114,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1238,7 +1253,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -360,7 +360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -368,11 +368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -392,10 +392,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -407,8 +408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -419,10 +419,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -431,20 +432,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -453,20 +456,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -475,17 +480,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -536,7 +541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -564,9 +568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -574,6 +579,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -589,7 +595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -598,24 +605,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -653,18 +643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -673,24 +656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -768,24 +744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1428,9 +1407,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -1438,9 +1414,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -1590,7 +1563,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
@ -2214,7 +2187,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -2222,7 +2219,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -2240,8 +2257,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -2249,7 +2264,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -2257,7 +2272,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -2267,12 +2282,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -2473,9 +2482,6 @@ var HtmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*script\\b)", regex : "<(?=\s*script\\b)",
@ -2491,9 +2497,6 @@ var HtmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"

View file

@ -360,7 +360,7 @@ var JavaScriptHighlightRules = function() {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
}, },
DocCommentHighlightRules.getStartRule("doc-start"), new DocCommentHighlightRules().getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -368,11 +368,11 @@ var JavaScriptHighlightRules = function() {
next : "comment" next : "comment"
}, { }, {
token : "string", token : "string",
regex : "'(?=.)", regex : "'",
next : "qstring" next : "qstring"
}, { }, {
token : "string", token : "string",
regex : '"(?=.)', regex : '"',
next : "qqstring" next : "qqstring"
}, { }, {
token : "constant.numeric", // hex token : "constant.numeric", // hex
@ -392,10 +392,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: Sound.prototype.play = myfunc }, { // match stuff like: Sound.prototype.play = myfunc
token : [ token : [
"storage.type", "storage.type",
@ -407,8 +408,7 @@ var JavaScriptHighlightRules = function() {
"keyword.operator", "keyword.operator",
"text" "text"
], ],
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)", regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)"
next: "function_arguments"
}, { // match stuff like: Sound.play = function() { } }, { // match stuff like: Sound.play = function() { }
token : [ token : [
"storage.type", "storage.type",
@ -419,10 +419,11 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: play = function() { } }, { // match stuff like: play = function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -431,20 +432,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match regular function like: function myFunc(arg) { } }, { // match regular function like: function myFunc(arg) { }
token : [ token : [
"storage.type", "storage.type",
"text", "text",
"entity.name.function", "entity.name.function",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // match stuff like: foobar: function() { } }, { // match stuff like: foobar: function() { }
token : [ token : [
"entity.name.function", "entity.name.function",
@ -453,20 +456,22 @@ var JavaScriptHighlightRules = function() {
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()(.*?)(\\))"
next: "function_arguments"
}, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
token : [ token : [
"text", "text",
"text", "text",
"storage.type", "storage.type",
"text", "text",
"paren.lparen" "paren.lparen",
"variable.parameter",
"paren.rparen"
], ],
regex : "(:)(\\s*)(function)(\\s*)(\\()", regex : "(:)(\\s*)(function)?(\\s*)(\\()([^)]*)(\\))"
next: "function_arguments"
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : /(?:true|false)\b/ regex : /(?:true|false)\b/
@ -475,17 +480,17 @@ var JavaScriptHighlightRules = function() {
regex : "(?:" + kwBeforeRe + ")\\b", regex : "(?:" + kwBeforeRe + ")\\b",
next : "regex_allowed" next : "regex_allowed"
}, { }, {
token : ["punctuation.operator", "support.function"], token : "support.function",
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ regex : /\b(?:s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.function.dom"], token : "support.function.dom",
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ regex : /\b(?:s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, { }, {
token : ["punctuation.operator", "support.constant"], token : "support.constant",
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ regex : /\b(?:s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, { }, {
token : ["storage.type", "punctuation.operator", "support.function.firebug"], token : ["storage.type", "punctuation.operator", "support.function.firebug"],
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ regex : /\b(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
}, { }, {
token : function(value) { token : function(value) {
if (globals.hasOwnProperty(value)) if (globals.hasOwnProperty(value))
@ -536,7 +541,6 @@ var JavaScriptHighlightRules = function() {
// regular expressions are only allowed after certain tokens. This // regular expressions are only allowed after certain tokens. This
// makes sure we don't mix up regexps with the divison operator // makes sure we don't mix up regexps with the divison operator
"regex_allowed": [ "regex_allowed": [
DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token : "comment", // multi line comment
merge : true, merge : true,
@ -564,9 +568,10 @@ var JavaScriptHighlightRules = function() {
"regex": [ "regex": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex"
}, { }, {
// flag // flag
token: "string.regexp", token: "string.regexp",
regex: "/\\w*", regex: "/\\w*",
next: "start", next: "start",
@ -574,6 +579,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp", token: "string.regexp",
regex: "[^\\\\/\\[]+", regex: "[^\\\\/\\[]+",
next: "regex",
merge: true merge: true
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
@ -589,7 +595,8 @@ var JavaScriptHighlightRules = function() {
"regex_character_class": [ "regex_character_class": [
{ {
token: "regexp.keyword.operator", token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)",
next: "regex_character_class"
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "]", regex: "]",
@ -598,24 +605,7 @@ var JavaScriptHighlightRules = function() {
}, { }, {
token: "string.regexp.charachterclass", token: "string.regexp.charachterclass",
regex: "[^\\\\\\]]+", regex: "[^\\\\\\]]+",
merge: true next: "regex_character_class",
}, {
token: "empty",
regex: "",
next: "start"
}
],
"function_arguments": [
{
token: "variable.parameter",
regex: identifierRe,
}, {
token: "punctuation.operator",
regex: "[, ]+",
merge: true
}, {
token: "punctuation.operator",
regex: "$",
merge: true merge: true
}, { }, {
token: "empty", token: "empty",
@ -653,18 +643,11 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : '[^"\\\\]+', regex : '[^"\\\\]+'
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : '"',
next : "qqstring", next : "start"
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qstring" : [
@ -673,24 +656,17 @@ var JavaScriptHighlightRules = function() {
regex : escapedRe regex : escapedRe
}, { }, {
token : "string", token : "string",
regex : "[^'\\\\]+", regex : "[^'\\\\]+"
merge : true
}, { }, {
token : "string", token : "string",
regex : "\\\\$", regex : "'",
next : "qstring", next : "start"
merge : true
}, {
token : "string",
regex : "'|$",
next : "start",
merge : true
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]); [ new DocCommentHighlightRules().getEndRule("start") ]);
}; };
oop.inherits(JavaScriptHighlightRules, TextHighlightRules); oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
@ -768,24 +744,27 @@ var DocCommentHighlightRules = function() {
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getStartRule = function(start) { (function() {
return {
token : "comment.doc", // doc comment
merge : true,
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) { this.getStartRule = function(start) {
return { return {
token : "comment.doc", // closing comment token : "comment.doc", // doc comment
merge : true, merge : true,
regex : "\\*\\/", regex : "\\/\\*(?=\\*)",
next : start next : start
};
};
this.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
merge : true,
regex : "\\*\\/",
next : start
};
}; };
};
}).call(DocCommentHighlightRules.prototype);
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
@ -1428,9 +1407,6 @@ var XmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", // opening tag token : "meta.tag", // opening tag
regex : "<\\/?", regex : "<\\/?",
@ -1438,9 +1414,6 @@ var XmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"
@ -1590,7 +1563,7 @@ exports.tag = function(states, name, nextState) {
} }
}, },
merge : true, merge : true,
regex : "[-_a-zA-Z0-9:]+", regex : "[-_a-zA-Z0-9:!]+",
next : name + "_embed_attribute_list" next : name + "_embed_attribute_list"
}, { }, {
token: "empty", token: "empty",
@ -2214,7 +2187,31 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() { var CssHighlightRules = function() {
var properties = lang.arrayToMap( var properties = lang.arrayToMap(
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|") ("-moz-appearance|-moz-box-sizing|-webkit-box-sizing|-moz-outline-radius|-moz-transform|-webkit-transform|" +
"appearance|azimuth|background-attachment|background-color|background-image|" +
"background-origin|background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|-moz-border-radius|opacity|orphans|outline-color|outline-offset|outline-radius|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|transform|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|")
); );
var functions = lang.arrayToMap( var functions = lang.arrayToMap(
@ -2222,7 +2219,27 @@ var CssHighlightRules = function() {
); );
var constants = lang.arrayToMap( var constants = lang.arrayToMap(
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|") ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
); );
var colors = lang.arrayToMap( var colors = lang.arrayToMap(
@ -2240,8 +2257,6 @@ var CssHighlightRules = function() {
// regexps are ordered -> the first match is used // regexps are ordered -> the first match is used
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var base_ruleset = [ var base_ruleset = [
{ {
@ -2249,7 +2264,7 @@ var CssHighlightRules = function() {
merge : true, merge : true,
regex : "\\/\\*", regex : "\\/\\*",
next : "ruleset_comment" next : "ruleset_comment"
}, { },{
token : "string", // single line token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
@ -2257,7 +2272,7 @@ var CssHighlightRules = function() {
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : ["constant.numeric", "keyword"], token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" regex : "(" + numRe + ")(em|ex|px|ch|cm|mm|in|pt|pc|deg|rad|dpi|grad|ms|s|hz|khz|%)"
}, { }, {
token : ["constant.numeric"], token : ["constant.numeric"],
regex : "([0-9]+)" regex : "([0-9]+)"
@ -2267,12 +2282,6 @@ var CssHighlightRules = function() {
}, { }, {
token : "constant.numeric", // hex3 color token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, { }, {
token : function(value) { token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase())) { if (properties.hasOwnProperty(value.toLowerCase())) {
@ -2473,9 +2482,6 @@ var HtmlHighlightRules = function() {
merge : true, merge : true,
regex : "<\\!--", regex : "<\\!--",
next : "comment" next : "comment"
}, {
token : "xml_pe",
regex : "<\\!.*?>"
}, { }, {
token : "meta.tag", token : "meta.tag",
regex : "<(?=\s*script\\b)", regex : "<(?=\s*script\\b)",
@ -2491,9 +2497,6 @@ var HtmlHighlightRules = function() {
}, { }, {
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, {
token : "constant.character.entity",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, { }, {
token : "text", token : "text",
regex : "[^<]+" regex : "[^<]+"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more