datagram 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.env.sample +7 -0
- data/.gitignore +20 -0
- data/.rbenv-version +1 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +22 -0
- data/Procfile +1 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/config.ru +5 -0
- data/datagram.gemspec +23 -0
- data/db/migrate/1_create_queries.rb +9 -0
- data/db/migrate/2_add_name_to_queries.rb +5 -0
- data/lib/datagram/version.rb +3 -0
- data/lib/datagram.rb +135 -0
- data/lib/views/application.coffee +222 -0
- data/lib/views/index.haml +47 -0
- data/lib/views/layout.haml +17 -0
- data/lib/views/style.sass +179 -0
- data/public/ace/ace.js +15209 -0
- data/public/ace/ext-elastic_tabstops_lite.js +301 -0
- data/public/ace/ext-emmet.js +253 -0
- data/public/ace/ext-searchbox.js +441 -0
- data/public/ace/ext-spellcheck.js +67 -0
- data/public/ace/ext-static_highlight.js +96 -0
- data/public/ace/ext-textarea.js +492 -0
- data/public/ace/ext-whitespace.js +204 -0
- data/public/ace/keybinding-emacs.js +962 -0
- data/public/ace/keybinding-vim.js +1704 -0
- data/public/ace/mode-abap.js +260 -0
- data/public/ace/mode-asciidoc.js +372 -0
- data/public/ace/mode-c9search.js +182 -0
- data/public/ace/mode-c_cpp.js +737 -0
- data/public/ace/mode-clojure.js +299 -0
- data/public/ace/mode-coffee.js +426 -0
- data/public/ace/mode-coldfusion.js +1753 -0
- data/public/ace/mode-csharp.js +612 -0
- data/public/ace/mode-css.js +773 -0
- data/public/ace/mode-curly.js +1950 -0
- data/public/ace/mode-dart.js +945 -0
- data/public/ace/mode-diff.js +166 -0
- data/public/ace/mode-django.js +1969 -0
- data/public/ace/mode-dot.js +320 -0
- data/public/ace/mode-ftl.js +907 -0
- data/public/ace/mode-glsl.js +810 -0
- data/public/ace/mode-golang.js +632 -0
- data/public/ace/mode-groovy.js +1037 -0
- data/public/ace/mode-haml.js +487 -0
- data/public/ace/mode-haxe.js +609 -0
- data/public/ace/mode-html.js +1881 -0
- data/public/ace/mode-jade.js +1951 -0
- data/public/ace/mode-java.js +996 -0
- data/public/ace/mode-javascript.js +876 -0
- data/public/ace/mode-json.js +578 -0
- data/public/ace/mode-jsp.js +1351 -0
- data/public/ace/mode-jsx.js +635 -0
- data/public/ace/mode-latex.js +189 -0
- data/public/ace/mode-less.js +807 -0
- data/public/ace/mode-liquid.js +862 -0
- data/public/ace/mode-lisp.js +138 -0
- data/public/ace/mode-livescript.js +288 -0
- data/public/ace/mode-logiql.js +664 -0
- data/public/ace/mode-lsl.js +828 -0
- data/public/ace/mode-lua.js +455 -0
- data/public/ace/mode-luapage.js +2340 -0
- data/public/ace/mode-lucene.js +64 -0
- data/public/ace/mode-makefile.js +313 -0
- data/public/ace/mode-markdown.js +2280 -0
- data/public/ace/mode-mushcode.js +704 -0
- data/public/ace/mode-mushcode_high_rules.js +569 -0
- data/public/ace/mode-objectivec.js +659 -0
- data/public/ace/mode-ocaml.js +443 -0
- data/public/ace/mode-pascal.js +233 -0
- data/public/ace/mode-perl.js +316 -0
- data/public/ace/mode-pgsql.js +908 -0
- data/public/ace/mode-php.js +2291 -0
- data/public/ace/mode-powershell.js +618 -0
- data/public/ace/mode-python.js +264 -0
- data/public/ace/mode-r.js +404 -0
- data/public/ace/mode-rdoc.js +184 -0
- data/public/ace/mode-rhtml.js +2168 -0
- data/public/ace/mode-ruby.js +431 -0
- data/public/ace/mode-sass.js +442 -0
- data/public/ace/mode-scad.js +670 -0
- data/public/ace/mode-scala.js +1025 -0
- data/public/ace/mode-scheme.js +144 -0
- data/public/ace/mode-scss.js +832 -0
- data/public/ace/mode-sh.js +204 -0
- data/public/ace/mode-sql.js +118 -0
- data/public/ace/mode-stylus.js +483 -0
- data/public/ace/mode-svg.js +1442 -0
- data/public/ace/mode-tcl.js +319 -0
- data/public/ace/mode-tex.js +166 -0
- data/public/ace/mode-text.js +0 -0
- data/public/ace/mode-textile.js +170 -0
- data/public/ace/mode-tmsnippet.js +200 -0
- data/public/ace/mode-toml.js +180 -0
- data/public/ace/mode-typescript.js +961 -0
- data/public/ace/mode-vbscript.js +281 -0
- data/public/ace/mode-velocity.js +962 -0
- data/public/ace/mode-xml.js +789 -0
- data/public/ace/mode-xquery.js +2750 -0
- data/public/ace/mode-yaml.js +289 -0
- data/public/ace/theme-ambiance.js +202 -0
- data/public/ace/theme-chaos.js +182 -0
- data/public/ace/theme-chrome.js +161 -0
- data/public/ace/theme-clouds.js +135 -0
- data/public/ace/theme-clouds_midnight.js +136 -0
- data/public/ace/theme-cobalt.js +150 -0
- data/public/ace/theme-crimson_editor.js +154 -0
- data/public/ace/theme-dawn.js +146 -0
- data/public/ace/theme-dreamweaver.js +173 -0
- data/public/ace/theme-eclipse.js +122 -0
- data/public/ace/theme-github.js +136 -0
- data/public/ace/theme-idle_fingers.js +136 -0
- data/public/ace/theme-kr.js +143 -0
- data/public/ace/theme-merbivore.js +135 -0
- data/public/ace/theme-merbivore_soft.js +136 -0
- data/public/ace/theme-mono_industrial.js +148 -0
- data/public/ace/theme-monokai.js +140 -0
- data/public/ace/theme-pastel_on_dark.js +148 -0
- data/public/ace/theme-solarized_dark.js +128 -0
- data/public/ace/theme-solarized_light.js +131 -0
- data/public/ace/theme-terminal.js +154 -0
- data/public/ace/theme-textmate.js +0 -0
- data/public/ace/theme-tomorrow.js +147 -0
- data/public/ace/theme-tomorrow_night.js +147 -0
- data/public/ace/theme-tomorrow_night_blue.js +145 -0
- data/public/ace/theme-tomorrow_night_bright.js +147 -0
- data/public/ace/theme-tomorrow_night_eighties.js +144 -0
- data/public/ace/theme-twilight.js +147 -0
- data/public/ace/theme-vibrant_ink.js +131 -0
- data/public/ace/theme-xcode.js +125 -0
- data/public/ace/worker-coffee.js +7091 -0
- data/public/ace/worker-css.js +8289 -0
- data/public/ace/worker-javascript.js +6496 -0
- data/public/ace/worker-json.js +2305 -0
- data/public/ace/worker-lua.js +3313 -0
- data/public/ace/worker-php.js +6743 -0
- data/public/ace/worker-xquery.js +21897 -0
- data/public/font/FontAwesome.otf +0 -0
- data/public/font/fontawesome-webfont.eot +0 -0
- data/public/font/fontawesome-webfont.svg +284 -0
- data/public/font/fontawesome-webfont.ttf +0 -0
- data/public/font/fontawesome-webfont.woff +0 -0
- data/public/font-awesome.css +540 -0
- data/public/jquery.js +9597 -0
- data/script/migrate.sh +2 -0
- metadata +242 -0
@@ -0,0 +1,138 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
3
|
+
*
|
4
|
+
* Copyright (c) 2012, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
*
|
29
|
+
*
|
30
|
+
* ***** END LICENSE BLOCK ***** */
|
31
|
+
|
32
|
+
define('ace/mode/lisp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lisp_highlight_rules'], function(require, exports, module) {
|
33
|
+
|
34
|
+
|
35
|
+
var oop = require("../lib/oop");
|
36
|
+
var TextMode = require("./text").Mode;
|
37
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
38
|
+
var LispHighlightRules = require("./lisp_highlight_rules").LispHighlightRules;
|
39
|
+
|
40
|
+
var Mode = function() {
|
41
|
+
var highlighter = new LispHighlightRules();
|
42
|
+
|
43
|
+
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
44
|
+
};
|
45
|
+
oop.inherits(Mode, TextMode);
|
46
|
+
|
47
|
+
(function() {
|
48
|
+
|
49
|
+
this.lineCommentStart = ";";
|
50
|
+
|
51
|
+
}).call(Mode.prototype);
|
52
|
+
|
53
|
+
exports.Mode = Mode;
|
54
|
+
});
|
55
|
+
|
56
|
+
|
57
|
+
define('ace/mode/lisp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
58
|
+
|
59
|
+
|
60
|
+
var oop = require("../lib/oop");
|
61
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
62
|
+
|
63
|
+
var LispHighlightRules = function() {
|
64
|
+
var keywordControl = "case|do|let|loop|if|else|when";
|
65
|
+
var keywordOperator = "eq|neq|and|or";
|
66
|
+
var constantLanguage = "null|nil";
|
67
|
+
var supportFunctions = "cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn";
|
68
|
+
|
69
|
+
var keywordMapper = this.createKeywordMapper({
|
70
|
+
"keyword.control": keywordControl,
|
71
|
+
"keyword.operator": keywordOperator,
|
72
|
+
"constant.language": constantLanguage,
|
73
|
+
"support.function": supportFunctions
|
74
|
+
}, "identifier", true);
|
75
|
+
|
76
|
+
this.$rules =
|
77
|
+
{
|
78
|
+
"start": [
|
79
|
+
{
|
80
|
+
token : "comment",
|
81
|
+
regex : ";.*$"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"],
|
85
|
+
regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"],
|
89
|
+
regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"],
|
93
|
+
regex: "(\\*)(\\S*)(\\*)"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
token : "constant.numeric", // hex
|
97
|
+
regex : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
token : "constant.numeric", // float
|
101
|
+
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
token : keywordMapper,
|
105
|
+
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
106
|
+
},
|
107
|
+
{
|
108
|
+
token : "string",
|
109
|
+
regex : '"(?=.)',
|
110
|
+
next : "qqstring"
|
111
|
+
}
|
112
|
+
],
|
113
|
+
"qqstring": [
|
114
|
+
{
|
115
|
+
token: "constant.character.escape.lisp",
|
116
|
+
regex: "\\\\."
|
117
|
+
},
|
118
|
+
{
|
119
|
+
token : "string",
|
120
|
+
regex : '[^"\\\\]+'
|
121
|
+
}, {
|
122
|
+
token : "string",
|
123
|
+
regex : "\\\\$",
|
124
|
+
next : "qqstring"
|
125
|
+
}, {
|
126
|
+
token : "string",
|
127
|
+
regex : '"|$',
|
128
|
+
next : "start"
|
129
|
+
}
|
130
|
+
]
|
131
|
+
}
|
132
|
+
|
133
|
+
};
|
134
|
+
|
135
|
+
oop.inherits(LispHighlightRules, TextHighlightRules);
|
136
|
+
|
137
|
+
exports.LispHighlightRules = LispHighlightRules;
|
138
|
+
});
|
@@ -0,0 +1,288 @@
|
|
1
|
+
define('ace/mode/livescript', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/text'], function(require, exports, module) {
|
2
|
+
var identifier, LiveScriptMode, keywordend, stringfill;
|
3
|
+
identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*';
|
4
|
+
exports.Mode = LiveScriptMode = (function(superclass){
|
5
|
+
var indenter, prototype = extend$((import$(LiveScriptMode, superclass).displayName = 'LiveScriptMode', LiveScriptMode), superclass).prototype, constructor = LiveScriptMode;
|
6
|
+
function LiveScriptMode(){
|
7
|
+
var that;
|
8
|
+
this.$tokenizer = new (require('../tokenizer')).Tokenizer(LiveScriptMode.Rules);
|
9
|
+
if (that = require('../mode/matching_brace_outdent')) {
|
10
|
+
this.$outdent = new that.MatchingBraceOutdent;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
|
14
|
+
prototype.getNextLineIndent = function(state, line, tab){
|
15
|
+
var indent, tokens;
|
16
|
+
indent = this.$getIndent(line);
|
17
|
+
tokens = this.$tokenizer.getLineTokens(line, state).tokens;
|
18
|
+
if (!(tokens.length && tokens[tokens.length - 1].type === 'comment')) {
|
19
|
+
if (state === 'start' && indenter.test(line)) {
|
20
|
+
indent += tab;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return indent;
|
24
|
+
};
|
25
|
+
prototype.toggleCommentLines = function(state, doc, startRow, endRow){
|
26
|
+
var comment, range, i$, i, out, line;
|
27
|
+
comment = /^(\s*)#/;
|
28
|
+
range = new (require('../range')).Range(0, 0, 0, 0);
|
29
|
+
for (i$ = startRow; i$ <= endRow; ++i$) {
|
30
|
+
i = i$;
|
31
|
+
if (out = comment.test(line = doc.getLine(i))) {
|
32
|
+
line = line.replace(comment, '$1');
|
33
|
+
} else {
|
34
|
+
line = line.replace(/^\s*/, '$&#');
|
35
|
+
}
|
36
|
+
range.end.row = range.start.row = i;
|
37
|
+
range.end.column = line.length + 1;
|
38
|
+
doc.replace(range, line);
|
39
|
+
}
|
40
|
+
return 1 - out * 2;
|
41
|
+
};
|
42
|
+
prototype.checkOutdent = function(state, line, input){
|
43
|
+
var ref$;
|
44
|
+
return (ref$ = this.$outdent) != null ? ref$.checkOutdent(line, input) : void 8;
|
45
|
+
};
|
46
|
+
prototype.autoOutdent = function(state, doc, row){
|
47
|
+
var ref$;
|
48
|
+
return (ref$ = this.$outdent) != null ? ref$.autoOutdent(doc, row) : void 8;
|
49
|
+
};
|
50
|
+
return LiveScriptMode;
|
51
|
+
}(require('../mode/text').Mode));
|
52
|
+
keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))';
|
53
|
+
stringfill = {
|
54
|
+
token: 'string',
|
55
|
+
regex: '.+'
|
56
|
+
};
|
57
|
+
LiveScriptMode.Rules = {
|
58
|
+
start: [
|
59
|
+
{
|
60
|
+
token: 'keyword',
|
61
|
+
regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend
|
62
|
+
}, {
|
63
|
+
token: 'constant.language',
|
64
|
+
regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend
|
65
|
+
}, {
|
66
|
+
token: 'invalid.illegal',
|
67
|
+
regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend
|
68
|
+
}, {
|
69
|
+
token: 'language.support.class',
|
70
|
+
regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend
|
71
|
+
}, {
|
72
|
+
token: 'language.support.function',
|
73
|
+
regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend
|
74
|
+
}, {
|
75
|
+
token: 'variable.language',
|
76
|
+
regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend
|
77
|
+
}, {
|
78
|
+
token: 'identifier',
|
79
|
+
regex: identifier + '\\s*:(?![:=])'
|
80
|
+
}, {
|
81
|
+
token: 'variable',
|
82
|
+
regex: identifier
|
83
|
+
}, {
|
84
|
+
token: 'keyword.operator',
|
85
|
+
regex: '(?:\\.{3}|\\s+\\?)'
|
86
|
+
}, {
|
87
|
+
token: 'keyword.variable',
|
88
|
+
regex: '(?:@+|::|\\.\\.)',
|
89
|
+
next: 'key'
|
90
|
+
}, {
|
91
|
+
token: 'keyword.operator',
|
92
|
+
regex: '\\.\\s*',
|
93
|
+
next: 'key'
|
94
|
+
}, {
|
95
|
+
token: 'string',
|
96
|
+
regex: '\\\\\\S[^\\s,;)}\\]]*'
|
97
|
+
}, {
|
98
|
+
token: 'string.doc',
|
99
|
+
regex: '\'\'\'',
|
100
|
+
next: 'qdoc'
|
101
|
+
}, {
|
102
|
+
token: 'string.doc',
|
103
|
+
regex: '"""',
|
104
|
+
next: 'qqdoc'
|
105
|
+
}, {
|
106
|
+
token: 'string',
|
107
|
+
regex: '\'',
|
108
|
+
next: 'qstring'
|
109
|
+
}, {
|
110
|
+
token: 'string',
|
111
|
+
regex: '"',
|
112
|
+
next: 'qqstring'
|
113
|
+
}, {
|
114
|
+
token: 'string',
|
115
|
+
regex: '`',
|
116
|
+
next: 'js'
|
117
|
+
}, {
|
118
|
+
token: 'string',
|
119
|
+
regex: '<\\[',
|
120
|
+
next: 'words'
|
121
|
+
}, {
|
122
|
+
token: 'string.regex',
|
123
|
+
regex: '//',
|
124
|
+
next: 'heregex'
|
125
|
+
}, {
|
126
|
+
token: 'comment.doc',
|
127
|
+
regex: '/\\*',
|
128
|
+
next: 'comment'
|
129
|
+
}, {
|
130
|
+
token: 'comment',
|
131
|
+
regex: '#.*'
|
132
|
+
}, {
|
133
|
+
token: 'string.regex',
|
134
|
+
regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',
|
135
|
+
next: 'key'
|
136
|
+
}, {
|
137
|
+
token: 'constant.numeric',
|
138
|
+
regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'
|
139
|
+
}, {
|
140
|
+
token: 'lparen',
|
141
|
+
regex: '[({[]'
|
142
|
+
}, {
|
143
|
+
token: 'rparen',
|
144
|
+
regex: '[)}\\]]',
|
145
|
+
next: 'key'
|
146
|
+
}, {
|
147
|
+
token: 'keyword.operator',
|
148
|
+
regex: '\\S+'
|
149
|
+
}, {
|
150
|
+
token: 'text',
|
151
|
+
regex: '\\s+'
|
152
|
+
}
|
153
|
+
],
|
154
|
+
heregex: [
|
155
|
+
{
|
156
|
+
token: 'string.regex',
|
157
|
+
regex: '.*?//[gimy$?]{0,4}',
|
158
|
+
next: 'start'
|
159
|
+
}, {
|
160
|
+
token: 'string.regex',
|
161
|
+
regex: '\\s*#{'
|
162
|
+
}, {
|
163
|
+
token: 'comment.regex',
|
164
|
+
regex: '\\s+(?:#.*)?'
|
165
|
+
}, {
|
166
|
+
token: 'string.regex',
|
167
|
+
regex: '\\S+'
|
168
|
+
}
|
169
|
+
],
|
170
|
+
key: [
|
171
|
+
{
|
172
|
+
token: 'keyword.operator',
|
173
|
+
regex: '[.?@!]+'
|
174
|
+
}, {
|
175
|
+
token: 'identifier',
|
176
|
+
regex: identifier,
|
177
|
+
next: 'start'
|
178
|
+
}, {
|
179
|
+
token: 'text',
|
180
|
+
regex: '.',
|
181
|
+
next: 'start'
|
182
|
+
}
|
183
|
+
],
|
184
|
+
comment: [
|
185
|
+
{
|
186
|
+
token: 'comment.doc',
|
187
|
+
regex: '.*?\\*/',
|
188
|
+
next: 'start'
|
189
|
+
}, {
|
190
|
+
token: 'comment.doc',
|
191
|
+
regex: '.+'
|
192
|
+
}
|
193
|
+
],
|
194
|
+
qdoc: [
|
195
|
+
{
|
196
|
+
token: 'string',
|
197
|
+
regex: ".*?'''",
|
198
|
+
next: 'key'
|
199
|
+
}, stringfill
|
200
|
+
],
|
201
|
+
qqdoc: [
|
202
|
+
{
|
203
|
+
token: 'string',
|
204
|
+
regex: '.*?"""',
|
205
|
+
next: 'key'
|
206
|
+
}, stringfill
|
207
|
+
],
|
208
|
+
qstring: [
|
209
|
+
{
|
210
|
+
token: 'string',
|
211
|
+
regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',
|
212
|
+
next: 'key'
|
213
|
+
}, stringfill
|
214
|
+
],
|
215
|
+
qqstring: [
|
216
|
+
{
|
217
|
+
token: 'string',
|
218
|
+
regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
219
|
+
next: 'key'
|
220
|
+
}, stringfill
|
221
|
+
],
|
222
|
+
js: [
|
223
|
+
{
|
224
|
+
token: 'string',
|
225
|
+
regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',
|
226
|
+
next: 'key'
|
227
|
+
}, stringfill
|
228
|
+
],
|
229
|
+
words: [
|
230
|
+
{
|
231
|
+
token: 'string',
|
232
|
+
regex: '.*?\\]>',
|
233
|
+
next: 'key'
|
234
|
+
}, stringfill
|
235
|
+
]
|
236
|
+
};
|
237
|
+
function extend$(sub, sup){
|
238
|
+
function fun(){} fun.prototype = (sub.superclass = sup).prototype;
|
239
|
+
(sub.prototype = new fun).constructor = sub;
|
240
|
+
if (typeof sup.extended == 'function') sup.extended(sub);
|
241
|
+
return sub;
|
242
|
+
}
|
243
|
+
function import$(obj, src){
|
244
|
+
var own = {}.hasOwnProperty;
|
245
|
+
for (var key in src) if (own.call(src, key)) obj[key] = src[key];
|
246
|
+
return obj;
|
247
|
+
}
|
248
|
+
});
|
249
|
+
|
250
|
+
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
251
|
+
|
252
|
+
|
253
|
+
var Range = require("../range").Range;
|
254
|
+
|
255
|
+
var MatchingBraceOutdent = function() {};
|
256
|
+
|
257
|
+
(function() {
|
258
|
+
|
259
|
+
this.checkOutdent = function(line, input) {
|
260
|
+
if (! /^\s+$/.test(line))
|
261
|
+
return false;
|
262
|
+
|
263
|
+
return /^\s*\}/.test(input);
|
264
|
+
};
|
265
|
+
|
266
|
+
this.autoOutdent = function(doc, row) {
|
267
|
+
var line = doc.getLine(row);
|
268
|
+
var match = line.match(/^(\s*\})/);
|
269
|
+
|
270
|
+
if (!match) return 0;
|
271
|
+
|
272
|
+
var column = match[1].length;
|
273
|
+
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
274
|
+
|
275
|
+
if (!openBracePos || openBracePos.row == row) return 0;
|
276
|
+
|
277
|
+
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
278
|
+
doc.replace(new Range(row, 0, row, column-1), indent);
|
279
|
+
};
|
280
|
+
|
281
|
+
this.$getIndent = function(line) {
|
282
|
+
return line.match(/^\s*/)[0];
|
283
|
+
};
|
284
|
+
|
285
|
+
}).call(MatchingBraceOutdent.prototype);
|
286
|
+
|
287
|
+
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
288
|
+
});
|