Merge remote branch 'language_tool' into master
This commit is contained in:
commit
7bbf2c825b
28 changed files with 1127 additions and 98 deletions
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
|
|
@ -83,48 +83,49 @@ Mode.prototype.supportsFile = function(filename) {
|
|||
};
|
||||
|
||||
var modesByName = {
|
||||
c9search: ["C9Search" , "c9search_results"],
|
||||
coffee: ["CoffeeScript" , "coffee|^Cakefile"],
|
||||
coldfusion: ["ColdFusion" , "cfm"],
|
||||
csharp: ["C#" , "cs"],
|
||||
css: ["CSS" , "css"],
|
||||
diff: ["Diff" , "diff|patch"],
|
||||
glsl: ["Glsl" , "glsl|frag|vert"],
|
||||
golang: ["Go" , "go"],
|
||||
groovy: ["Groovy" , "groovy"],
|
||||
haxe: ["haXe" , "hx"],
|
||||
html: ["HTML" , "htm|html|xhtml"],
|
||||
c_cpp: ["C/C++" , "c|cc|cpp|cxx|h|hh|hpp"],
|
||||
clojure: ["Clojure" , "clj"],
|
||||
java: ["Java" , "java"],
|
||||
javascript: ["JavaScript" , "js"],
|
||||
json: ["JSON" , "json"],
|
||||
jsx: ["JSX" , "jsx"],
|
||||
latex: ["LaTeX" , "latex|tex|ltx|bib"],
|
||||
less: ["LESS" , "less"],
|
||||
liquid: ["Liquid" , "liquid"],
|
||||
lua: ["Lua" , "lua"],
|
||||
luapage: ["LuaPage" , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates
|
||||
markdown: ["Markdown" , "md|markdown"],
|
||||
ocaml: ["OCaml" , "ml|mli"],
|
||||
perl: ["Perl" , "pl|pm"],
|
||||
pgsql: ["pgSQL" , "pgsql"],
|
||||
php: ["PHP" , "php|phtml"],
|
||||
powershell: ["Powershell" , "ps1"],
|
||||
python: ["Python" , "py"],
|
||||
ruby: ["Ruby" , "ru|gemspec|rake|rb"],
|
||||
scad: ["OpenSCAD" , "scad"],
|
||||
scala: ["Scala" , "scala"],
|
||||
scss: ["SCSS" , "scss|sass"],
|
||||
sh: ["SH" , "sh|bash|bat"],
|
||||
sql: ["SQL" , "sql"],
|
||||
svg: ["SVG" , "svg"],
|
||||
tcl: ["Tcl" , "tcl"],
|
||||
text: ["Text" , "txt"],
|
||||
textile: ["Textile" , "textile"],
|
||||
xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],
|
||||
xquery: ["XQuery" , "xq"],
|
||||
yaml: ["YAML" , "yaml"]
|
||||
c9search: ["C9Search" , "c9search_results"],
|
||||
coffee: ["CoffeeScript" , "coffee|^Cakefile"],
|
||||
coldfusion: ["ColdFusion" , "cfm"],
|
||||
csharp: ["C#" , "cs"],
|
||||
css: ["CSS" , "css"],
|
||||
diff: ["Diff" , "diff|patch"],
|
||||
glsl: ["Glsl" , "glsl|frag|vert"],
|
||||
golang: ["Go" , "go"],
|
||||
groovy: ["Groovy" , "groovy"],
|
||||
haxe: ["haXe" , "hx"],
|
||||
html: ["HTML" , "htm|html|xhtml"],
|
||||
c_cpp: ["C/C++" , "c|cc|cpp|cxx|h|hh|hpp"],
|
||||
clojure: ["Clojure" , "clj"],
|
||||
jade: ["Jade" , "jade"],
|
||||
java: ["Java" , "java"],
|
||||
javascript: ["JavaScript" , "js"],
|
||||
json: ["JSON" , "json"],
|
||||
jsx: ["JSX" , "jsx"],
|
||||
latex: ["LaTeX" , "latex|tex|ltx|bib"],
|
||||
less: ["LESS" , "less"],
|
||||
liquid: ["Liquid" , "liquid"],
|
||||
lua: ["Lua" , "lua"],
|
||||
luapage: ["LuaPage" , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates
|
||||
markdown: ["Markdown" , "md|markdown"],
|
||||
ocaml: ["OCaml" , "ml|mli"],
|
||||
perl: ["Perl" , "pl|pm"],
|
||||
pgsql: ["pgSQL" , "pgsql"],
|
||||
php: ["PHP" , "php|phtml"],
|
||||
powershell: ["Powershell" , "ps1"],
|
||||
python: ["Python" , "py"],
|
||||
ruby: ["Ruby" , "ru|gemspec|rake|rb"],
|
||||
scad: ["OpenSCAD" , "scad"],
|
||||
scala: ["Scala" , "scala"],
|
||||
scss: ["SCSS" , "scss|sass"],
|
||||
sh: ["SH" , "sh|bash|bat"],
|
||||
sql: ["SQL" , "sql"],
|
||||
svg: ["SVG" , "svg"],
|
||||
tcl: ["Tcl" , "tcl"],
|
||||
text: ["Text" , "txt"],
|
||||
textile: ["Textile" , "textile"],
|
||||
xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],
|
||||
xquery: ["XQuery" , "xq"],
|
||||
yaml: ["YAML" , "yaml"]
|
||||
};
|
||||
|
||||
for (var name in modesByName) {
|
||||
|
|
@ -176,6 +177,7 @@ var docs = {
|
|||
"docs/groovy.groovy": "Groovy",
|
||||
"docs/Haxe.hx": "haXe",
|
||||
"docs/html.html": "HTML",
|
||||
"docs/jade.jade": "Jade",
|
||||
"docs/java.java": "Java",
|
||||
"docs/json.json": "JSON",
|
||||
"docs/jsx.jsx": "JSX",
|
||||
|
|
|
|||
45
demo/kitchen-sink/docs/jade.jade
Normal file
45
demo/kitchen-sink/docs/jade.jade
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
!!!doctype
|
||||
!!!5
|
||||
!!!
|
||||
|
||||
include something
|
||||
|
||||
include another_thing
|
||||
|
||||
// let's talk about it
|
||||
|
||||
//
|
||||
here it is. a block comment!
|
||||
and another row!
|
||||
but not here.
|
||||
|
||||
//
|
||||
a far spaced
|
||||
should be lack of block
|
||||
|
||||
// also not a comment
|
||||
div.attemptAtBlock
|
||||
|
||||
span#myName
|
||||
|
||||
#{implicit}
|
||||
!{more_explicit}
|
||||
|
||||
#idDiv
|
||||
|
||||
.idDiv
|
||||
|
||||
test(id="tag")
|
||||
header(id="tag", blah="foo", meh="aads")
|
||||
mixin article(obj, parents)
|
||||
|
||||
mixin bleh()
|
||||
|
||||
mixin clever-name
|
||||
|
||||
-var x = "0";
|
||||
- y each z
|
||||
|
||||
- var items = ["one", "two", "three"]
|
||||
each item in items
|
||||
li= item
|
||||
|
|
@ -35,29 +35,47 @@ var oop = require("../lib/oop");
|
|||
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
// used by objective-c
|
||||
var cFunctions = exports.cFunctions = "\\s*\\bhypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len)))\\b"
|
||||
|
||||
var c_cppHighlightRules = function() {
|
||||
|
||||
var keywords = (
|
||||
"and|double|not_eq|throw|and_eq|dynamic_cast|operator|true|" +
|
||||
"asm|else|or|try|auto|enum|or_eq|typedef|bitand|explicit|private|" +
|
||||
"typeid|bitor|extern|protected|typename|bool|false|public|union|" +
|
||||
"break|float|register|unsigned|case|fro|reinterpret-cast|using|catch|" +
|
||||
"friend|return|virtual|char|goto|short|void|class|if|signed|volatile|" +
|
||||
"compl|inline|sizeof|wchar_t|const|int|static|while|const-cast|long|" +
|
||||
"static_cast|xor|continue|mutable|struct|xor_eq|default|namespace|" +
|
||||
"switch|delete|new|template|do|not|this|for"
|
||||
var keywordControls = (
|
||||
"break|case|continue|default|do|else|for|goto|if|_Pragma|" +
|
||||
"return|switch|while|catch|operator|try|throw|using"
|
||||
);
|
||||
|
||||
var storageType = (
|
||||
"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
|
||||
"_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void" +
|
||||
"class|wchar_t|template"
|
||||
);
|
||||
|
||||
var buildinConstants = (
|
||||
"NULL"
|
||||
var storageModifiers = (
|
||||
"const|extern|register|restrict|static|volatile|inline|private:|" +
|
||||
"protected:|public:|friend|explicit|virtual|export|mutable|typename"
|
||||
);
|
||||
|
||||
var keywordOperators = (
|
||||
"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" +
|
||||
"const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace"
|
||||
);
|
||||
|
||||
var builtinConstants = (
|
||||
"NULL|true|false|TRUE|FALSE"
|
||||
);
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"keyword.control" : keywordControls,
|
||||
"storage.type" : storageType,
|
||||
"storage.modifier" : storageModifiers,
|
||||
"keyword.operator" : keywordOperators,
|
||||
"variable.language": "this",
|
||||
"keyword": keywords,
|
||||
"constant.language": buildinConstants
|
||||
"constant.language": builtinConstants
|
||||
}, "identifier");
|
||||
|
||||
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
|
||||
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
|
|
@ -101,7 +119,16 @@ var c_cppHighlightRules = function() {
|
|||
}, {
|
||||
token : "keyword", // pre-compiler directivs
|
||||
regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
|
||||
}, {
|
||||
}, {
|
||||
token : "support.function.C99.c",
|
||||
regex : cFunctions
|
||||
}, {
|
||||
// function myFunc(arg) { }
|
||||
token : [
|
||||
"text", "entity.name.function", "text", "paren.lparen"
|
||||
],
|
||||
regex : "(\\s+)(" + identifierRe + ")(\\s*)(\\()"
|
||||
}, {
|
||||
token : keywordMapper,
|
||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||
}, {
|
||||
|
|
|
|||
58
lib/ace/mode/jade.js
Normal file
58
lib/ace/mode/jade.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Garen J. Torikian <gjtorikian @ gmail DOT com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules;
|
||||
// var JavascriptMode = require("ace/mode/javascript").Mode;
|
||||
// var CssMode = require("ace/mode/css").Mode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new JadeHighlightRules();
|
||||
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
327
lib/ace/mode/jade_highlight_rules.js
Normal file
327
lib/ace/mode/jade_highlight_rules.js
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Garen J. Torikian <gjtorikian @ gmail DOT com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: C5B73B98-5F2A-42E3-9F0E-028A74A9FE4B)
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
|
||||
var SassHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
|
||||
var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
|
||||
var CoffeeHighlightRules = require("./coffee_highlight_rules").CoffeeHighlightRules;
|
||||
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
|
||||
function mixin_embed(tag, prefix) {
|
||||
return {
|
||||
token : "entity.name.function.jade",
|
||||
regex : "^\\s*\\:" + tag,
|
||||
next : prefix + "start"
|
||||
};
|
||||
}
|
||||
|
||||
var JadeHighlightRules = function() {
|
||||
|
||||
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
|
||||
"u[0-9a-fA-F]{4}|" + // unicode
|
||||
"[0-2][0-7]{0,2}|" + // oct
|
||||
"3[0-6][0-7]?|" + // oct
|
||||
"37[0-7]?|" + // oct
|
||||
"[4-7][0-7]?|" + //oct
|
||||
".)";
|
||||
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules =
|
||||
{
|
||||
"start": [
|
||||
{
|
||||
"token": "keyword.control.import.include.jade",
|
||||
"regex": "\\s*\\binclude\\b"
|
||||
},
|
||||
{
|
||||
"token": "keyword.other.doctype.jade",
|
||||
"regex": "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
|
||||
},
|
||||
{
|
||||
"token" : "punctuation.section.comment",
|
||||
"regex" : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)",
|
||||
},
|
||||
{
|
||||
"token" : function(space, text) {
|
||||
return "punctuation.section.comment";
|
||||
},
|
||||
"regex" : "^((\\s*)\/\/)(?:\\s*$)",
|
||||
"next": "comment_block"
|
||||
},
|
||||
mixin_embed("markdown", "markdown-"),
|
||||
mixin_embed("sass", "sass-"),
|
||||
mixin_embed("less", "less-"),
|
||||
mixin_embed("coffee", "coffee-"),
|
||||
/*
|
||||
{
|
||||
"token": {
|
||||
"2": {
|
||||
"name": "entity.name.function.jade"
|
||||
}
|
||||
},
|
||||
"regex": "^(\\s*)(\\:cdata)",
|
||||
"next": "state_9"
|
||||
},*/
|
||||
// match stuff like: mixin dialog-title-desc(title, desc)
|
||||
{
|
||||
"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": [ "storage.type.function.jade", "entity.name.function.jade"],
|
||||
"regex": "^(\\s*mixin)( [\\w\\-]+)"
|
||||
},
|
||||
/* {
|
||||
"token": "source.js.embedded.jade",
|
||||
"regex": "^\\s*-|=|!=",
|
||||
"next": "js_code"
|
||||
},*/
|
||||
/*{
|
||||
"token": "entity.name.tag.script.jade",
|
||||
"regex": "^\\s*script",
|
||||
"next": "js_code_tag"
|
||||
},*/
|
||||
{
|
||||
"token": "string.interpolated.jade",
|
||||
"regex": "[#!]\\{[^\\}]+\\}"
|
||||
},
|
||||
// Match any tag, id or class. skip AST filters
|
||||
{
|
||||
"token": ["meta.tag.any.jade", "entity.variable.tag.jade"],
|
||||
"regex": /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/,
|
||||
"next": "tag_single"
|
||||
},
|
||||
{
|
||||
"token": "suport.type.attribute.id.jade",
|
||||
"regex": "#\\w+"
|
||||
},
|
||||
{
|
||||
"token": "suport.type.attribute.class.jade",
|
||||
"regex": "\\.\\w+"
|
||||
},
|
||||
{
|
||||
"token": "punctuation",
|
||||
"regex": "\\s*(?:\\()",
|
||||
"next": "tag_attributes"
|
||||
}
|
||||
],
|
||||
"comment_block": [
|
||||
{
|
||||
"token": function(text) {
|
||||
return "text";
|
||||
},
|
||||
"regex": "^(\\1\\S|$)",
|
||||
"captures": "1",
|
||||
"next": "start"
|
||||
},
|
||||
{
|
||||
"token": "comment.block.jade",
|
||||
"merge" : true,
|
||||
"regex" : ".+"
|
||||
}
|
||||
],
|
||||
/*
|
||||
|
||||
"state_9": [
|
||||
{
|
||||
"token": "TODO",
|
||||
"regex": "^(?!\\1\\s+)",
|
||||
"next": "start"
|
||||
},
|
||||
{
|
||||
"token": "TODO",
|
||||
"regex": ".+",
|
||||
"next": "state_9"
|
||||
}
|
||||
],*/
|
||||
/*"js_code": [
|
||||
{
|
||||
"token": "keyword.control.js",
|
||||
"regex": "\\beach\\b"
|
||||
},
|
||||
{
|
||||
"token": "text",
|
||||
"regex": "$",
|
||||
"next": "start"
|
||||
}
|
||||
],*/
|
||||
/*"js_code_tag": [
|
||||
{
|
||||
"include": "source.js"
|
||||
},
|
||||
{
|
||||
"token": "TODO",
|
||||
"regex": "^((?=(\\1)([\\w#\\.]|$\\n?))|^$\\n?)",
|
||||
"next": "start"
|
||||
}
|
||||
],*/
|
||||
"tag_single": [
|
||||
{
|
||||
"token": "suport.type.attribute.class.jade",
|
||||
"regex": "\\.[\\w-]+"
|
||||
},
|
||||
{
|
||||
"token": "suport.type.attribute.id.jade",
|
||||
"regex": "#[\\w-]+"
|
||||
},
|
||||
{
|
||||
"token": ["text", "punctuation"],
|
||||
"regex": "($)|((?!\\.|#|=|-))",
|
||||
"next": "start"
|
||||
}
|
||||
],
|
||||
"tag_attributes": [
|
||||
{
|
||||
"token": ["entity.other.attribute-name.jade", "punctuation"],
|
||||
"regex": "\\b([a-zA-Z:\\.-]+)(=)",
|
||||
"next": "attribute_strings"
|
||||
},
|
||||
{
|
||||
"token": "punctuation",
|
||||
"regex": "\\)",
|
||||
"next": "start"
|
||||
}
|
||||
],
|
||||
"attribute_strings": [
|
||||
{
|
||||
"token" : "string",
|
||||
"regex" : "'(?=.)",
|
||||
"next" : "qstring"
|
||||
},
|
||||
{
|
||||
"token" : "string",
|
||||
"regex" : '"(?=.)',
|
||||
"next" : "qqstring"
|
||||
}
|
||||
],
|
||||
"qqstring" : [
|
||||
{
|
||||
token : "constant.language.escape",
|
||||
regex : escapedRe
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '[^"\\\\]+',
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "\\\\$",
|
||||
next : "qqstring",
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"|$',
|
||||
next : "tag_attributes",
|
||||
merge : true
|
||||
}
|
||||
],
|
||||
"qstring" : [
|
||||
{
|
||||
token : "constant.language.escape",
|
||||
regex : escapedRe
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "[^'\\\\]+",
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "\\\\$",
|
||||
next : "qstring",
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "'|$",
|
||||
next : "tag_attributes",
|
||||
merge : true
|
||||
}
|
||||
]
|
||||
};
|
||||
/*
|
||||
this.embedRules(MarkdownHighlightRules, "markdown-", [{
|
||||
token : "support.function",
|
||||
regex : "^\\1\\s+",
|
||||
captures: "1",
|
||||
next : "start"
|
||||
}]);
|
||||
|
||||
this.embedRules(SassHighlightRules, "sass-", [{
|
||||
token : "support.function",
|
||||
regex : "^(?!\\1\\s+)",
|
||||
captures: "1",
|
||||
next : "start"
|
||||
}]);
|
||||
|
||||
this.embedRules(LessHighlightRules, "less-", [{
|
||||
token : "support.function",
|
||||
regex : "^(?!\\1\\s+)",
|
||||
captures: "1",
|
||||
next : "start"
|
||||
}]);
|
||||
|
||||
this.embedRules(CoffeeHighlightRules, "coffee-", [{
|
||||
token : "support.function",
|
||||
regex : "^(?!\\1\\s+)",
|
||||
captures: "1",
|
||||
next : "start"
|
||||
}]);
|
||||
|
||||
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
||||
token : "support.function",
|
||||
regex : "$",
|
||||
captures: "1",
|
||||
next : "start"
|
||||
}]); */
|
||||
};
|
||||
|
||||
oop.inherits(JadeHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.JadeHighlightRules = JadeHighlightRules;
|
||||
});
|
||||
|
|
@ -62,7 +62,8 @@
|
|||
}
|
||||
|
||||
.ace-chrome .ace_line .ace_support.ace_type,
|
||||
.ace-chrome .ace_line .ace_support.ace_class {
|
||||
.ace-chrome .ace_line .ace_support.ace_class
|
||||
.ace-chrome .ace_line .ace_support.ace_other, {
|
||||
color: rgb(109, 121, 222);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@
|
|||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-chrome";
|
||||
exports.cssText = require('ace/requirejs/text!./chrome.css');
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
.ace-clouds .ace_editor {
|
||||
border: 2px solid rgb(159, 159, 159);
|
||||
}
|
||||
|
|
@ -93,7 +92,10 @@
|
|||
border-color: #000000;
|
||||
}
|
||||
|
||||
.ace-clouds .ace_support.ace_function {
|
||||
.ace-clouds .ace_support.ace_function,
|
||||
.ace-clouds .ace_support.ace_class,
|
||||
.ace-clouds .ace_support.ace_type,
|
||||
.ace-clouds .ace_support.ace_other {
|
||||
color:#C52727;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,10 @@ background-color:#E92E2E;
|
|||
border-color: #929292;
|
||||
}
|
||||
|
||||
.ace-clouds-midnight .ace_support.ace_function {
|
||||
.ace-clouds-midnight .ace_support.ace_function,
|
||||
.ace-clouds-midnight .ace_support.ace_class,
|
||||
.ace-clouds-midnight .ace_support.ace_type,
|
||||
.ace-clouds-midnight .ace_support.ace_other {
|
||||
color:#E92E2E;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
.ace-cobalt .ace_editor {
|
||||
border: 2px solid rgb(159, 159, 159);
|
||||
}
|
||||
|
|
@ -57,7 +56,7 @@
|
|||
}
|
||||
|
||||
.ace-cobalt .ace_gutter_active_line {
|
||||
background-color : rgba(0, 0, 0, 0.35);
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.ace-cobalt .ace_marker-layer .ace_selected_word {
|
||||
|
|
@ -143,7 +142,6 @@ background-color:#001221;
|
|||
.ace-cobalt .ace_markup.ace_list {
|
||||
background-color:#130D26;
|
||||
}
|
||||
|
||||
.ace-cobalt .ace_indent-guide {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUHL4zzBz5sz/AA80BCzv+WXhAAAAAElFTkSuQmCC) right repeat-y;
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
}
|
||||
|
||||
.ace-merbivore .ace_gutter_active_line {
|
||||
background-color : #333435;
|
||||
background-color: #333435;
|
||||
}
|
||||
|
||||
.ace-merbivore .ace_marker-layer .ace_selected_word {
|
||||
|
|
@ -114,6 +114,10 @@ background-color:#990000;
|
|||
color:#FC6F09;
|
||||
}
|
||||
|
||||
.ace-merbivore .ace_support.ace_type {
|
||||
color:#1EDAFB;
|
||||
}
|
||||
|
||||
.ace-merbivore .ace_storage {
|
||||
color:#FC6F09;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,10 @@ background-color:#FE3838;
|
|||
border-color: #E6E1DC;
|
||||
}
|
||||
|
||||
.ace-merbivore-soft .ace_support.ace_type {
|
||||
color:#68C1D8;
|
||||
}
|
||||
|
||||
.ace-merbivore-soft .ace_storage {
|
||||
color:#FC803A;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,14 @@ background-color:rgba(153, 0, 0, 0.68);
|
|||
color:#588E60;
|
||||
}
|
||||
|
||||
.ace-mono-industrial .ace_support.ace_type {
|
||||
color:#5778B6;
|
||||
}
|
||||
|
||||
.ace-mono-industrial .ace_support.ace_class {
|
||||
color:#5778B6;
|
||||
}
|
||||
|
||||
.ace-mono-industrial .ace_storage {
|
||||
color:#C23B00;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
.ace-monokai .ace_marker-layer .ace_active_line {
|
||||
background: #49483E;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_gutter_active_line {
|
||||
background-color: #191916;
|
||||
}
|
||||
|
|
@ -71,6 +72,10 @@
|
|||
color:#F92672;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_constant.ace_character {
|
||||
color:#AE81FF;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_constant.ace_language {
|
||||
color:#AE81FF;
|
||||
}
|
||||
|
|
@ -106,6 +111,16 @@ background-color:#AE81FF;
|
|||
color:#66D9EF;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_support.ace_type {
|
||||
font-style:italic;
|
||||
color:#66D9EF;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_support.ace_class {
|
||||
font-style:italic;
|
||||
color:#66D9EF;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_storage {
|
||||
color:#F92672;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@
|
|||
color:#859900;
|
||||
}
|
||||
|
||||
.ace-solarized-dark .ace_constant.ace_character {
|
||||
color:#CB4B16;
|
||||
}
|
||||
|
||||
.ace-solarized-dark .ace_constant.ace_language {
|
||||
color:#B58900;
|
||||
}
|
||||
|
|
@ -93,6 +97,14 @@
|
|||
color:#268BD2;
|
||||
}
|
||||
|
||||
.ace-solarized-dark .ace_support.ace_type {
|
||||
color:#859900;
|
||||
}
|
||||
|
||||
.ace-solarized-dark .ace_support.ace_class {
|
||||
color:#859900;
|
||||
}
|
||||
|
||||
.ace-solarized-dark .ace_storage {
|
||||
color:#93A1A1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@
|
|||
color:#859900;
|
||||
}
|
||||
|
||||
.ace-solarized-light .ace_constant.ace_character {
|
||||
color:#CB4B16;
|
||||
}
|
||||
|
||||
.ace-solarized-light .ace_constant.ace_language {
|
||||
color:#B58900;
|
||||
}
|
||||
|
|
@ -93,6 +97,14 @@
|
|||
color:#268BD2;
|
||||
}
|
||||
|
||||
.ace-solarized-light .ace_support.ace_type {
|
||||
color:#859900;
|
||||
}
|
||||
|
||||
.ace-solarized-light .ace_support.ace_class {
|
||||
color:#859900;
|
||||
}
|
||||
|
||||
.ace-solarized-light .ace_storage {
|
||||
color:#073642;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@
|
|||
color:#3E999F;
|
||||
}
|
||||
|
||||
.ace-tomorrow .ace_constant.ace_character {
|
||||
color:#F5871F;
|
||||
}
|
||||
|
||||
.ace-tomorrow .ace_constant.ace_language {
|
||||
color:#F5871F;
|
||||
}
|
||||
|
|
@ -111,6 +115,14 @@ background-color:#8959A8;
|
|||
color:#4271AE;
|
||||
}
|
||||
|
||||
.ace-tomorrow .ace_support.ace_type {
|
||||
color:#C99E00;
|
||||
}
|
||||
|
||||
.ace-tomorrow .ace_support.ace_class {
|
||||
color:#C99E00;
|
||||
}
|
||||
|
||||
.ace-tomorrow .ace_storage {
|
||||
color:#8959A8;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@
|
|||
color:#8ABEB7;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night .ace_constant.ace_character {
|
||||
color:#DE935F;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night .ace_constant.ace_language {
|
||||
color:#DE935F;
|
||||
}
|
||||
|
|
@ -111,6 +115,14 @@ background-color:#B798BF;
|
|||
color:#81A2BE;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night .ace_support.ace_type {
|
||||
color:#F0C674;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night .ace_support.ace_class {
|
||||
color:#F0C674;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night .ace_storage {
|
||||
color:#B294BB;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@
|
|||
color:#99FFFF;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_character {
|
||||
color:#FFC58F;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-blue .ace_constant.ace_language {
|
||||
color:#FFC58F;
|
||||
}
|
||||
|
|
@ -111,6 +115,14 @@ background-color:#EBBBFF;
|
|||
color:#BBDAFF;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-blue .ace_support.ace_type {
|
||||
color:#FFEEAD;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-blue .ace_support.ace_class {
|
||||
color:#FFEEAD;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-blue .ace_storage {
|
||||
color:#EBBBFF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@
|
|||
color:#70C0B1;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-bright .ace_constant.ace_character {
|
||||
color:#E78C45;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-bright .ace_constant.ace_language {
|
||||
color:#E78C45;
|
||||
}
|
||||
|
|
@ -111,6 +115,14 @@ background-color:#B798BF;
|
|||
color:#7AA6DA;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-bright .ace_support.ace_type {
|
||||
color:#E7C547;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-bright .ace_support.ace_class {
|
||||
color:#E7C547;
|
||||
}
|
||||
|
||||
.ace-tomorrow-night-bright .ace_storage {
|
||||
color:#C397D8;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue