This commit is contained in:
Garen Torikian 2012-09-07 16:50:06 -07:00 • committed by nightwing
commit 5a081f748e
3 changed files with 579 additions and 122 deletions

View file

@ -33,24 +33,6 @@
*
* ***** END LICENSE BLOCK ***** */
/*
THIS FILE WAS AUTOGENERATED BY theme_mode.tmpl.js
IT MIGHT NOT BE PERFECT, PARTICULARLY:
IN DECIDING STATES TO TRANSITION TO,
IGNORING WHITESPACE,
EXTENDING EXISTING MODES,
GATHERING KEYWORDS, OR
RULE PREFERENCE ORDER.
...But it's a good start from an existing *.tmlanguage file.
*/
define(function(require, exports, module) {
"use strict";
@ -66,111 +48,63 @@ var JadeHighlightRules = function() {
{
"start": [
{
"token": {
"1": {
"name": "keyword.control.import.include.jade"
}
},
"regex": "^\\s*\\b(include)\\b"
"token": "keyword.control.import.include.jade",
"regex": "^\\s*\\binclude\\b"
},
{
"token": "keyword.other.doctype.jade",
"regex": "^(!!!)(\\s*[a-zA-Z0-9-_]+)?"
"regex": "^!!!\\s*[a-zA-Z0-9-_]+?"
},
{
"token": {
"1": {
"name": "punctuation.section.comment.jade"
}
},
"regex": "^ *(//)\\s*\\S.*$\\n?"
"token": "punctuation.section.comment.jade",
"regex": "^ *//\\s*\\S.*$\\n?"
},
{
"token": {
"2": {
"name": "punctuation.section.comment.jade"
}
},
"regex": "^(\\s*)(//)\\s*$",
"next": "state_4"
"token": "punctuation.section.comment.jade",
"regex": "^\\s*//\\s*$",
"next": "block_comment"
},
/*{
"token": "entity.name.function.jade",
"regex": "^\\s*\\:markdown",
"next": "markdown_filter"
},
{
"token": {
"2": {
"name": "entity.name.function.jade"
}
},
"regex": "^(\\s*)(\\:markdown)",
"next": "state_5"
"token": "entity.name.function.jade",
"regex": "^\\s*\\:sass",
"next": "sass_filter"
},
{
"token": {
"2": {
"name": "entity.name.function.jade"
}
},
"regex": "^(\\s*)(\\:sass)",
"next": "state_6"
"token": "entity.name.function.jade",
"regex": "^\\s*\\:less",
"next": "less_filter"
},
{
"token": {
"2": {
"name": "entity.name.function.jade"
}
},
"regex": "^(\\s*)(\\:less)",
"next": "state_7"
"token": "entity.name.function.jade",
"regex": "^\\s*\\:coffeescript",
"next": "coffeescript_filter"
},
{
"token": {
"2": {
"name": "entity.name.function.jade"
}
},
"regex": "^(\\s*)(\\:coffeescript)",
"next": "state_8"
},
{
"token": {
"2": {
"name": "entity.name.function.jade"
}
},
"regex": "^(\\s*)(\\:cdata)",
"next": "state_9"
},
"token": "entity.name.function.jade",
"regex": "^\\s*\\:cdata",
"next": "cdata_9"
},*/
// match stuff like: mixin dialog-title-desc(title, desc)
{
"token": {
"1": {
"name": "storage.type.function.jade"
},
"2": {
"name": "entity.name.function.jade"
},
"3": {
"name": "punctuation.definition.parameters.begin.jade"
},
"4": {
"name": "variable.parameter.function.jade"
},
"5": {
"name": "punctuation.definition.parameters.end.jade"
}
},
"regex": "^\\s*(mixin) ([\\w\\-]+)\\s*(\\()(.*?)(\\))"
"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*\\()(.*?)(\\))"
},
// match stuff like: mixin dialog-title-desc
{
"token": {
"1": {
"name": "storage.type.function.jade"
},
"2": {
"name": "entity.name.function.jade"
}
},
"regex": "^\\s*(mixin) ([\\w\\-]+)"
"token": ["storage.type.function.jade",
"entity.name.function.jade"
],
"regex": "^(\\s*mixin)( [\\w\\-]+)"
},
{
"regex": "^\\s*(-|=|!=)",
@ -203,23 +137,23 @@ var JadeHighlightRules = function() {
"next": "state_15"
},
{
"regex": "(?<=\\w)\\s*\\(",
"regex": "(?<=\\w)\\s*\\(", // ERROR: This contains a lookbehind, which JS does not support :(",
"next": "state_16"
}
],
"state_4": [
"block_comment": [
{
"token": "TODO",
"regex": "^(?!\\1\\s+)",
"token": "text",
"regex": "^(?!\\1\\s+|$)",
"next": "start"
},
{
"token": "TODO",
"token": "text",
"regex": ".+",
"next": "state_4"
"next": "block_comment"
}
],
"state_5": [
/*"markdown_filter": [
{
"include": "text.html.markdown"
},
@ -229,7 +163,7 @@ var JadeHighlightRules = function() {
"next": "start"
}
],
"state_6": [
"sass_filter": [
{
"include": "source.sass"
},
@ -239,7 +173,7 @@ var JadeHighlightRules = function() {
"next": "start"
}
],
"state_7": [
"less_filter": [
{
"include": "source.css.less"
},
@ -249,7 +183,7 @@ var JadeHighlightRules = function() {
"next": "start"
}
],
"state_8": [
"coffee_filter": [
{
"include": "source.coffee"
},
@ -259,7 +193,7 @@ var JadeHighlightRules = function() {
"next": "start"
}
],
"state_9": [
"cdata_filter": [
{
"token": "TODO",
"regex": "^(?!\\1\\s+)",
@ -270,7 +204,7 @@ var JadeHighlightRules = function() {
"regex": ".+",
"next": "state_9"
}
],
],*/
"state_12": [
{
"include": "source.js"