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,1037 @@
1
+ define('ace/mode/groovy', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/groovy_highlight_rules'], function(require, exports, module) {
2
+
3
+
4
+ var oop = require("../lib/oop");
5
+ var JavaScriptMode = require("./javascript").Mode;
6
+ var Tokenizer = require("../tokenizer").Tokenizer;
7
+ var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules;
8
+
9
+ var Mode = function() {
10
+ JavaScriptMode.call(this);
11
+ this.$tokenizer = new Tokenizer(new GroovyHighlightRules().getRules());
12
+ };
13
+ oop.inherits(Mode, JavaScriptMode);
14
+
15
+ (function() {
16
+
17
+ this.createWorker = function(session) {
18
+ return null;
19
+ };
20
+
21
+ }).call(Mode.prototype);
22
+
23
+ exports.Mode = Mode;
24
+ });
25
+
26
+ define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
27
+
28
+
29
+ var oop = require("../lib/oop");
30
+ var TextMode = require("./text").Mode;
31
+ var Tokenizer = require("../tokenizer").Tokenizer;
32
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
33
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
34
+ var Range = require("../range").Range;
35
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
36
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
37
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
38
+
39
+ var Mode = function() {
40
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
41
+ this.$outdent = new MatchingBraceOutdent();
42
+ this.$behaviour = new CstyleBehaviour();
43
+ this.foldingRules = new CStyleFoldMode();
44
+ };
45
+ oop.inherits(Mode, TextMode);
46
+
47
+ (function() {
48
+
49
+ this.lineCommentStart = "//";
50
+ this.blockComment = {start: "/*", end: "*/"};
51
+
52
+ this.getNextLineIndent = function(state, line, tab) {
53
+ var indent = this.$getIndent(line);
54
+
55
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
56
+ var tokens = tokenizedLine.tokens;
57
+ var endState = tokenizedLine.state;
58
+
59
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
60
+ return indent;
61
+ }
62
+
63
+ if (state == "start" || state == "no_regex") {
64
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
65
+ if (match) {
66
+ indent += tab;
67
+ }
68
+ } else if (state == "doc-start") {
69
+ if (endState == "start" || endState == "no_regex") {
70
+ return "";
71
+ }
72
+ var match = line.match(/^\s*(\/?)\*/);
73
+ if (match) {
74
+ if (match[1]) {
75
+ indent += " ";
76
+ }
77
+ indent += "* ";
78
+ }
79
+ }
80
+
81
+ return indent;
82
+ };
83
+
84
+ this.checkOutdent = function(state, line, input) {
85
+ return this.$outdent.checkOutdent(line, input);
86
+ };
87
+
88
+ this.autoOutdent = function(state, doc, row) {
89
+ this.$outdent.autoOutdent(doc, row);
90
+ };
91
+
92
+ this.createWorker = function(session) {
93
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
94
+ worker.attachToDocument(session.getDocument());
95
+
96
+ worker.on("jslint", function(results) {
97
+ session.setAnnotations(results.data);
98
+ });
99
+
100
+ worker.on("terminate", function() {
101
+ session.clearAnnotations();
102
+ });
103
+
104
+ return worker;
105
+ };
106
+
107
+ }).call(Mode.prototype);
108
+
109
+ exports.Mode = Mode;
110
+ });
111
+
112
+ define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
113
+
114
+
115
+ var oop = require("../lib/oop");
116
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
117
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
118
+
119
+ var JavaScriptHighlightRules = function() {
120
+ var keywordMapper = this.createKeywordMapper({
121
+ "variable.language":
122
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
123
+ "Namespace|QName|XML|XMLList|" + // E4X
124
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
125
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
126
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
127
+ "SyntaxError|TypeError|URIError|" +
128
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
129
+ "isNaN|parseFloat|parseInt|" +
130
+ "JSON|Math|" + // Other
131
+ "this|arguments|prototype|window|document" , // Pseudo
132
+ "keyword":
133
+ "const|yield|import|get|set|" +
134
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
135
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
136
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
137
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
138
+ "storage.type":
139
+ "const|let|var|function",
140
+ "constant.language":
141
+ "null|Infinity|NaN|undefined",
142
+ "support.function":
143
+ "alert",
144
+ "constant.language.boolean": "true|false"
145
+ }, "identifier");
146
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
147
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
148
+
149
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
150
+ "u[0-9a-fA-F]{4}|" + // unicode
151
+ "[0-2][0-7]{0,2}|" + // oct
152
+ "3[0-6][0-7]?|" + // oct
153
+ "37[0-7]?|" + // oct
154
+ "[4-7][0-7]?|" + //oct
155
+ ".)";
156
+
157
+ this.$rules = {
158
+ "no_regex" : [
159
+ {
160
+ token : "comment",
161
+ regex : /\/\/.*$/
162
+ },
163
+ DocCommentHighlightRules.getStartRule("doc-start"),
164
+ {
165
+ token : "comment", // multi line comment
166
+ regex : /\/\*/,
167
+ next : "comment"
168
+ }, {
169
+ token : "string",
170
+ regex : "'(?=.)",
171
+ next : "qstring"
172
+ }, {
173
+ token : "string",
174
+ regex : '"(?=.)',
175
+ next : "qqstring"
176
+ }, {
177
+ token : "constant.numeric", // hex
178
+ regex : /0[xX][0-9a-fA-F]+\b/
179
+ }, {
180
+ token : "constant.numeric", // float
181
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
182
+ }, {
183
+ token : [
184
+ "storage.type", "punctuation.operator", "support.function",
185
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
186
+ ],
187
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
188
+ next: "function_arguments"
189
+ }, {
190
+ token : [
191
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
192
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
193
+ ],
194
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
195
+ next: "function_arguments"
196
+ }, {
197
+ token : [
198
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
199
+ "text", "paren.lparen"
200
+ ],
201
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
202
+ next: "function_arguments"
203
+ }, {
204
+ token : [
205
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
206
+ "keyword.operator", "text",
207
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
208
+ ],
209
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
210
+ next: "function_arguments"
211
+ }, {
212
+ token : [
213
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
214
+ ],
215
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
216
+ next: "function_arguments"
217
+ }, {
218
+ token : [
219
+ "entity.name.function", "text", "punctuation.operator",
220
+ "text", "storage.type", "text", "paren.lparen"
221
+ ],
222
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
223
+ next: "function_arguments"
224
+ }, {
225
+ token : [
226
+ "text", "text", "storage.type", "text", "paren.lparen"
227
+ ],
228
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
229
+ next: "function_arguments"
230
+ }, {
231
+ token : "keyword",
232
+ regex : "(?:" + kwBeforeRe + ")\\b",
233
+ next : "start"
234
+ }, {
235
+ token : ["punctuation.operator", "support.function"],
236
+ regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
237
+ }, {
238
+ token : ["punctuation.operator", "support.function.dom"],
239
+ regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
240
+ }, {
241
+ token : ["punctuation.operator", "support.constant"],
242
+ regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
243
+ }, {
244
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
245
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
246
+ }, {
247
+ token : keywordMapper,
248
+ regex : identifierRe
249
+ }, {
250
+ token : "keyword.operator",
251
+ regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
252
+ next : "start"
253
+ }, {
254
+ token : "punctuation.operator",
255
+ regex : /\?|\:|\,|\;|\./,
256
+ next : "start"
257
+ }, {
258
+ token : "paren.lparen",
259
+ regex : /[\[({]/,
260
+ next : "start"
261
+ }, {
262
+ token : "paren.rparen",
263
+ regex : /[\])}]/
264
+ }, {
265
+ token : "keyword.operator",
266
+ regex : /\/=?/,
267
+ next : "start"
268
+ }, {
269
+ token: "comment",
270
+ regex: /^#!.*$/
271
+ }
272
+ ],
273
+ "start": [
274
+ DocCommentHighlightRules.getStartRule("doc-start"),
275
+ {
276
+ token : "comment", // multi line comment
277
+ regex : "\\/\\*",
278
+ next : "comment_regex_allowed"
279
+ }, {
280
+ token : "comment",
281
+ regex : "\\/\\/.*$",
282
+ next : "start"
283
+ }, {
284
+ token: "string.regexp",
285
+ regex: "\\/",
286
+ next: "regex"
287
+ }, {
288
+ token : "text",
289
+ regex : "\\s+|^$",
290
+ next : "start"
291
+ }, {
292
+ token: "empty",
293
+ regex: "",
294
+ next: "no_regex"
295
+ }
296
+ ],
297
+ "regex": [
298
+ {
299
+ token: "regexp.keyword.operator",
300
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
301
+ }, {
302
+ token: "string.regexp",
303
+ regex: "/\\w*",
304
+ next: "no_regex"
305
+ }, {
306
+ token : "invalid",
307
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
308
+ }, {
309
+ token : "constant.language.escape",
310
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/
311
+ }, {
312
+ token : "constant.language.delimiter",
313
+ regex: /\|/
314
+ }, {
315
+ token: "constant.language.escape",
316
+ regex: /\[\^?/,
317
+ next: "regex_character_class"
318
+ }, {
319
+ token: "empty",
320
+ regex: "$",
321
+ next: "no_regex"
322
+ }, {
323
+ defaultToken: "string.regexp"
324
+ }
325
+ ],
326
+ "regex_character_class": [
327
+ {
328
+ token: "regexp.keyword.operator",
329
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
330
+ }, {
331
+ token: "constant.language.escape",
332
+ regex: "]",
333
+ next: "regex"
334
+ }, {
335
+ token: "constant.language.escape",
336
+ regex: "-"
337
+ }, {
338
+ token: "empty",
339
+ regex: "$",
340
+ next: "no_regex"
341
+ }, {
342
+ defaultToken: "string.regexp.charachterclass"
343
+ }
344
+ ],
345
+ "function_arguments": [
346
+ {
347
+ token: "variable.parameter",
348
+ regex: identifierRe
349
+ }, {
350
+ token: "punctuation.operator",
351
+ regex: "[, ]+"
352
+ }, {
353
+ token: "punctuation.operator",
354
+ regex: "$"
355
+ }, {
356
+ token: "empty",
357
+ regex: "",
358
+ next: "no_regex"
359
+ }
360
+ ],
361
+ "comment_regex_allowed" : [
362
+ {token : "comment", regex : "\\*\\/", next : "start"},
363
+ {defaultToken : "comment"}
364
+ ],
365
+ "comment" : [
366
+ {token : "comment", regex : "\\*\\/", next : "no_regex"},
367
+ {defaultToken : "comment"}
368
+ ],
369
+ "qqstring" : [
370
+ {
371
+ token : "constant.language.escape",
372
+ regex : escapedRe
373
+ }, {
374
+ token : "string",
375
+ regex : "\\\\$",
376
+ next : "qqstring"
377
+ }, {
378
+ token : "string",
379
+ regex : '"|$',
380
+ next : "no_regex"
381
+ }, {
382
+ defaultToken: "string"
383
+ }
384
+ ],
385
+ "qstring" : [
386
+ {
387
+ token : "constant.language.escape",
388
+ regex : escapedRe
389
+ }, {
390
+ token : "string",
391
+ regex : "\\\\$",
392
+ next : "qstring"
393
+ }, {
394
+ token : "string",
395
+ regex : "'|$",
396
+ next : "no_regex"
397
+ }, {
398
+ defaultToken: "string"
399
+ }
400
+ ]
401
+ };
402
+
403
+ this.embedRules(DocCommentHighlightRules, "doc-",
404
+ [ DocCommentHighlightRules.getEndRule("no_regex") ]);
405
+ };
406
+
407
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
408
+
409
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
410
+ });
411
+
412
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
413
+
414
+
415
+ var oop = require("../lib/oop");
416
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
417
+
418
+ var DocCommentHighlightRules = function() {
419
+
420
+ this.$rules = {
421
+ "start" : [ {
422
+ token : "comment.doc.tag",
423
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
424
+ }, {
425
+ token : "comment.doc.tag",
426
+ regex : "\\bTODO\\b"
427
+ }, {
428
+ defaultToken : "comment.doc"
429
+ }]
430
+ };
431
+ };
432
+
433
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
434
+
435
+ DocCommentHighlightRules.getStartRule = function(start) {
436
+ return {
437
+ token : "comment.doc", // doc comment
438
+ regex : "\\/\\*(?=\\*)",
439
+ next : start
440
+ };
441
+ };
442
+
443
+ DocCommentHighlightRules.getEndRule = function (start) {
444
+ return {
445
+ token : "comment.doc", // closing comment
446
+ regex : "\\*\\/",
447
+ next : start
448
+ };
449
+ };
450
+
451
+
452
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
453
+
454
+ });
455
+
456
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
457
+
458
+
459
+ var Range = require("../range").Range;
460
+
461
+ var MatchingBraceOutdent = function() {};
462
+
463
+ (function() {
464
+
465
+ this.checkOutdent = function(line, input) {
466
+ if (! /^\s+$/.test(line))
467
+ return false;
468
+
469
+ return /^\s*\}/.test(input);
470
+ };
471
+
472
+ this.autoOutdent = function(doc, row) {
473
+ var line = doc.getLine(row);
474
+ var match = line.match(/^(\s*\})/);
475
+
476
+ if (!match) return 0;
477
+
478
+ var column = match[1].length;
479
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
480
+
481
+ if (!openBracePos || openBracePos.row == row) return 0;
482
+
483
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
484
+ doc.replace(new Range(row, 0, row, column-1), indent);
485
+ };
486
+
487
+ this.$getIndent = function(line) {
488
+ return line.match(/^\s*/)[0];
489
+ };
490
+
491
+ }).call(MatchingBraceOutdent.prototype);
492
+
493
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
494
+ });
495
+
496
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
497
+
498
+
499
+ var oop = require("../../lib/oop");
500
+ var Behaviour = require("../behaviour").Behaviour;
501
+ var TokenIterator = require("../../token_iterator").TokenIterator;
502
+ var lang = require("../../lib/lang");
503
+
504
+ var SAFE_INSERT_IN_TOKENS =
505
+ ["text", "paren.rparen", "punctuation.operator"];
506
+ var SAFE_INSERT_BEFORE_TOKENS =
507
+ ["text", "paren.rparen", "punctuation.operator", "comment"];
508
+
509
+
510
+ var autoInsertedBrackets = 0;
511
+ var autoInsertedRow = -1;
512
+ var autoInsertedLineEnd = "";
513
+ var maybeInsertedBrackets = 0;
514
+ var maybeInsertedRow = -1;
515
+ var maybeInsertedLineStart = "";
516
+ var maybeInsertedLineEnd = "";
517
+
518
+ var CstyleBehaviour = function () {
519
+
520
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
521
+ var cursor = editor.getCursorPosition();
522
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
523
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
524
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
525
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
526
+ return false;
527
+ }
528
+ iterator.stepForward();
529
+ return iterator.getCurrentTokenRow() !== cursor.row ||
530
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
531
+ };
532
+
533
+ CstyleBehaviour.$matchTokenType = function(token, types) {
534
+ return types.indexOf(token.type || token) > -1;
535
+ };
536
+
537
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
538
+ var cursor = editor.getCursorPosition();
539
+ var line = session.doc.getLine(cursor.row);
540
+ if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
541
+ autoInsertedBrackets = 0;
542
+ autoInsertedRow = cursor.row;
543
+ autoInsertedLineEnd = bracket + line.substr(cursor.column);
544
+ autoInsertedBrackets++;
545
+ };
546
+
547
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
548
+ var cursor = editor.getCursorPosition();
549
+ var line = session.doc.getLine(cursor.row);
550
+ if (!this.isMaybeInsertedClosing(cursor, line))
551
+ maybeInsertedBrackets = 0;
552
+ maybeInsertedRow = cursor.row;
553
+ maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
554
+ maybeInsertedLineEnd = line.substr(cursor.column);
555
+ maybeInsertedBrackets++;
556
+ };
557
+
558
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
559
+ return autoInsertedBrackets > 0 &&
560
+ cursor.row === autoInsertedRow &&
561
+ bracket === autoInsertedLineEnd[0] &&
562
+ line.substr(cursor.column) === autoInsertedLineEnd;
563
+ };
564
+
565
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
566
+ return maybeInsertedBrackets > 0 &&
567
+ cursor.row === maybeInsertedRow &&
568
+ line.substr(cursor.column) === maybeInsertedLineEnd &&
569
+ line.substr(0, cursor.column) == maybeInsertedLineStart;
570
+ };
571
+
572
+ CstyleBehaviour.popAutoInsertedClosing = function() {
573
+ autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
574
+ autoInsertedBrackets--;
575
+ };
576
+
577
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
578
+ maybeInsertedBrackets = 0;
579
+ maybeInsertedRow = -1;
580
+ };
581
+
582
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
583
+ var cursor = editor.getCursorPosition();
584
+ var line = session.doc.getLine(cursor.row);
585
+ if (text == '{') {
586
+ var selection = editor.getSelectionRange();
587
+ var selected = session.doc.getTextRange(selection);
588
+ if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
589
+ return {
590
+ text: '{' + selected + '}',
591
+ selection: false
592
+ };
593
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
594
+ if (/[\]\}\)]/.test(line[cursor.column])) {
595
+ CstyleBehaviour.recordAutoInsert(editor, session, "}");
596
+ return {
597
+ text: '{}',
598
+ selection: [1, 1]
599
+ };
600
+ } else {
601
+ CstyleBehaviour.recordMaybeInsert(editor, session, "{");
602
+ return {
603
+ text: '{',
604
+ selection: [1, 1]
605
+ };
606
+ }
607
+ }
608
+ } else if (text == '}') {
609
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
610
+ if (rightChar == '}') {
611
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
612
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
613
+ CstyleBehaviour.popAutoInsertedClosing();
614
+ return {
615
+ text: '',
616
+ selection: [1, 1]
617
+ };
618
+ }
619
+ }
620
+ } else if (text == "\n" || text == "\r\n") {
621
+ var closing = "";
622
+ if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
623
+ closing = lang.stringRepeat("}", maybeInsertedBrackets);
624
+ CstyleBehaviour.clearMaybeInsertedClosing();
625
+ }
626
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
627
+ if (rightChar == '}' || closing !== "") {
628
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
629
+ if (!openBracePos)
630
+ return null;
631
+
632
+ var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
633
+ var next_indent = this.$getIndent(line);
634
+
635
+ return {
636
+ text: '\n' + indent + '\n' + next_indent + closing,
637
+ selection: [1, indent.length, 1, indent.length]
638
+ };
639
+ }
640
+ }
641
+ });
642
+
643
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
644
+ var selected = session.doc.getTextRange(range);
645
+ if (!range.isMultiLine() && selected == '{') {
646
+ var line = session.doc.getLine(range.start.row);
647
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
648
+ if (rightChar == '}') {
649
+ range.end.column++;
650
+ return range;
651
+ } else {
652
+ maybeInsertedBrackets--;
653
+ }
654
+ }
655
+ });
656
+
657
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
658
+ if (text == '(') {
659
+ var selection = editor.getSelectionRange();
660
+ var selected = session.doc.getTextRange(selection);
661
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
662
+ return {
663
+ text: '(' + selected + ')',
664
+ selection: false
665
+ };
666
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
667
+ CstyleBehaviour.recordAutoInsert(editor, session, ")");
668
+ return {
669
+ text: '()',
670
+ selection: [1, 1]
671
+ };
672
+ }
673
+ } else if (text == ')') {
674
+ var cursor = editor.getCursorPosition();
675
+ var line = session.doc.getLine(cursor.row);
676
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
677
+ if (rightChar == ')') {
678
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
679
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
680
+ CstyleBehaviour.popAutoInsertedClosing();
681
+ return {
682
+ text: '',
683
+ selection: [1, 1]
684
+ };
685
+ }
686
+ }
687
+ }
688
+ });
689
+
690
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
691
+ var selected = session.doc.getTextRange(range);
692
+ if (!range.isMultiLine() && selected == '(') {
693
+ var line = session.doc.getLine(range.start.row);
694
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
695
+ if (rightChar == ')') {
696
+ range.end.column++;
697
+ return range;
698
+ }
699
+ }
700
+ });
701
+
702
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
703
+ if (text == '[') {
704
+ var selection = editor.getSelectionRange();
705
+ var selected = session.doc.getTextRange(selection);
706
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
707
+ return {
708
+ text: '[' + selected + ']',
709
+ selection: false
710
+ };
711
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
712
+ CstyleBehaviour.recordAutoInsert(editor, session, "]");
713
+ return {
714
+ text: '[]',
715
+ selection: [1, 1]
716
+ };
717
+ }
718
+ } else if (text == ']') {
719
+ var cursor = editor.getCursorPosition();
720
+ var line = session.doc.getLine(cursor.row);
721
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
722
+ if (rightChar == ']') {
723
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
724
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
725
+ CstyleBehaviour.popAutoInsertedClosing();
726
+ return {
727
+ text: '',
728
+ selection: [1, 1]
729
+ };
730
+ }
731
+ }
732
+ }
733
+ });
734
+
735
+ this.add("brackets", "deletion", function (state, action, editor, session, range) {
736
+ var selected = session.doc.getTextRange(range);
737
+ if (!range.isMultiLine() && selected == '[') {
738
+ var line = session.doc.getLine(range.start.row);
739
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
740
+ if (rightChar == ']') {
741
+ range.end.column++;
742
+ return range;
743
+ }
744
+ }
745
+ });
746
+
747
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
748
+ if (text == '"' || text == "'") {
749
+ var quote = text;
750
+ var selection = editor.getSelectionRange();
751
+ var selected = session.doc.getTextRange(selection);
752
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
753
+ return {
754
+ text: quote + selected + quote,
755
+ selection: false
756
+ };
757
+ } else {
758
+ var cursor = editor.getCursorPosition();
759
+ var line = session.doc.getLine(cursor.row);
760
+ var leftChar = line.substring(cursor.column-1, cursor.column);
761
+ if (leftChar == '\\') {
762
+ return null;
763
+ }
764
+ var tokens = session.getTokens(selection.start.row);
765
+ var col = 0, token;
766
+ var quotepos = -1; // Track whether we're inside an open quote.
767
+
768
+ for (var x = 0; x < tokens.length; x++) {
769
+ token = tokens[x];
770
+ if (token.type == "string") {
771
+ quotepos = -1;
772
+ } else if (quotepos < 0) {
773
+ quotepos = token.value.indexOf(quote);
774
+ }
775
+ if ((token.value.length + col) > selection.start.column) {
776
+ break;
777
+ }
778
+ col += tokens[x].value.length;
779
+ }
780
+ if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
781
+ if (!CstyleBehaviour.isSaneInsertion(editor, session))
782
+ return;
783
+ return {
784
+ text: quote + quote,
785
+ selection: [1,1]
786
+ };
787
+ } else if (token && token.type === "string") {
788
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
789
+ if (rightChar == quote) {
790
+ return {
791
+ text: '',
792
+ selection: [1, 1]
793
+ };
794
+ }
795
+ }
796
+ }
797
+ }
798
+ });
799
+
800
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
801
+ var selected = session.doc.getTextRange(range);
802
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
803
+ var line = session.doc.getLine(range.start.row);
804
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
805
+ if (rightChar == selected) {
806
+ range.end.column++;
807
+ return range;
808
+ }
809
+ }
810
+ });
811
+
812
+ };
813
+
814
+ oop.inherits(CstyleBehaviour, Behaviour);
815
+
816
+ exports.CstyleBehaviour = CstyleBehaviour;
817
+ });
818
+
819
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
820
+
821
+
822
+ var oop = require("../../lib/oop");
823
+ var Range = require("../../range").Range;
824
+ var BaseFoldMode = require("./fold_mode").FoldMode;
825
+
826
+ var FoldMode = exports.FoldMode = function(commentRegex) {
827
+ if (commentRegex) {
828
+ this.foldingStartMarker = new RegExp(
829
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
830
+ );
831
+ this.foldingStopMarker = new RegExp(
832
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
833
+ );
834
+ }
835
+ };
836
+ oop.inherits(FoldMode, BaseFoldMode);
837
+
838
+ (function() {
839
+
840
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
841
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
842
+
843
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
844
+ var line = session.getLine(row);
845
+ var match = line.match(this.foldingStartMarker);
846
+ if (match) {
847
+ var i = match.index;
848
+
849
+ if (match[1])
850
+ return this.openingBracketBlock(session, match[1], row, i);
851
+
852
+ return session.getCommentFoldRange(row, i + match[0].length, 1);
853
+ }
854
+
855
+ if (foldStyle !== "markbeginend")
856
+ return;
857
+
858
+ var match = line.match(this.foldingStopMarker);
859
+ if (match) {
860
+ var i = match.index + match[0].length;
861
+
862
+ if (match[1])
863
+ return this.closingBracketBlock(session, match[1], row, i);
864
+
865
+ return session.getCommentFoldRange(row, i, -1);
866
+ }
867
+ };
868
+
869
+ }).call(FoldMode.prototype);
870
+
871
+ });
872
+ define('ace/mode/groovy_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
873
+
874
+
875
+ var oop = require("../lib/oop");
876
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
877
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
878
+
879
+ var GroovyHighlightRules = function() {
880
+
881
+ var keywords = (
882
+ "assert|with|abstract|continue|for|new|switch|" +
883
+ "assert|default|goto|package|synchronized|" +
884
+ "boolean|do|if|private|this|" +
885
+ "break|double|implements|protected|throw|" +
886
+ "byte|else|import|public|throws|" +
887
+ "case|enum|instanceof|return|transient|" +
888
+ "catch|extends|int|short|try|" +
889
+ "char|final|interface|static|void|" +
890
+ "class|finally|long|strictfp|volatile|" +
891
+ "def|float|native|super|while"
892
+ );
893
+
894
+ var buildinConstants = (
895
+ "null|Infinity|NaN|undefined"
896
+ );
897
+
898
+ var langClasses = (
899
+ "AbstractMethodError|AssertionError|ClassCircularityError|"+
900
+ "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
901
+ "ExceptionInInitializerError|IllegalAccessError|"+
902
+ "IllegalThreadStateException|InstantiationError|InternalError|"+
903
+ "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
904
+ "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
905
+ "SuppressWarnings|TypeNotPresentException|UnknownError|"+
906
+ "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
907
+ "InstantiationException|IndexOutOfBoundsException|"+
908
+ "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
909
+ "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
910
+ "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
911
+ "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
912
+ "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
913
+ "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
914
+ "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
915
+ "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
916
+ "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
917
+ "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
918
+ "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
919
+ "ArrayStoreException|ClassCastException|LinkageError|"+
920
+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
921
+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
922
+ "Cloneable|Class|CharSequence|Comparable|String|Object"
923
+ );
924
+
925
+ var keywordMapper = this.createKeywordMapper({
926
+ "variable.language": "this",
927
+ "keyword": keywords,
928
+ "support.function": langClasses,
929
+ "constant.language": buildinConstants
930
+ }, "identifier");
931
+
932
+ this.$rules = {
933
+ "start" : [
934
+ {
935
+ token : "comment",
936
+ regex : "\\/\\/.*$"
937
+ },
938
+ DocCommentHighlightRules.getStartRule("doc-start"),
939
+ {
940
+ token : "comment", // multi line comment
941
+ regex : "\\/\\*",
942
+ next : "comment"
943
+ }, {
944
+ token : "string.regexp",
945
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
946
+ }, {
947
+ token : "string",
948
+ regex : '"""',
949
+ next : "qqstring"
950
+ }, {
951
+ token : "string",
952
+ regex : "'''",
953
+ next : "qstring"
954
+ }, {
955
+ token : "string", // single line
956
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
957
+ }, {
958
+ token : "string", // single line
959
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
960
+ }, {
961
+ token : "constant.numeric", // hex
962
+ regex : "0[xX][0-9a-fA-F]+\\b"
963
+ }, {
964
+ token : "constant.numeric", // float
965
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
966
+ }, {
967
+ token : "constant.language.boolean",
968
+ regex : "(?:true|false)\\b"
969
+ }, {
970
+ token : keywordMapper,
971
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
972
+ }, {
973
+ token : "keyword.operator",
974
+ regex : "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
975
+ }, {
976
+ token : "lparen",
977
+ regex : "[[({]"
978
+ }, {
979
+ token : "rparen",
980
+ regex : "[\\])}]"
981
+ }, {
982
+ token : "text",
983
+ regex : "\\s+"
984
+ }
985
+ ],
986
+ "comment" : [
987
+ {
988
+ token : "comment", // closing comment
989
+ regex : ".*?\\*\\/",
990
+ next : "start"
991
+ }, {
992
+ token : "comment", // comment spanning whole line
993
+ regex : ".+"
994
+ }
995
+ ],
996
+ "qqstring" : [
997
+ {
998
+ token : "constant.language.escape",
999
+ regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
1000
+ }, {
1001
+ token : "constant.language.escape",
1002
+ regex : /\$[\w\d]+/
1003
+ }, {
1004
+ token : "constant.language.escape",
1005
+ regex : /\$\{[^"\}]+\}?/
1006
+ }, {
1007
+ token : "string",
1008
+ regex : '"{3,5}',
1009
+ next : "start"
1010
+ }, {
1011
+ token : "string",
1012
+ regex : '.+?'
1013
+ }
1014
+ ],
1015
+ "qstring" : [
1016
+ {
1017
+ token : "constant.language.escape",
1018
+ regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
1019
+ }, {
1020
+ token : "string",
1021
+ regex : "'{3,5}",
1022
+ next : "start"
1023
+ }, {
1024
+ token : "string",
1025
+ regex : ".+?"
1026
+ }
1027
+ ]
1028
+ };
1029
+
1030
+ this.embedRules(DocCommentHighlightRules, "doc-",
1031
+ [ DocCommentHighlightRules.getEndRule("start") ]);
1032
+ };
1033
+
1034
+ oop.inherits(GroovyHighlightRules, TextHighlightRules);
1035
+
1036
+ exports.GroovyHighlightRules = GroovyHighlightRules;
1037
+ });