code style

This commit is contained in:
nightwing 2012-12-28 20:44:05 +04:00
commit 77a02fc109
10 changed files with 420 additions and 423 deletions

View file

@ -38,101 +38,101 @@ var DartHighlightRules = function() {
{ {
"start": [ "start": [
{ {
"token" : "comment", token : "comment",
"regex" : /\/\/.*$/ regex : /\/\/.*$/
}, },
{ {
"token" : "comment", // multi line comment token : "comment", // multi line comment
"regex" : /\/\*/, regex : /\/\*/,
"next" : "comment" next : "comment"
}, },
{ {
"token": ["meta.preprocessor.script.dart"], token: ["meta.preprocessor.script.dart"],
"regex": "^(#!.*)$" regex: "^(#!.*)$"
}, },
{ {
"token": "keyword.other.import.dart", token: "keyword.other.import.dart",
"regex": "#(?:\\b)(?:library|import|source|resource)(?:\\b)" regex: "#(?:\\b)(?:library|import|source|resource)(?:\\b)"
}, },
{ {
"token" : ["keyword.other.import.dart", "text"], token : ["keyword.other.import.dart", "text"],
"regex" : "(?:\\b)(prefix)(\\s*:)" regex : "(?:\\b)(prefix)(\\s*:)"
}, },
{ {
"regex": "\\bas\\b", regex: "\\bas\\b",
"token": "keyword.cast.dart" token: "keyword.cast.dart"
}, },
{ {
"regex": "\\?|:", regex: "\\?|:",
"token": "keyword.control.ternary.dart" token: "keyword.control.ternary.dart"
}, },
{ {
"regex": "(?:\\b)(is\\!?)(?:\\b)", regex: "(?:\\b)(is\\!?)(?:\\b)",
"token": ["keyword.operator.dart"] token: ["keyword.operator.dart"]
}, },
{ {
"regex": "(<<|>>>?|~|\\^|\\||&)", regex: "(<<|>>>?|~|\\^|\\||&)",
"token": ["keyword.operator.bitwise.dart"] token: ["keyword.operator.bitwise.dart"]
}, },
{ {
"regex": "((?:&|\\^|\\||<<|>>>?)=)", regex: "((?:&|\\^|\\||<<|>>>?)=)",
"token": ["keyword.operator.assignment.bitwise.dart"] token: ["keyword.operator.assignment.bitwise.dart"]
}, },
{ {
"regex": "(===?|!==?|<=?|>=?)", regex: "(===?|!==?|<=?|>=?)",
"token": ["keyword.operator.comparison.dart"] token: ["keyword.operator.comparison.dart"]
}, },
{ {
"regex": "((?:[+*/%-]|\\~)=)", regex: "((?:[+*/%-]|\\~)=)",
"token": ["keyword.operator.assignment.arithmetic.dart"] token: ["keyword.operator.assignment.arithmetic.dart"]
}, },
{ {
"regex": "=", regex: "=",
"token": "keyword.operator.assignment.dart" token: "keyword.operator.assignment.dart"
}, },
{ {
"token" : "string", token : "string",
"regex" : "'''", regex : "'''",
"next" : "qdoc" next : "qdoc"
}, },
{ {
"token" : "string", token : "string",
"regex" : '"""', regex : '"""',
"next" : "qqdoc" next : "qqdoc"
}, },
{ {
"token" : "string", token : "string",
"regex" : "'", regex : "'",
"next" : "qstring" next : "qstring"
}, },
{ {
"token" : "string", token : "string",
"regex" : '"', regex : '"',
"next" : "qqstring" next : "qqstring"
}, },
{ {
"regex": "(\\-\\-|\\+\\+)", regex: "(\\-\\-|\\+\\+)",
"token": ["keyword.operator.increment-decrement.dart"] token: ["keyword.operator.increment-decrement.dart"]
}, },
{ {
"regex": "(\\-|\\+|\\*|\\/|\\~\\/|%)", regex: "(\\-|\\+|\\*|\\/|\\~\\/|%)",
"token": ["keyword.operator.arithmetic.dart"] token: ["keyword.operator.arithmetic.dart"]
}, },
{ {
"regex": "(!|&&|\\|\\|)", regex: "(!|&&|\\|\\|)",
"token": ["keyword.operator.logical.dart"] token: ["keyword.operator.logical.dart"]
}, },
{ {
"token" : "constant.numeric", // hex token : "constant.numeric", // hex
"regex" : "0[xX][0-9a-fA-F]+\\b" regex : "0[xX][0-9a-fA-F]+\\b"
}, },
{ {
"token" : "constant.numeric", // float token : "constant.numeric", // float
"regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, },
{ {
"token" : keywordMapper, token : keywordMapper,
"regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
} }
], ],
"comment" : [ "comment" : [
@ -147,30 +147,30 @@ var DartHighlightRules = function() {
], ],
"qdoc" : [ "qdoc" : [
{ {
"token" : "string", token : "string",
"regex" : ".*?'''", regex : ".*?'''",
"next" : "start" next : "start"
}, stringfill], }, stringfill],
"qqdoc" : [ "qqdoc" : [
{ {
"token" : "string", token : "string",
"regex" : '.*?"""', regex : '.*?"""',
"next" : "start" next : "start"
}, stringfill], }, stringfill],
"qstring" : [ "qstring" : [
{ {
"token" : "string", token : "string",
"regex" : "[^\\\\']*(?:\\\\.[^\\\\']*)*'", regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
"next" : "start" next : "start"
}, stringfill], }, stringfill],
"qqstring" : [ "qqstring" : [
{ {
"token" : "string", token : "string",
"regex" : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
"next" : "start" next : "start"
}, stringfill] }, stringfill]
} }

View file

@ -40,20 +40,20 @@ var DiffHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [{ "start" : [{
"regex": "^(?:\\*{15}|={67}|-{3}|\\+{3})$", regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$",
"token": "punctuation.definition.separator.diff", token: "punctuation.definition.separator.diff",
"name": "keyword" "name": "keyword"
}, { //diff.range.unified }, { //diff.range.unified
"regex": "^(@@)(\\s*.+?\\s*)(@@)(.*)$", regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$",
"token": [ token: [
"constant", "constant",
"constant.numeric", "constant.numeric",
"constant", "constant",
"comment.doc.tag" "comment.doc.tag"
] ]
}, { //diff.range.normal }, { //diff.range.normal
"regex": "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$", regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",
"token": [ token: [
"constant.numeric", "constant.numeric",
"punctuation.definition.range.diff", "punctuation.definition.range.diff",
"constant.function", "constant.function",
@ -63,36 +63,36 @@ var DiffHighlightRules = function() {
], ],
"name": "meta." "name": "meta."
}, { }, {
"regex": "^(\\-{3}|\\+{3}|\\*{3})( .+)$", regex: "^(\\-{3}|\\+{3}|\\*{3})( .+)$",
"token": [ token: [
"constant.numeric", "constant.numeric",
"meta.tag" "meta.tag"
] ]
}, { // added }, { // added
"regex": "^([!+>])(.*?)(\\s*)$", regex: "^([!+>])(.*?)(\\s*)$",
"token": [ token: [
"support.constant", "support.constant",
"text", "text",
"invalid" "invalid"
] ]
}, { // removed }, { // removed
"regex": "^([<\\-])(.*?)(\\s*)$", regex: "^([<\\-])(.*?)(\\s*)$",
"token": [ token: [
"support.function", "support.function",
"string", "string",
"invalid" "invalid"
] ]
}, { }, {
"regex": "^(diff)(\\s+--\\w+)?(.+?)( .+)?$", regex: "^(diff)(\\s+--\\w+)?(.+?)( .+)?$",
"token": ["variable", "variable", "keyword", "variable"] token: ["variable", "variable", "keyword", "variable"]
}, { }, {
"regex": "^Index.+$", regex: "^Index.+$",
"token": "variable" token: "variable"
}, { }, {
"regex": "\\s*$", regex: "\\s*$",
"token": "invalid" token: "invalid"
}, { }, {
"defaultToken": "invisible" defaultToken: "invisible"
} }
] ]
}; };

View file

@ -15,69 +15,69 @@ var HamlHighlightRules = function() {
{ {
"start": [ "start": [
{ {
"token" : "punctuation.section.comment", token : "punctuation.section.comment",
"regex" : /^\s*\/.*/ regex : /^\s*\/.*/
}, },
{ {
"token" : "punctuation.section.comment", token : "punctuation.section.comment",
"regex" : /^\s*#.*/ regex : /^\s*#.*/
}, },
{ {
"token": "string.quoted.double", token: "string.quoted.double",
"regex": "==.+?==" regex: "==.+?=="
}, },
{ {
"token": "keyword.other.doctype", token: "keyword.other.doctype",
"regex": "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
}, },
RubyExports.qString, RubyExports.qString,
RubyExports.qqString, RubyExports.qqString,
RubyExports.tString, RubyExports.tString,
{ {
"token": ["entity.name.tag.haml"], token: ["entity.name.tag.haml"],
"regex": /^\s*%[\w:]+/, regex: /^\s*%[\w:]+/,
"next": "tag_single" next: "tag_single"
}, },
{ {
"token": [ "meta.escape.haml" ], token: [ "meta.escape.haml" ],
"regex": "^\\s*\\\\." regex: "^\\s*\\\\."
}, },
RubyExports.constantNumericHex, RubyExports.constantNumericHex,
RubyExports.constantNumericFloat, RubyExports.constantNumericFloat,
RubyExports.constantOtherSymbol, RubyExports.constantOtherSymbol,
{ {
"token": "text", token: "text",
"regex": "=|-|~", regex: "=|-|~",
"next": "embedded_ruby" next: "embedded_ruby"
} }
], ],
"tag_single": [ "tag_single": [
{ {
"token": "entity.other.attribute-name.class.haml", token: "entity.other.attribute-name.class.haml",
"regex": "\\.[\\w-]+" regex: "\\.[\\w-]+"
}, },
{ {
"token": "entity.other.attribute-name.id.haml", token: "entity.other.attribute-name.id.haml",
"regex": "#[\\w-]+" regex: "#[\\w-]+"
}, },
{ {
"token": "punctuation.section", token: "punctuation.section",
"regex": "\\{", regex: "\\{",
"next": "section" next: "section"
}, },
RubyExports.constantOtherSymbol, RubyExports.constantOtherSymbol,
{ {
"token": "text", token: "text",
"regex": /\s/, regex: /\s/,
"next": "start" next: "start"
}, },
{ {
"token": "empty", token: "empty",
"regex": "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)", regex: "$|(?!\\.|#|\\{|\\[|=|-|~|\\/)",
"next": "start" next: "start"
} }
], ],
"section": [ "section": [
@ -90,9 +90,9 @@ var HamlHighlightRules = function() {
RubyExports.constantNumericHex, RubyExports.constantNumericHex,
RubyExports.constantNumericFloat, RubyExports.constantNumericFloat,
{ {
"token": "punctuation.section", token: "punctuation.section",
"regex": "\\}", regex: "\\}",
"next": "start" next: "start"
} }
], ],
"embedded_ruby": [ "embedded_ruby": [
@ -103,23 +103,23 @@ var HamlHighlightRules = function() {
regex : "[A-Z][a-zA-Z_\\d]+" regex : "[A-Z][a-zA-Z_\\d]+"
}, },
{ {
"token" : new RubyHighlightRules().getKeywords(), token : new RubyHighlightRules().getKeywords(),
"regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, },
{ {
"token" : ["keyword", "text", "text"], token : ["keyword", "text", "text"],
"regex" : "(?:do|\\{)(?: \\|[^|]+\\|)?$", regex : "(?:do|\\{)(?: \\|[^|]+\\|)?$",
"next" : "start" next : "start"
}, },
{ {
"token" : ["text"], token : ["text"],
"regex" : "^$", regex : "^$",
"next" : "start" next : "start"
}, },
{ {
"token" : ["text"], token : ["text"],
"regex" : "^(?!.*\\|\\s*$)", regex : "^(?!.*\\|\\s*$)",
"next" : "start" next : "start"
} }
] ]
} }

View file

@ -73,23 +73,23 @@ var JadeHighlightRules = function() {
{ {
"start": [ "start": [
{ {
"token": "keyword.control.import.include.jade", token: "keyword.control.import.include.jade",
"regex": "\\s*\\binclude\\b" regex: "\\s*\\binclude\\b"
}, },
{ {
"token": "keyword.other.doctype.jade", token: "keyword.other.doctype.jade",
"regex": "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
}, },
{ {
"token" : "punctuation.section.comment", token : "punctuation.section.comment",
"regex" : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)" regex : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)"
}, },
{ {
"token" : function(space, text) { token : function(space, text) {
return "punctuation.section.comment"; return "punctuation.section.comment";
}, },
"regex" : "^((\\s*)\/\/)(?:\\s*$)", regex : "^((\\s*)\/\/)(?:\\s*$)",
"next": "comment_block" next: "comment_block"
}, },
mixin_embed("markdown", "markdown-"), mixin_embed("markdown", "markdown-"),
mixin_embed("sass", "sass-"), mixin_embed("sass", "sass-"),
@ -97,100 +97,100 @@ var JadeHighlightRules = function() {
mixin_embed("coffee", "coffee-"), mixin_embed("coffee", "coffee-"),
/* /*
{ {
"token": { token: {
"2": { "2": {
"name": "entity.name.function.jade" "name": "entity.name.function.jade"
} }
}, },
"regex": "^(\\s*)(\\:cdata)", regex: "^(\\s*)(\\:cdata)",
"next": "state_9" next: "state_9"
},*/ },*/
// match stuff like: mixin dialog-title-desc(title, desc) // match stuff like: mixin dialog-title-desc(title, desc)
{ {
"token": [ "storage.type.function.jade", token: [ "storage.type.function.jade",
"entity.name.function.jade", "entity.name.function.jade",
"punctuation.definition.parameters.begin.jade", "punctuation.definition.parameters.begin.jade",
"variable.parameter.function.jade", "variable.parameter.function.jade",
"punctuation.definition.parameters.end.jade" "punctuation.definition.parameters.end.jade"
], ],
"regex": "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))" regex: "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))"
}, },
// match stuff like: mixin dialog-title-desc // match stuff like: mixin dialog-title-desc
{ {
"token": [ "storage.type.function.jade", "entity.name.function.jade"], token: [ "storage.type.function.jade", "entity.name.function.jade"],
"regex": "^(\\s*mixin)( [\\w\\-]+)" regex: "^(\\s*mixin)( [\\w\\-]+)"
}, },
{ {
"token": "source.js.embedded.jade", token: "source.js.embedded.jade",
"regex": "^\\s*(?:-|=|!=)", regex: "^\\s*(?:-|=|!=)",
"next": "js-start" next: "js-start"
}, },
/*{ /*{
"token": "entity.name.tag.script.jade", token: "entity.name.tag.script.jade",
"regex": "^\\s*script", regex: "^\\s*script",
"next": "js_code_tag" next: "js_code_tag"
},*/ },*/
{ {
"token": "string.interpolated.jade", token: "string.interpolated.jade",
"regex": "[#!]\\{[^\\}]+\\}" regex: "[#!]\\{[^\\}]+\\}"
}, },
// Match any tag, id or class. skip AST filters // Match any tag, id or class. skip AST filters
{ {
"token": "meta.tag.any.jade", token: "meta.tag.any.jade",
"regex": /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/, regex: /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/,
"next": "tag_single" next: "tag_single"
}, },
{ {
"token": "suport.type.attribute.id.jade", token: "suport.type.attribute.id.jade",
"regex": "#\\w+" regex: "#\\w+"
}, },
{ {
"token": "suport.type.attribute.class.jade", token: "suport.type.attribute.class.jade",
"regex": "\\.\\w+" regex: "\\.\\w+"
}, },
{ {
"token": "punctuation", token: "punctuation",
"regex": "\\s*(?:\\()", regex: "\\s*(?:\\()",
"next": "tag_attributes" next: "tag_attributes"
} }
], ],
"comment_block": [ "comment_block": [
{ {
"token": function(text) { token: function(text) {
return "text"; return "text";
}, },
"regex": "^(\\1\\S|$)", regex: "^(\\1\\S|$)",
"captures": "1", "captures": "1",
"next": "start" next: "start"
}, },
{ {
"token": "comment.block.jade", token: "comment.block.jade",
"regex" : ".+" regex : ".+"
} }
], ],
/* /*
"state_9": [ "state_9": [
{ {
"token": "TODO", token: "TODO",
"regex": "^(?!\\1\\s+)", regex: "^(?!\\1\\s+)",
"next": "start" next: "start"
}, },
{ {
"token": "TODO", token: "TODO",
"regex": ".+", regex: ".+",
"next": "state_9" next: "state_9"
} }
],*/ ],*/
/*"js_code": [ /*"js_code": [
{ {
"token": "keyword.control.js", token: "keyword.control.js",
"regex": "\\beach\\b" regex: "\\beach\\b"
}, },
{ {
"token": "text", token: "text",
"regex": "$", regex: "$",
"next": "start" next: "start"
} }
],*/ ],*/
/*"js_code_tag": [ /*"js_code_tag": [
@ -198,62 +198,62 @@ var JadeHighlightRules = function() {
"include": "source.js" "include": "source.js"
}, },
{ {
"token": "TODO", token: "TODO",
"regex": "^((?=(\\1)([\\w#\\.]|$\\n?))|^$\\n?)", regex: "^((?=(\\1)([\\w#\\.]|$\\n?))|^$\\n?)",
"next": "start" next: "start"
} }
],*/ ],*/
"tag_single": [ "tag_single": [
{ {
"token": "entity.other.attribute-name.class.jade", token: "entity.other.attribute-name.class.jade",
"regex": "\\.[\\w-]+" regex: "\\.[\\w-]+"
}, },
{ {
"token": "entity.other.attribute-name.id.jade", token: "entity.other.attribute-name.id.jade",
"regex": "#[\\w-]+" regex: "#[\\w-]+"
}, },
{ {
"token": ["text", "punctuation"], token: ["text", "punctuation"],
"regex": "($)|((?!\\.|#|=|-))", regex: "($)|((?!\\.|#|=|-))",
"next": "start" next: "start"
} }
], ],
"tag_attributes": [ "tag_attributes": [
{ {
"token" : "string", token : "string",
"regex" : "'(?=.)", regex : "'(?=.)",
"next" : "qstring" next : "qstring"
}, },
{ {
"token" : "string", token : "string",
"regex" : '"(?=.)', regex : '"(?=.)',
"next" : "qqstring" next : "qqstring"
}, },
{ {
"token": "entity.other.attribute-name.jade", token: "entity.other.attribute-name.jade",
"regex": "\\b[a-zA-Z\\-:]+" regex: "\\b[a-zA-Z\\-:]+"
}, },
{ {
"token": ["entity.other.attribute-name.jade", "punctuation"], token: ["entity.other.attribute-name.jade", "punctuation"],
"regex": "\\b([a-zA-Z:\\.-]+)(=)", regex: "\\b([a-zA-Z:\\.-]+)(=)",
"next": "attribute_strings" next: "attribute_strings"
}, },
{ {
"token": "punctuation", token: "punctuation",
"regex": "\\)", regex: "\\)",
"next": "start" next: "start"
} }
], ],
"attribute_strings": [ "attribute_strings": [
{ {
"token" : "string", token : "string",
"regex" : "'(?=.)", regex : "'(?=.)",
"next" : "qstring" next : "qstring"
}, },
{ {
"token" : "string", token : "string",
"regex" : '"(?=.)', regex : '"(?=.)',
"next" : "qqstring" next : "qqstring"
} }
], ],
"qqstring" : [ "qqstring" : [

View file

@ -67,54 +67,51 @@ var LispHighlightRules = function() {
regex : ";.*$" regex : ";.*$"
}, },
{ {
"token": ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"],
"regex": "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"
}, },
{ {
"token": ["punctuation.definition.constant.character.lisp", "constant.character.lisp"], token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"],
"regex": "(#)((?:\\w|[\\\\+-=<>'\"&#])+)" regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)"
}, },
{ {
"token": ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"],
"regex": "(\\*)(\\S*)(\\*)" regex: "(\\*)(\\S*)(\\*)"
}, },
{ {
"token" : "constant.numeric", // hex token : "constant.numeric", // hex
"regex" : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" regex : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, },
{ {
"token" : "constant.numeric", // float token : "constant.numeric", // float
"regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, },
{ {
"token" : keywordMapper, token : keywordMapper,
"regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, },
{ {
"token" : "string", token : "string",
"regex" : '"(?=.)', regex : '"(?=.)',
"next" : "qqstring" next : "qqstring"
} }
], ],
"qqstring": [ "qqstring": [
{ {
"token": "constant.character.escape.lisp", token: "constant.character.escape.lisp",
"regex": "\\\\." regex: "\\\\."
}, },
{ {
"token" : "string", token : "string",
"regex" : '[^"\\\\]+', regex : '[^"\\\\]+'
"merge" : true
}, { }, {
"token" : "string", token : "string",
"regex" : "\\\\$", regex : "\\\\$",
"next" : "qqstring", next : "qqstring"
"merge" : true
}, { }, {
"token" : "string", token : "string",
"regex" : '"|$', regex : '"|$',
"next" : "start", next : "start"
"merge" : true
} }
] ]
} }

View file

@ -21,48 +21,48 @@ var MakefileHighlightRules = function() {
{ {
"start": [ "start": [
{ {
"token": "string.interpolated.backtick.makefile", token: "string.interpolated.backtick.makefile",
"regex": "`", regex: "`",
"next": "shell-start" next: "shell-start"
}, },
{ {
"token": "punctuation.definition.comment.makefile", token: "punctuation.definition.comment.makefile",
"regex": /#(?=.)/, regex: /#(?=.)/,
"next": "comment" next: "comment"
}, },
{ {
"token": [ "keyword.control.makefile"], token: [ "keyword.control.makefile"],
"regex": "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)" regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)"
}, },
{// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.* {// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.*
"token": ["entity.name.function.makefile", "text"], token: ["entity.name.function.makefile", "text"],
"regex": "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)" regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)"
} }
], ],
"comment": [ "comment": [
{ {
"token" : "punctuation.definition.comment.makefile", token : "punctuation.definition.comment.makefile",
"regex" : /.+\\/ regex : /.+\\/
}, },
{ {
"token" : "punctuation.definition.comment.makefile", token : "punctuation.definition.comment.makefile",
"regex" : ".+", regex : ".+",
"next" : "start" next : "start"
} }
], ],
"shell-start": [ "shell-start": [
{ {
"token": keywordMapper, token: keywordMapper,
"regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, },
{ {
"token": "string", token: "string",
"regex" : "\\w+" regex : "\\w+"
}, },
{ {
"token" : "string.interpolated.backtick.makefile", token : "string.interpolated.backtick.makefile",
"regex" : "`", regex : "`",
"next" : "start" next : "start"
} }
] ]
} }

File diff suppressed because one or more lines are too long

View file

@ -190,7 +190,7 @@ var RubyHighlightRules = function() {
return "string"; return "string";
}, },
regex: ".*$", regex: ".*$",
"next": "start" next: "start"
}], }],
indentedHeredoc: [{ indentedHeredoc: [{
token: "string", token: "string",
@ -205,7 +205,7 @@ var RubyHighlightRules = function() {
return "string"; return "string";
}, },
regex: ".*$", regex: ".*$",
"next": "start" next: "start"
}] }]
} }
}, { }, {

View file

@ -22,7 +22,7 @@ var StylusHighlightRules = function() {
}, "text", true); }, "text", true);
this.$rules = { this.$rules = {
"start": [ start: [
{ {
token : "comment", token : "comment",
regex : /\/\/.*$/ regex : /\/\/.*$/
@ -33,24 +33,24 @@ var StylusHighlightRules = function() {
next : "comment" next : "comment"
}, },
{ {
"token": ["entity.name.function.stylus", "text"], token: ["entity.name.function.stylus", "text"],
"regex": "^([-a-zA-Z_][-\\w]*)?(\\()" regex: "^([-a-zA-Z_][-\\w]*)?(\\()"
}, },
{ {
"token": ["entity.other.attribute-name.class.stylus"], token: ["entity.other.attribute-name.class.stylus"],
"regex": "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*" regex: "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*"
}, },
{ {
"token": ["entity.language.stylus"], token: ["entity.language.stylus"],
"regex": "^ *&" regex: "^ *&"
}, },
{ {
"token": ["variable.language.stylus"], token: ["variable.language.stylus"],
"regex": "(arguments)" regex: "(arguments)"
}, },
{ {
"token": ["keyword.stylus"], token: ["keyword.stylus"],
"regex": "@[-\\w]+" regex: "@[-\\w]+"
}, },
{ {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
@ -60,8 +60,8 @@ var StylusHighlightRules = function() {
regex : CssHighlightRules.pseudoClasses regex : CssHighlightRules.pseudoClasses
}, },
{ {
"token": ["entity.name.tag.stylus"], token: ["entity.name.tag.stylus"],
"regex": "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)" regex: "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)"
}, },
{ {
token : "constant.numeric", // hex6 color token : "constant.numeric", // hex6 color
@ -72,24 +72,24 @@ var StylusHighlightRules = function() {
regex : "#[a-f0-9]{3}" regex : "#[a-f0-9]{3}"
}, },
{ {
"token": ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"], token: ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"],
"regex": "(#)([a-zA-Z][a-zA-Z0-9_-]*)" regex: "(#)([a-zA-Z][a-zA-Z0-9_-]*)"
}, },
{ {
"token": "meta.vendor-prefix.stylus", token: "meta.vendor-prefix.stylus",
"regex": "-webkit-|-moz\\-|-ms-|-o-" regex: "-webkit-|-moz\\-|-ms-|-o-"
}, },
{ {
"token": "keyword.control.stylus", token: "keyword.control.stylus",
"regex": "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b" regex: "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b"
}, },
{ {
"token": "keyword.operator.stylus", token: "keyword.operator.stylus",
"regex": "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=" regex: "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!="
}, },
{ {
"token": "keyword.operator.stylus", token: "keyword.operator.stylus",
"regex": "(?:in|is(?:nt)?|not)\\b" regex: "(?:in|is(?:nt)?|not)\\b"
}, },
{ {
token : "string", token : "string",

View file

@ -50,39 +50,39 @@ var TypeScriptHighlightRules = function() {
var tsRules = [ var tsRules = [
// Match stuff like: module name {...} // Match stuff like: module name {...}
{ {
"token": ["keyword.operator.ts", "text", "variable.parameter.function.ts", "text"], token: ["keyword.operator.ts", "text", "variable.parameter.function.ts", "text"],
"regex": "\\b(module)(\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*\\{)" regex: "\\b(module)(\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*\\{)"
}, },
// Match stuff like: super(argument, list) // Match stuff like: super(argument, list)
{ {
"token": ["storage.type.variable.ts", "text", "keyword.other.ts", "text"], token: ["storage.type.variable.ts", "text", "keyword.other.ts", "text"],
"regex": "(super)(\\s*\\()([a-zA-Z0-9,_?.$\\s]+\\s*)(\\))" regex: "(super)(\\s*\\()([a-zA-Z0-9,_?.$\\s]+\\s*)(\\))"
}, },
// Match stuff like: function() {...} // Match stuff like: function() {...}
{ {
"token": ["entity.name.function.ts","paren.lparen", "paren.rparen"], token: ["entity.name.function.ts","paren.lparen", "paren.rparen"],
"regex": "([a-zA-Z_?.$][\\w?.$]*)(\\()(\\))" regex: "([a-zA-Z_?.$][\\w?.$]*)(\\()(\\))"
}, },
// Match stuff like: (function: return type) // Match stuff like: (function: return type)
{ {
"token": ["variable.parameter.function.ts", "text", "variable.parameter.function.ts"], token: ["variable.parameter.function.ts", "text", "variable.parameter.function.ts"],
"regex": "([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*:\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)" regex: "([a-zA-Z0-9_?.$][\\w?.$]*)(\\s*:\\s*)([a-zA-Z0-9_?.$][\\w?.$]*)"
}, },
{ {
"token": ["keyword.operator.ts"], token: ["keyword.operator.ts"],
"regex": "(?:\\b(constructor|declare|interface|as|AS|public|private|class|extends|export|super)\\b)" regex: "(?:\\b(constructor|declare|interface|as|AS|public|private|class|extends|export|super)\\b)"
}, },
{ {
"token": ["storage.type.variable.ts"], token: ["storage.type.variable.ts"],
"regex": "(?:\\b(this\\.|string\\b|bool\\b|number)\\b)" regex: "(?:\\b(this\\.|string\\b|bool\\b|number)\\b)"
}, },
{ {
"token": ["keyword.operator.ts", "storage.type.variable.ts", "keyword.operator.ts", "storage.type.variable.ts"], token: ["keyword.operator.ts", "storage.type.variable.ts", "keyword.operator.ts", "storage.type.variable.ts"],
"regex": "(class)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)(extends)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)?" regex: "(class)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)(extends)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*\\s+)?"
}, },
{ {
"token": "keyword", token: "keyword",
"regex": "(?:super|export|class|extends|import)\\b" regex: "(?:super|export|class|extends|import)\\b"
} }
]; ];