datagram 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/.env.sample +7 -0
  2. data/.gitignore +20 -0
  3. data/.rbenv-version +1 -0
  4. data/Gemfile +12 -0
  5. data/LICENSE.txt +22 -0
  6. data/Procfile +1 -0
  7. data/README.md +29 -0
  8. data/Rakefile +1 -0
  9. data/config.ru +5 -0
  10. data/datagram.gemspec +23 -0
  11. data/db/migrate/1_create_queries.rb +9 -0
  12. data/db/migrate/2_add_name_to_queries.rb +5 -0
  13. data/lib/datagram/version.rb +3 -0
  14. data/lib/datagram.rb +135 -0
  15. data/lib/views/application.coffee +222 -0
  16. data/lib/views/index.haml +47 -0
  17. data/lib/views/layout.haml +17 -0
  18. data/lib/views/style.sass +179 -0
  19. data/public/ace/ace.js +15209 -0
  20. data/public/ace/ext-elastic_tabstops_lite.js +301 -0
  21. data/public/ace/ext-emmet.js +253 -0
  22. data/public/ace/ext-searchbox.js +441 -0
  23. data/public/ace/ext-spellcheck.js +67 -0
  24. data/public/ace/ext-static_highlight.js +96 -0
  25. data/public/ace/ext-textarea.js +492 -0
  26. data/public/ace/ext-whitespace.js +204 -0
  27. data/public/ace/keybinding-emacs.js +962 -0
  28. data/public/ace/keybinding-vim.js +1704 -0
  29. data/public/ace/mode-abap.js +260 -0
  30. data/public/ace/mode-asciidoc.js +372 -0
  31. data/public/ace/mode-c9search.js +182 -0
  32. data/public/ace/mode-c_cpp.js +737 -0
  33. data/public/ace/mode-clojure.js +299 -0
  34. data/public/ace/mode-coffee.js +426 -0
  35. data/public/ace/mode-coldfusion.js +1753 -0
  36. data/public/ace/mode-csharp.js +612 -0
  37. data/public/ace/mode-css.js +773 -0
  38. data/public/ace/mode-curly.js +1950 -0
  39. data/public/ace/mode-dart.js +945 -0
  40. data/public/ace/mode-diff.js +166 -0
  41. data/public/ace/mode-django.js +1969 -0
  42. data/public/ace/mode-dot.js +320 -0
  43. data/public/ace/mode-ftl.js +907 -0
  44. data/public/ace/mode-glsl.js +810 -0
  45. data/public/ace/mode-golang.js +632 -0
  46. data/public/ace/mode-groovy.js +1037 -0
  47. data/public/ace/mode-haml.js +487 -0
  48. data/public/ace/mode-haxe.js +609 -0
  49. data/public/ace/mode-html.js +1881 -0
  50. data/public/ace/mode-jade.js +1951 -0
  51. data/public/ace/mode-java.js +996 -0
  52. data/public/ace/mode-javascript.js +876 -0
  53. data/public/ace/mode-json.js +578 -0
  54. data/public/ace/mode-jsp.js +1351 -0
  55. data/public/ace/mode-jsx.js +635 -0
  56. data/public/ace/mode-latex.js +189 -0
  57. data/public/ace/mode-less.js +807 -0
  58. data/public/ace/mode-liquid.js +862 -0
  59. data/public/ace/mode-lisp.js +138 -0
  60. data/public/ace/mode-livescript.js +288 -0
  61. data/public/ace/mode-logiql.js +664 -0
  62. data/public/ace/mode-lsl.js +828 -0
  63. data/public/ace/mode-lua.js +455 -0
  64. data/public/ace/mode-luapage.js +2340 -0
  65. data/public/ace/mode-lucene.js +64 -0
  66. data/public/ace/mode-makefile.js +313 -0
  67. data/public/ace/mode-markdown.js +2280 -0
  68. data/public/ace/mode-mushcode.js +704 -0
  69. data/public/ace/mode-mushcode_high_rules.js +569 -0
  70. data/public/ace/mode-objectivec.js +659 -0
  71. data/public/ace/mode-ocaml.js +443 -0
  72. data/public/ace/mode-pascal.js +233 -0
  73. data/public/ace/mode-perl.js +316 -0
  74. data/public/ace/mode-pgsql.js +908 -0
  75. data/public/ace/mode-php.js +2291 -0
  76. data/public/ace/mode-powershell.js +618 -0
  77. data/public/ace/mode-python.js +264 -0
  78. data/public/ace/mode-r.js +404 -0
  79. data/public/ace/mode-rdoc.js +184 -0
  80. data/public/ace/mode-rhtml.js +2168 -0
  81. data/public/ace/mode-ruby.js +431 -0
  82. data/public/ace/mode-sass.js +442 -0
  83. data/public/ace/mode-scad.js +670 -0
  84. data/public/ace/mode-scala.js +1025 -0
  85. data/public/ace/mode-scheme.js +144 -0
  86. data/public/ace/mode-scss.js +832 -0
  87. data/public/ace/mode-sh.js +204 -0
  88. data/public/ace/mode-sql.js +118 -0
  89. data/public/ace/mode-stylus.js +483 -0
  90. data/public/ace/mode-svg.js +1442 -0
  91. data/public/ace/mode-tcl.js +319 -0
  92. data/public/ace/mode-tex.js +166 -0
  93. data/public/ace/mode-text.js +0 -0
  94. data/public/ace/mode-textile.js +170 -0
  95. data/public/ace/mode-tmsnippet.js +200 -0
  96. data/public/ace/mode-toml.js +180 -0
  97. data/public/ace/mode-typescript.js +961 -0
  98. data/public/ace/mode-vbscript.js +281 -0
  99. data/public/ace/mode-velocity.js +962 -0
  100. data/public/ace/mode-xml.js +789 -0
  101. data/public/ace/mode-xquery.js +2750 -0
  102. data/public/ace/mode-yaml.js +289 -0
  103. data/public/ace/theme-ambiance.js +202 -0
  104. data/public/ace/theme-chaos.js +182 -0
  105. data/public/ace/theme-chrome.js +161 -0
  106. data/public/ace/theme-clouds.js +135 -0
  107. data/public/ace/theme-clouds_midnight.js +136 -0
  108. data/public/ace/theme-cobalt.js +150 -0
  109. data/public/ace/theme-crimson_editor.js +154 -0
  110. data/public/ace/theme-dawn.js +146 -0
  111. data/public/ace/theme-dreamweaver.js +173 -0
  112. data/public/ace/theme-eclipse.js +122 -0
  113. data/public/ace/theme-github.js +136 -0
  114. data/public/ace/theme-idle_fingers.js +136 -0
  115. data/public/ace/theme-kr.js +143 -0
  116. data/public/ace/theme-merbivore.js +135 -0
  117. data/public/ace/theme-merbivore_soft.js +136 -0
  118. data/public/ace/theme-mono_industrial.js +148 -0
  119. data/public/ace/theme-monokai.js +140 -0
  120. data/public/ace/theme-pastel_on_dark.js +148 -0
  121. data/public/ace/theme-solarized_dark.js +128 -0
  122. data/public/ace/theme-solarized_light.js +131 -0
  123. data/public/ace/theme-terminal.js +154 -0
  124. data/public/ace/theme-textmate.js +0 -0
  125. data/public/ace/theme-tomorrow.js +147 -0
  126. data/public/ace/theme-tomorrow_night.js +147 -0
  127. data/public/ace/theme-tomorrow_night_blue.js +145 -0
  128. data/public/ace/theme-tomorrow_night_bright.js +147 -0
  129. data/public/ace/theme-tomorrow_night_eighties.js +144 -0
  130. data/public/ace/theme-twilight.js +147 -0
  131. data/public/ace/theme-vibrant_ink.js +131 -0
  132. data/public/ace/theme-xcode.js +125 -0
  133. data/public/ace/worker-coffee.js +7091 -0
  134. data/public/ace/worker-css.js +8289 -0
  135. data/public/ace/worker-javascript.js +6496 -0
  136. data/public/ace/worker-json.js +2305 -0
  137. data/public/ace/worker-lua.js +3313 -0
  138. data/public/ace/worker-php.js +6743 -0
  139. data/public/ace/worker-xquery.js +21897 -0
  140. data/public/font/FontAwesome.otf +0 -0
  141. data/public/font/fontawesome-webfont.eot +0 -0
  142. data/public/font/fontawesome-webfont.svg +284 -0
  143. data/public/font/fontawesome-webfont.ttf +0 -0
  144. data/public/font/fontawesome-webfont.woff +0 -0
  145. data/public/font-awesome.css +540 -0
  146. data/public/jquery.js +9597 -0
  147. data/script/migrate.sh +2 -0
  148. metadata +242 -0
