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

View file

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

View file

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

View file

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

View file

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

View file

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

File diff suppressed because one or more lines are too long

View file

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

View file

@ -22,7 +22,7 @@ var StylusHighlightRules = function() {
}, "text", true);
this.$rules = {
"start": [
start: [
{
token : "comment",
regex : /\/\/.*$/
@ -33,24 +33,24 @@ var StylusHighlightRules = function() {
next : "comment"
},
{
"token": ["entity.name.function.stylus", "text"],
"regex": "^([-a-zA-Z_][-\\w]*)?(\\()"
token: ["entity.name.function.stylus", "text"],
regex: "^([-a-zA-Z_][-\\w]*)?(\\()"
},
{
"token": ["entity.other.attribute-name.class.stylus"],
"regex": "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*"
token: ["entity.other.attribute-name.class.stylus"],
regex: "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*"
},
{
"token": ["entity.language.stylus"],
"regex": "^ *&"
token: ["entity.language.stylus"],
regex: "^ *&"
},
{
"token": ["variable.language.stylus"],
"regex": "(arguments)"
token: ["variable.language.stylus"],
regex: "(arguments)"
},
{
"token": ["keyword.stylus"],
"regex": "@[-\\w]+"
token: ["keyword.stylus"],
regex: "@[-\\w]+"
},
{
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
@ -60,8 +60,8 @@ var StylusHighlightRules = function() {
regex : CssHighlightRules.pseudoClasses
},
{
"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)"
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)"
},
{
token : "constant.numeric", // hex6 color
@ -72,24 +72,24 @@ var StylusHighlightRules = function() {
regex : "#[a-f0-9]{3}"
},
{
"token": ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"],
"regex": "(#)([a-zA-Z][a-zA-Z0-9_-]*)"
token: ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"],
regex: "(#)([a-zA-Z][a-zA-Z0-9_-]*)"
},
{
"token": "meta.vendor-prefix.stylus",
"regex": "-webkit-|-moz\\-|-ms-|-o-"
token: "meta.vendor-prefix.stylus",
regex: "-webkit-|-moz\\-|-ms-|-o-"
},
{
"token": "keyword.control.stylus",
"regex": "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b"
token: "keyword.control.stylus",
regex: "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b"
},
{
"token": "keyword.operator.stylus",
"regex": "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!="
token: "keyword.operator.stylus",
regex: "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!="
},
{
"token": "keyword.operator.stylus",
"regex": "(?:in|is(?:nt)?|not)\\b"
token: "keyword.operator.stylus",
regex: "(?:in|is(?:nt)?|not)\\b"
},
{
token : "string",

View file

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