@@ -0,0 +1,442 @@
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Distributed under the BSD license:
3
+ *
4
+ * Copyright (c) 2010, 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
+ * ***** END LICENSE BLOCK ***** */
30
+
31
+ define('ace/mode/sass', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sass_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) {
32
+
33
+
34
+ var oop = require("../lib/oop");
35
+ var TextMode = require("./text").Mode;
36
+ var Tokenizer = require("../tokenizer").Tokenizer;
37
+ var SassHighlightRules = require("./sass_highlight_rules").SassHighlightRules;
38
+ var FoldMode = require("./folding/coffee").FoldMode;
39
+
40
+ var Mode = function() {
41
+ this.$tokenizer = new Tokenizer(new SassHighlightRules().getRules());
42
+ this.foldingRules = new FoldMode();
43
+ };
44
+ oop.inherits(Mode, TextMode);
45
+
46
+ (function() {
47
+ this.lineCommentStart = "//";
48
+ }).call(Mode.prototype);
49
+
50
+ exports.Mode = Mode;
51
+
52
+ });
53
+
54
+ define('ace/mode/sass_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/scss_highlight_rules'], function(require, exports, module) {
55
+
56
+
57
+ var oop = require("../lib/oop");
58
+ var lang = require("../lib/lang");
59
+ var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
60
+
61
+ var SassHighlightRules = function() {
62
+ ScssHighlightRules.call(this);
63
+ var start = this.$rules.start;
64
+ if (start[1].token == "comment") {
65
+ start.splice(1, 1, {
66
+ onMatch: function(value, currentState, stack) {
67
+ stack.unshift(this.next, -1, value.length - 2, currentState);
68
+ return "comment";
69
+ },
70
+ regex: /^\s*\/\*/,
71
+ next: "comment"
72
+ }, {
73
+ token: "error.invalid",
74
+ regex: "/\\*|[{;}]"
75
+ }, {
76
+ token: "support.type",
77
+ regex: /^\s*:[\w\-]+\s/
78
+ });
79
+
80
+ this.$rules.comment = [
81
+ {regex: /^\s*/, onMatch: function(value, currentState, stack) {
82
+ if (stack[1] === -1)
83
+ stack[1] = Math.max(stack[2], value.length - 1);
84
+ if (value.length <= stack[1]) {stack.shift();stack.shift();stack.shift();
85
+ this.next = stack.shift();
86
+ return "text";
87
+ } else {
88
+ this.next = "";
89
+ return "comment";
90
+ }
91
+ }, next: "start"},
92
+ {defaultToken: "comment"}
93
+ ]
94
+ }
95
+ };
96
+
97
+ oop.inherits(SassHighlightRules, ScssHighlightRules);
98
+
99
+ exports.SassHighlightRules = SassHighlightRules;
100
+
101
+ });
102
+
103
+ define('ace/mode/scss_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
104
+
105
+
106
+ var oop = require("../lib/oop");
107
+ var lang = require("../lib/lang");
108
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
109
+
110
+ var ScssHighlightRules = function() {
111
+
112
+ var properties = lang.arrayToMap( (function () {
113
+
114
+ var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
115
+
116
+ var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
117
+ "background-size|binding|border-bottom-colors|border-left-colors|" +
118
+ "border-right-colors|border-top-colors|border-end|border-end-color|" +
119
+ "border-end-style|border-end-width|border-image|border-start|" +
120
+ "border-start-color|border-start-style|border-start-width|box-align|" +
121
+ "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
122
+ "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
123
+ "column-rule-width|column-rule-style|column-rule-color|float-edge|" +
124
+ "font-feature-settings|font-language-override|force-broken-image-icon|" +
125
+ "image-region|margin-end|margin-start|opacity|outline|outline-color|" +
126
+ "outline-offset|outline-radius|outline-radius-bottomleft|" +
127
+ "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
128
+ "outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
129
+ "tab-size|text-blink|text-decoration-color|text-decoration-line|" +
130
+ "text-decoration-style|transform|transform-origin|transition|" +
131
+ "transition-delay|transition-duration|transition-property|" +
132
+ "transition-timing-function|user-focus|user-input|user-modify|user-select|" +
133
+ "window-shadow|border-radius").split("|");
134
+
135
+ var properties = ("azimuth|background-attachment|background-color|background-image|" +
136
+ "background-position|background-repeat|background|border-bottom-color|" +
137
+ "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
138
+ "border-color|border-left-color|border-left-style|border-left-width|" +
139
+ "border-left|border-right-color|border-right-style|border-right-width|" +
140
+ "border-right|border-spacing|border-style|border-top-color|" +
141
+ "border-top-style|border-top-width|border-top|border-width|border|bottom|" +
142
+ "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
143
+ "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
144
+ "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
145
+ "font-stretch|font-style|font-variant|font-weight|font|height|left|" +
146
+ "letter-spacing|line-height|list-style-image|list-style-position|" +
147
+ "list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
148
+ "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
149
+ "min-width|opacity|orphans|outline-color|" +
150
+ "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
151
+ "padding-left|padding-right|padding-top|padding|page-break-after|" +
152
+ "page-break-before|page-break-inside|page|pause-after|pause-before|" +
153
+ "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
154
+ "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
155
+ "stress|table-layout|text-align|text-decoration|text-indent|" +
156
+ "text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
157
+ "visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
158
+ "z-index").split("|");
159
+ var ret = [];
160
+ for (var i=0, ln=browserPrefix.length; i<ln; i++) {
161
+ Array.prototype.push.apply(
162
+ ret,
163
+ (( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
164
+ );
165
+ }
166
+ Array.prototype.push.apply(ret, prefixProperties);
167
+ Array.prototype.push.apply(ret, properties);
168
+
169
+ return ret;
170
+
171
+ })() );
172
+
173
+
174
+
175
+ var functions = lang.arrayToMap(
176
+ ("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" +
177
+ "alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" +
178
+ "floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" +
179
+ "nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" +
180
+ "scale_color|transparentize|type_of|unit|unitless|unqoute").split("|")
181
+ );
182
+
183
+ var constants = lang.arrayToMap(
184
+ ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
185
+ "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
186
+ "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
187
+ "decimal-leading-zero|decimal|default|disabled|disc|" +
188
+ "distribute-all-lines|distribute-letter|distribute-space|" +
189
+ "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
190
+ "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
191
+ "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
192
+ "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
193
+ "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
194
+ "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
195
+ "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
196
+ "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
197
+ "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
198
+ "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
199
+ "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
200
+ "solid|square|static|strict|super|sw-resize|table-footer-group|" +
201
+ "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
202
+ "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
203
+ "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
204
+ "zero").split("|")
205
+ );
206
+
207
+ var colors = lang.arrayToMap(
208
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
209
+ "purple|red|silver|teal|white|yellow").split("|")
210
+ );
211
+
212
+ var keywords = lang.arrayToMap(
213
+ ("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|")
214
+ )
215
+
216
+ var tags = lang.arrayToMap(
217
+ ("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
218
+ "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
219
+ "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
220
+ "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
221
+ "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
222
+ "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
223
+ "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
224
+ "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
225
+ "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
226
+ );
227
+
228
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
229
+
230
+ this.$rules = {
231
+ "start" : [
232
+ {
233
+ token : "comment",
234
+ regex : "\\/\\/.*$"
235
+ },
236
+ {
237
+ token : "comment", // multi line comment
238
+ regex : "\\/\\*",
239
+ next : "comment"
240
+ }, {
241
+ token : "string", // single line
242
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
243
+ }, {
244
+ token : "string", // multi line string start
245
+ regex : '["].*\\\\$',
246
+ next : "qqstring"
247
+ }, {
248
+ token : "string", // single line
249
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
250
+ }, {
251
+ token : "string", // multi line string start
252
+ regex : "['].*\\\\$",
253
+ next : "qstring"
254
+ }, {
255
+ token : "constant.numeric",
256
+ regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
257
+ }, {
258
+ token : "constant.numeric", // hex6 color
259
+ regex : "#[a-f0-9]{6}"
260
+ }, {
261
+ token : "constant.numeric", // hex3 color
262
+ regex : "#[a-f0-9]{3}"
263
+ }, {
264
+ token : "constant.numeric",
265
+ regex : numRe
266
+ }, {
267
+ token : ["support.function", "string", "support.function"],
268
+ regex : "(url\\()(.*)(\\))"
269
+ }, {
270
+ token : function(value) {
271
+ if (properties.hasOwnProperty(value.toLowerCase()))
272
+ return "support.type";
273
+ if (keywords.hasOwnProperty(value))
274
+ return "keyword";
275
+ else if (constants.hasOwnProperty(value))
276
+ return "constant.language";
277
+ else if (functions.hasOwnProperty(value))
278
+ return "support.function";
279
+ else if (colors.hasOwnProperty(value.toLowerCase()))
280
+ return "support.constant.color";
281
+ else if (tags.hasOwnProperty(value.toLowerCase()))
282
+ return "variable.language";
283
+ else
284
+ return "text";
285
+ },
286
+ regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
287
+ }, {
288
+ token : "variable",
289
+ regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b"
290
+ }, {
291
+ token: "variable.language",
292
+ regex: "#[a-z0-9-_]+"
293
+ }, {
294
+ token: "variable.language",
295
+ regex: "\\.[a-z0-9-_]+"
296
+ }, {
297
+ token: "variable.language",
298
+ regex: ":[a-z0-9-_]+"
299
+ }, {
300
+ token: "constant",
301
+ regex: "[a-z0-9-_]+"
302
+ }, {
303
+ token : "keyword.operator",
304
+ regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
305
+ }, {
306
+ token : "paren.lparen",
307
+ regex : "[[({]"
308
+ }, {
309
+ token : "paren.rparen",
310
+ regex : "[\\])}]"
311
+ }, {
312
+ token : "text",
313
+ regex : "\\s+"
314
+ }, {
315
+ caseInsensitive: true
316
+ }
317
+ ],
318
+ "comment" : [
319
+ {
320
+ token : "comment", // closing comment
321
+ regex : ".*?\\*\\/",
322
+ next : "start"
323
+ }, {
324
+ token : "comment", // comment spanning whole line
325
+ regex : ".+"
326
+ }
327
+ ],
328
+ "qqstring" : [
329
+ {
330
+ token : "string",
331
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
332
+ next : "start"
333
+ }, {
334
+ token : "string",
335
+ regex : '.+'
336
+ }
337
+ ],
338
+ "qstring" : [
339
+ {
340
+ token : "string",
341
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
342
+ next : "start"
343
+ }, {
344
+ token : "string",
345
+ regex : '.+'
346
+ }
347
+ ]
348
+ };
349
+ };
350
+
351
+ oop.inherits(ScssHighlightRules, TextHighlightRules);
352
+
353
+ exports.ScssHighlightRules = ScssHighlightRules;
354
+
355
+ });
356
+
357
+ define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
358
+
359
+
360
+ var oop = require("../../lib/oop");
361
+ var BaseFoldMode = require("./fold_mode").FoldMode;
362
+ var Range = require("../../range").Range;
363
+
364
+ var FoldMode = exports.FoldMode = function() {};
365
+ oop.inherits(FoldMode, BaseFoldMode);
366
+
367
+ (function() {
368
+
369
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
370
+ var range = this.indentationBlock(session, row);
371
+ if (range)
372
+ return range;
373
+
374
+ var re = /\S/;
375
+ var line = session.getLine(row);
376
+ var startLevel = line.search(re);
377
+ if (startLevel == -1 || line[startLevel] != "#")
378
+ return;
379
+
380
+ var startColumn = line.length;
381
+ var maxRow = session.getLength();
382
+ var startRow = row;
383
+ var endRow = row;
384
+
385
+ while (++row < maxRow) {
386
+ line = session.getLine(row);
387
+ var level = line.search(re);
388
+
389
+ if (level == -1)
390
+ continue;
391
+
392
+ if (line[level] != "#")
393
+ break;
394
+
395
+ endRow = row;
396
+ }
397
+
398
+ if (endRow > startRow) {
399
+ var endColumn = session.getLine(endRow).length;
400
+ return new Range(startRow, startColumn, endRow, endColumn);
401
+ }
402
+ };
403
+ this.getFoldWidget = function(session, foldStyle, row) {
404
+ var line = session.getLine(row);
405
+ var indent = line.search(/\S/);
406
+ var next = session.getLine(row + 1);
407
+ var prev = session.getLine(row - 1);
408
+ var prevIndent = prev.search(/\S/);
409
+ var nextIndent = next.search(/\S/);
410
+
411
+ if (indent == -1) {
412
+ session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
413
+ return "";
414
+ }
415
+ if (prevIndent == -1) {
416
+ if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
417
+ session.foldWidgets[row - 1] = "";
418
+ session.foldWidgets[row + 1] = "";
419
+ return "start";
420
+ }
421
+ } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
422
+ if (session.getLine(row - 2).search(/\S/) == -1) {
423
+ session.foldWidgets[row - 1] = "start";
424
+ session.foldWidgets[row + 1] = "";
425
+ return "";
426
+ }
427
+ }
428
+
429
+ if (prevIndent!= -1 && prevIndent < indent)
430
+ session.foldWidgets[row - 1] = "start";
431
+ else
432
+ session.foldWidgets[row - 1] = "";
433
+
434
+ if (indent < nextIndent)
435
+ return "start";
436
+ else
437
+ return "";
438
+ };
439
+
440
+ }).call(FoldMode.prototype);
441
+
442
+ });