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,996 @@
1
+ define('ace/mode/java', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/java_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 JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
8
+
9
+ var Mode = function() {
10
+ JavaScriptMode.call(this);
11
+
12
+ this.$tokenizer = new Tokenizer(new JavaHighlightRules().getRules());
13
+ };
14
+ oop.inherits(Mode, JavaScriptMode);
15
+
16
+ (function() {
17
+
18
+ this.createWorker = function(session) {
19
+ return null;
20
+ };
21
+
22
+ }).call(Mode.prototype);
23
+
24
+ exports.Mode = Mode;
25
+ });
26
+
27
+ 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) {
28
+
29
+
30
+ var oop = require("../lib/oop");
31
+ var TextMode = require("./text").Mode;
32
+ var Tokenizer = require("../tokenizer").Tokenizer;
33
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
34
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
35
+ var Range = require("../range").Range;
36
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
37
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
38
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
39
+
40
+ var Mode = function() {
41
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
42
+ this.$outdent = new MatchingBraceOutdent();
43
+ this.$behaviour = new CstyleBehaviour();
44
+ this.foldingRules = new CStyleFoldMode();
45
+ };
46
+ oop.inherits(Mode, TextMode);
47
+
48
+ (function() {
49
+
50
+ this.lineCommentStart = "//";
51
+ this.blockComment = {start: "/*", end: "*/"};
52
+
53
+ this.getNextLineIndent = function(state, line, tab) {
54
+ var indent = this.$getIndent(line);
55
+
56
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
57
+ var tokens = tokenizedLine.tokens;
58
+ var endState = tokenizedLine.state;
59
+
60
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
61
+ return indent;
62
+ }
63
+
64
+ if (state == "start" || state == "no_regex") {
65
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
66
+ if (match) {
67
+ indent += tab;
68
+ }
69
+ } else if (state == "doc-start") {
70
+ if (endState == "start" || endState == "no_regex") {
71
+ return "";
72
+ }
73
+ var match = line.match(/^\s*(\/?)\*/);
74
+ if (match) {
75
+ if (match[1]) {
76
+ indent += " ";
77
+ }
78
+ indent += "* ";
79
+ }
80
+ }
81
+
82
+ return indent;
83
+ };
84
+
85
+ this.checkOutdent = function(state, line, input) {
86
+ return this.$outdent.checkOutdent(line, input);
87
+ };
88
+
89
+ this.autoOutdent = function(state, doc, row) {
90
+ this.$outdent.autoOutdent(doc, row);
91
+ };
92
+
93
+ this.createWorker = function(session) {
94
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
95
+ worker.attachToDocument(session.getDocument());
96
+
97
+ worker.on("jslint", function(results) {
98
+ session.setAnnotations(results.data);
99
+ });
100
+
101
+ worker.on("terminate", function() {
102
+ session.clearAnnotations();
103
+ });
104
+
105
+ return worker;
106
+ };
107
+
108
+ }).call(Mode.prototype);
109
+
110
+ exports.Mode = Mode;
111
+ });
112
+
113
+ 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) {
114
+
115
+
116
+ var oop = require("../lib/oop");
117
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
118
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
119
+
120
+ var JavaScriptHighlightRules = function() {
121
+ var keywordMapper = this.createKeywordMapper({
122
+ "variable.language":
123
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
124
+ "Namespace|QName|XML|XMLList|" + // E4X
125
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
126
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
127
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
128
+ "SyntaxError|TypeError|URIError|" +
129
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
130
+ "isNaN|parseFloat|parseInt|" +
131
+ "JSON|Math|" + // Other
132
+ "this|arguments|prototype|window|document" , // Pseudo
133
+ "keyword":
134
+ "const|yield|import|get|set|" +
135
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
136
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
137
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
138
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
139
+ "storage.type":
140
+ "const|let|var|function",
141
+ "constant.language":
142
+ "null|Infinity|NaN|undefined",
143
+ "support.function":
144
+ "alert",
145
+ "constant.language.boolean": "true|false"
146
+ }, "identifier");
147
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
148
+ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
149
+
150
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
151
+ "u[0-9a-fA-F]{4}|" + // unicode
152
+ "[0-2][0-7]{0,2}|" + // oct
153
+ "3[0-6][0-7]?|" + // oct
154
+ "37[0-7]?|" + // oct
155
+ "[4-7][0-7]?|" + //oct
156
+ ".)";
157
+
158
+ this.$rules = {
159
+ "no_regex" : [
160
+ {
161
+ token : "comment",
162
+ regex : /\/\/.*$/
163
+ },
164
+ DocCommentHighlightRules.getStartRule("doc-start"),
165
+ {
166
+ token : "comment", // multi line comment
167
+ regex : /\/\*/,
168
+ next : "comment"
169
+ }, {
170
+ token : "string",
171
+ regex : "'(?=.)",
172
+ next : "qstring"
173
+ }, {
174
+ token : "string",
175
+ regex : '"(?=.)',
176
+ next : "qqstring"
177
+ }, {
178
+ token : "constant.numeric", // hex
179
+ regex : /0[xX][0-9a-fA-F]+\b/
180
+ }, {
181
+ token : "constant.numeric", // float
182
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
183
+ }, {
184
+ token : [
185
+ "storage.type", "punctuation.operator", "support.function",
186
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
187
+ ],
188
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
189
+ next: "function_arguments"
190
+ }, {
191
+ token : [
192
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
193
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
194
+ ],
195
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
196
+ next: "function_arguments"
197
+ }, {
198
+ token : [
199
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
200
+ "text", "paren.lparen"
201
+ ],
202
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
203
+ next: "function_arguments"
204
+ }, {
205
+ token : [
206
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
207
+ "keyword.operator", "text",
208
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
209
+ ],
210
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
211
+ next: "function_arguments"
212
+ }, {
213
+ token : [
214
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
215
+ ],
216
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
217
+ next: "function_arguments"
218
+ }, {
219
+ token : [
220
+ "entity.name.function", "text", "punctuation.operator",
221
+ "text", "storage.type", "text", "paren.lparen"
222
+ ],
223
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
224
+ next: "function_arguments"
225
+ }, {
226
+ token : [
227
+ "text", "text", "storage.type", "text", "paren.lparen"
228
+ ],
229
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
230
+ next: "function_arguments"
231
+ }, {
232
+ token : "keyword",
233
+ regex : "(?:" + kwBeforeRe + ")\\b",
234
+ next : "start"
235
+ }, {
236
+ token : ["punctuation.operator", "support.function"],
237
+ 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(?=\()/
238
+ }, {
239
+ token : ["punctuation.operator", "support.function.dom"],
240
+ 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(?=\()/
241
+ }, {
242
+ token : ["punctuation.operator", "support.constant"],
243
+ 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/
244
+ }, {
245
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
246
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
247
+ }, {
248
+ token : keywordMapper,
249
+ regex : identifierRe
250
+ }, {
251
+ token : "keyword.operator",
252
+ regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
253
+ next : "start"
254
+ }, {
255
+ token : "punctuation.operator",
256
+ regex : /\?|\:|\,|\;|\./,
257
+ next : "start"
258
+ }, {
259
+ token : "paren.lparen",
260
+ regex : /[\[({]/,
261
+ next : "start"
262
+ }, {
263
+ token : "paren.rparen",
264
+ regex : /[\])}]/
265
+ }, {
266
+ token : "keyword.operator",
267
+ regex : /\/=?/,
268
+ next : "start"
269
+ }, {
270
+ token: "comment",
271
+ regex: /^#!.*$/
272
+ }
273
+ ],
274
+ "start": [
275
+ DocCommentHighlightRules.getStartRule("doc-start"),
276
+ {
277
+ token : "comment", // multi line comment
278
+ regex : "\\/\\*",
279
+ next : "comment_regex_allowed"
280
+ }, {
281
+ token : "comment",
282
+ regex : "\\/\\/.*$",
283
+ next : "start"
284
+ }, {
285
+ token: "string.regexp",
286
+ regex: "\\/",
287
+ next: "regex"
288
+ }, {
289
+ token : "text",
290
+ regex : "\\s+|^$",
291
+ next : "start"
292
+ }, {
293
+ token: "empty",
294
+ regex: "",
295
+ next: "no_regex"
296
+ }
297
+ ],
298
+ "regex": [
299
+ {
300
+ token: "regexp.keyword.operator",
301
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
302
+ }, {
303
+ token: "string.regexp",
304
+ regex: "/\\w*",
305
+ next: "no_regex"
306
+ }, {
307
+ token : "invalid",
308
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
309
+ }, {
310
+ token : "constant.language.escape",
311
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/
312
+ }, {
313
+ token : "constant.language.delimiter",
314
+ regex: /\|/
315
+ }, {
316
+ token: "constant.language.escape",
317
+ regex: /\[\^?/,
318
+ next: "regex_character_class"
319
+ }, {
320
+ token: "empty",
321
+ regex: "$",
322
+ next: "no_regex"
323
+ }, {
324
+ defaultToken: "string.regexp"
325
+ }
326
+ ],
327
+ "regex_character_class": [
328
+ {
329
+ token: "regexp.keyword.operator",
330
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
331
+ }, {
332
+ token: "constant.language.escape",
333
+ regex: "]",
334
+ next: "regex"
335
+ }, {
336
+ token: "constant.language.escape",
337
+ regex: "-"
338
+ }, {
339
+ token: "empty",
340
+ regex: "$",
341
+ next: "no_regex"
342
+ }, {
343
+ defaultToken: "string.regexp.charachterclass"
344
+ }
345
+ ],
346
+ "function_arguments": [
347
+ {
348
+ token: "variable.parameter",
349
+ regex: identifierRe
350
+ }, {
351
+ token: "punctuation.operator",
352
+ regex: "[, ]+"
353
+ }, {
354
+ token: "punctuation.operator",
355
+ regex: "$"
356
+ }, {
357
+ token: "empty",
358
+ regex: "",
359
+ next: "no_regex"
360
+ }
361
+ ],
362
+ "comment_regex_allowed" : [
363
+ {token : "comment", regex : "\\*\\/", next : "start"},
364
+ {defaultToken : "comment"}
365
+ ],
366
+ "comment" : [
367
+ {token : "comment", regex : "\\*\\/", next : "no_regex"},
368
+ {defaultToken : "comment"}
369
+ ],
370
+ "qqstring" : [
371
+ {
372
+ token : "constant.language.escape",
373
+ regex : escapedRe
374
+ }, {
375
+ token : "string",
376
+ regex : "\\\\$",
377
+ next : "qqstring"
378
+ }, {
379
+ token : "string",
380
+ regex : '"|$',
381
+ next : "no_regex"
382
+ }, {
383
+ defaultToken: "string"
384
+ }
385
+ ],
386
+ "qstring" : [
387
+ {
388
+ token : "constant.language.escape",
389
+ regex : escapedRe
390
+ }, {
391
+ token : "string",
392
+ regex : "\\\\$",
393
+ next : "qstring"
394
+ }, {
395
+ token : "string",
396
+ regex : "'|$",
397
+ next : "no_regex"
398
+ }, {
399
+ defaultToken: "string"
400
+ }
401
+ ]
402
+ };
403
+
404
+ this.embedRules(DocCommentHighlightRules, "doc-",
405
+ [ DocCommentHighlightRules.getEndRule("no_regex") ]);
406
+ };
407
+
408
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
409
+
410
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
411
+ });
412
+
413
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
414
+
415
+
416
+ var oop = require("../lib/oop");
417
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
418
+
419
+ var DocCommentHighlightRules = function() {
420
+
421
+ this.$rules = {
422
+ "start" : [ {
423
+ token : "comment.doc.tag",
424
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
425
+ }, {
426
+ token : "comment.doc.tag",
427
+ regex : "\\bTODO\\b"
428
+ }, {
429
+ defaultToken : "comment.doc"
430
+ }]
431
+ };
432
+ };
433
+
434
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
435
+
436
+ DocCommentHighlightRules.getStartRule = function(start) {
437
+ return {
438
+ token : "comment.doc", // doc comment
439
+ regex : "\\/\\*(?=\\*)",
440
+ next : start
441
+ };
442
+ };
443
+
444
+ DocCommentHighlightRules.getEndRule = function (start) {
445
+ return {
446
+ token : "comment.doc", // closing comment
447
+ regex : "\\*\\/",
448
+ next : start
449
+ };
450
+ };
451
+
452
+
453
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
454
+
455
+ });
456
+
457
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
458
+
459
+
460
+ var Range = require("../range").Range;
461
+
462
+ var MatchingBraceOutdent = function() {};
463
+
464
+ (function() {
465
+
466
+ this.checkOutdent = function(line, input) {
467
+ if (! /^\s+$/.test(line))
468
+ return false;
469
+
470
+ return /^\s*\}/.test(input);
471
+ };
472
+
473
+ this.autoOutdent = function(doc, row) {
474
+ var line = doc.getLine(row);
475
+ var match = line.match(/^(\s*\})/);
476
+
477
+ if (!match) return 0;
478
+
479
+ var column = match[1].length;
480
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
481
+
482
+ if (!openBracePos || openBracePos.row == row) return 0;
483
+
484
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
485
+ doc.replace(new Range(row, 0, row, column-1), indent);
486
+ };
487
+
488
+ this.$getIndent = function(line) {
489
+ return line.match(/^\s*/)[0];
490
+ };
491
+
492
+ }).call(MatchingBraceOutdent.prototype);
493
+
494
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
495
+ });
496
+
497
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
498
+
499
+
500
+ var oop = require("../../lib/oop");
501
+ var Behaviour = require("../behaviour").Behaviour;
502
+ var TokenIterator = require("../../token_iterator").TokenIterator;
503
+ var lang = require("../../lib/lang");
504
+
505
+ var SAFE_INSERT_IN_TOKENS =
506
+ ["text", "paren.rparen", "punctuation.operator"];
507
+ var SAFE_INSERT_BEFORE_TOKENS =
508
+ ["text", "paren.rparen", "punctuation.operator", "comment"];
509
+
510
+
511
+ var autoInsertedBrackets = 0;
512
+ var autoInsertedRow = -1;
513
+ var autoInsertedLineEnd = "";
514
+ var maybeInsertedBrackets = 0;
515
+ var maybeInsertedRow = -1;
516
+ var maybeInsertedLineStart = "";
517
+ var maybeInsertedLineEnd = "";
518
+
519
+ var CstyleBehaviour = function () {
520
+
521
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
522
+ var cursor = editor.getCursorPosition();
523
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
524
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
525
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
526
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
527
+ return false;
528
+ }
529
+ iterator.stepForward();
530
+ return iterator.getCurrentTokenRow() !== cursor.row ||
531
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
532
+ };
533
+
534
+ CstyleBehaviour.$matchTokenType = function(token, types) {
535
+ return types.indexOf(token.type || token) > -1;
536
+ };
537
+
538
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
539
+ var cursor = editor.getCursorPosition();
540
+ var line = session.doc.getLine(cursor.row);
541
+ if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
542
+ autoInsertedBrackets = 0;
543
+ autoInsertedRow = cursor.row;
544
+ autoInsertedLineEnd = bracket + line.substr(cursor.column);
545
+ autoInsertedBrackets++;
546
+ };
547
+
548
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
549
+ var cursor = editor.getCursorPosition();
550
+ var line = session.doc.getLine(cursor.row);
551
+ if (!this.isMaybeInsertedClosing(cursor, line))
552
+ maybeInsertedBrackets = 0;
553
+ maybeInsertedRow = cursor.row;
554
+ maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
555
+ maybeInsertedLineEnd = line.substr(cursor.column);
556
+ maybeInsertedBrackets++;
557
+ };
558
+
559
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
560
+ return autoInsertedBrackets > 0 &&
561
+ cursor.row === autoInsertedRow &&
562
+ bracket === autoInsertedLineEnd[0] &&
563
+ line.substr(cursor.column) === autoInsertedLineEnd;
564
+ };
565
+
566
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
567
+ return maybeInsertedBrackets > 0 &&
568
+ cursor.row === maybeInsertedRow &&
569
+ line.substr(cursor.column) === maybeInsertedLineEnd &&
570
+ line.substr(0, cursor.column) == maybeInsertedLineStart;
571
+ };
572
+
573
+ CstyleBehaviour.popAutoInsertedClosing = function() {
574
+ autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
575
+ autoInsertedBrackets--;
576
+ };
577
+
578
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
579
+ maybeInsertedBrackets = 0;
580
+ maybeInsertedRow = -1;
581
+ };
582
+
583
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
584
+ var cursor = editor.getCursorPosition();
585
+ var line = session.doc.getLine(cursor.row);
586
+ if (text == '{') {
587
+ var selection = editor.getSelectionRange();
588
+ var selected = session.doc.getTextRange(selection);
589
+ if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
590
+ return {
591
+ text: '{' + selected + '}',
592
+ selection: false
593
+ };
594
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
595
+ if (/[\]\}\)]/.test(line[cursor.column])) {
596
+ CstyleBehaviour.recordAutoInsert(editor, session, "}");
597
+ return {
598
+ text: '{}',
599
+ selection: [1, 1]
600
+ };
601
+ } else {
602
+ CstyleBehaviour.recordMaybeInsert(editor, session, "{");
603
+ return {
604
+ text: '{',
605
+ selection: [1, 1]
606
+ };
607
+ }
608
+ }
609
+ } else if (text == '}') {
610
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
611
+ if (rightChar == '}') {
612
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
613
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
614
+ CstyleBehaviour.popAutoInsertedClosing();
615
+ return {
616
+ text: '',
617
+ selection: [1, 1]
618
+ };
619
+ }
620
+ }
621
+ } else if (text == "\n" || text == "\r\n") {
622
+ var closing = "";
623
+ if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
624
+ closing = lang.stringRepeat("}", maybeInsertedBrackets);
625
+ CstyleBehaviour.clearMaybeInsertedClosing();
626
+ }
627
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
628
+ if (rightChar == '}' || closing !== "") {
629
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
630
+ if (!openBracePos)
631
+ return null;
632
+
633
+ var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
634
+ var next_indent = this.$getIndent(line);
635
+
636
+ return {
637
+ text: '\n' + indent + '\n' + next_indent + closing,
638
+ selection: [1, indent.length, 1, indent.length]
639
+ };
640
+ }
641
+ }
642
+ });
643
+
644
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
645
+ var selected = session.doc.getTextRange(range);
646
+ if (!range.isMultiLine() && selected == '{') {
647
+ var line = session.doc.getLine(range.start.row);
648
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
649
+ if (rightChar == '}') {
650
+ range.end.column++;
651
+ return range;
652
+ } else {
653
+ maybeInsertedBrackets--;
654
+ }
655
+ }
656
+ });
657
+
658
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
659
+ if (text == '(') {
660
+ var selection = editor.getSelectionRange();
661
+ var selected = session.doc.getTextRange(selection);
662
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
663
+ return {
664
+ text: '(' + selected + ')',
665
+ selection: false
666
+ };
667
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
668
+ CstyleBehaviour.recordAutoInsert(editor, session, ")");
669
+ return {
670
+ text: '()',
671
+ selection: [1, 1]
672
+ };
673
+ }
674
+ } else if (text == ')') {
675
+ var cursor = editor.getCursorPosition();
676
+ var line = session.doc.getLine(cursor.row);
677
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
678
+ if (rightChar == ')') {
679
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
680
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
681
+ CstyleBehaviour.popAutoInsertedClosing();
682
+ return {
683
+ text: '',
684
+ selection: [1, 1]
685
+ };
686
+ }
687
+ }
688
+ }
689
+ });
690
+
691
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
692
+ var selected = session.doc.getTextRange(range);
693
+ if (!range.isMultiLine() && selected == '(') {
694
+ var line = session.doc.getLine(range.start.row);
695
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
696
+ if (rightChar == ')') {
697
+ range.end.column++;
698
+ return range;
699
+ }
700
+ }
701
+ });
702
+
703
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
704
+ if (text == '[') {
705
+ var selection = editor.getSelectionRange();
706
+ var selected = session.doc.getTextRange(selection);
707
+ if (selected !== "" && editor.getWrapBehavioursEnabled()) {
708
+ return {
709
+ text: '[' + selected + ']',
710
+ selection: false
711
+ };
712
+ } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
713
+ CstyleBehaviour.recordAutoInsert(editor, session, "]");
714
+ return {
715
+ text: '[]',
716
+ selection: [1, 1]
717
+ };
718
+ }
719
+ } else if (text == ']') {
720
+ var cursor = editor.getCursorPosition();
721
+ var line = session.doc.getLine(cursor.row);
722
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
723
+ if (rightChar == ']') {
724
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
725
+ if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
726
+ CstyleBehaviour.popAutoInsertedClosing();
727
+ return {
728
+ text: '',
729
+ selection: [1, 1]
730
+ };
731
+ }
732
+ }
733
+ }
734
+ });
735
+
736
+ this.add("brackets", "deletion", function (state, action, editor, session, range) {
737
+ var selected = session.doc.getTextRange(range);
738
+ if (!range.isMultiLine() && selected == '[') {
739
+ var line = session.doc.getLine(range.start.row);
740
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
741
+ if (rightChar == ']') {
742
+ range.end.column++;
743
+ return range;
744
+ }
745
+ }
746
+ });
747
+
748
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
749
+ if (text == '"' || text == "'") {
750
+ var quote = text;
751
+ var selection = editor.getSelectionRange();
752
+ var selected = session.doc.getTextRange(selection);
753
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
754
+ return {
755
+ text: quote + selected + quote,
756
+ selection: false
757
+ };
758
+ } else {
759
+ var cursor = editor.getCursorPosition();
760
+ var line = session.doc.getLine(cursor.row);
761
+ var leftChar = line.substring(cursor.column-1, cursor.column);
762
+ if (leftChar == '\\') {
763
+ return null;
764
+ }
765
+ var tokens = session.getTokens(selection.start.row);
766
+ var col = 0, token;
767
+ var quotepos = -1; // Track whether we're inside an open quote.
768
+
769
+ for (var x = 0; x < tokens.length; x++) {
770
+ token = tokens[x];
771
+ if (token.type == "string") {
772
+ quotepos = -1;
773
+ } else if (quotepos < 0) {
774
+ quotepos = token.value.indexOf(quote);
775
+ }
776
+ if ((token.value.length + col) > selection.start.column) {
777
+ break;
778
+ }
779
+ col += tokens[x].value.length;
780
+ }
781
+ 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)))) {
782
+ if (!CstyleBehaviour.isSaneInsertion(editor, session))
783
+ return;
784
+ return {
785
+ text: quote + quote,
786
+ selection: [1,1]
787
+ };
788
+ } else if (token && token.type === "string") {
789
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
790
+ if (rightChar == quote) {
791
+ return {
792
+ text: '',
793
+ selection: [1, 1]
794
+ };
795
+ }
796
+ }
797
+ }
798
+ }
799
+ });
800
+
801
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
802
+ var selected = session.doc.getTextRange(range);
803
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
804
+ var line = session.doc.getLine(range.start.row);
805
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
806
+ if (rightChar == selected) {
807
+ range.end.column++;
808
+ return range;
809
+ }
810
+ }
811
+ });
812
+
813
+ };
814
+
815
+ oop.inherits(CstyleBehaviour, Behaviour);
816
+
817
+ exports.CstyleBehaviour = CstyleBehaviour;
818
+ });
819
+
820
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
821
+
822
+
823
+ var oop = require("../../lib/oop");
824
+ var Range = require("../../range").Range;
825
+ var BaseFoldMode = require("./fold_mode").FoldMode;
826
+
827
+ var FoldMode = exports.FoldMode = function(commentRegex) {
828
+ if (commentRegex) {
829
+ this.foldingStartMarker = new RegExp(
830
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
831
+ );
832
+ this.foldingStopMarker = new RegExp(
833
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
834
+ );
835
+ }
836
+ };
837
+ oop.inherits(FoldMode, BaseFoldMode);
838
+
839
+ (function() {
840
+
841
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
842
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
843
+
844
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
845
+ var line = session.getLine(row);
846
+ var match = line.match(this.foldingStartMarker);
847
+ if (match) {
848
+ var i = match.index;
849
+
850
+ if (match[1])
851
+ return this.openingBracketBlock(session, match[1], row, i);
852
+
853
+ return session.getCommentFoldRange(row, i + match[0].length, 1);
854
+ }
855
+
856
+ if (foldStyle !== "markbeginend")
857
+ return;
858
+
859
+ var match = line.match(this.foldingStopMarker);
860
+ if (match) {
861
+ var i = match.index + match[0].length;
862
+
863
+ if (match[1])
864
+ return this.closingBracketBlock(session, match[1], row, i);
865
+
866
+ return session.getCommentFoldRange(row, i, -1);
867
+ }
868
+ };
869
+
870
+ }).call(FoldMode.prototype);
871
+
872
+ });
873
+ define('ace/mode/java_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
874
+
875
+
876
+ var oop = require("../lib/oop");
877
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
878
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
879
+
880
+ var JavaHighlightRules = function() {
881
+ var keywords = (
882
+ "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
+ "const|float|native|super|while"
892
+ );
893
+
894
+ var buildinConstants = ("null|Infinity|NaN|undefined");
895
+
896
+
897
+ var langClasses = (
898
+ "AbstractMethodError|AssertionError|ClassCircularityError|"+
899
+ "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
900
+ "ExceptionInInitializerError|IllegalAccessError|"+
901
+ "IllegalThreadStateException|InstantiationError|InternalError|"+
902
+ "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
903
+ "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
904
+ "SuppressWarnings|TypeNotPresentException|UnknownError|"+
905
+ "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
906
+ "InstantiationException|IndexOutOfBoundsException|"+
907
+ "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
908
+ "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
909
+ "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
910
+ "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
911
+ "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
912
+ "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
913
+ "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
914
+ "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
915
+ "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
916
+ "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
917
+ "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
918
+ "ArrayStoreException|ClassCastException|LinkageError|"+
919
+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
920
+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
921
+ "Cloneable|Class|CharSequence|Comparable|String|Object"
922
+ );
923
+
924
+ var keywordMapper = this.createKeywordMapper({
925
+ "variable.language": "this",
926
+ "keyword": keywords,
927
+ "constant.language": buildinConstants,
928
+ "support.function": langClasses
929
+ }, "identifier");
930
+
931
+ this.$rules = {
932
+ "start" : [
933
+ {
934
+ token : "comment",
935
+ regex : "\\/\\/.*$"
936
+ },
937
+ DocCommentHighlightRules.getStartRule("doc-start"),
938
+ {
939
+ token : "comment", // multi line comment
940
+ regex : "\\/\\*",
941
+ next : "comment"
942
+ }, {
943
+ token : "string.regexp",
944
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
945
+ }, {
946
+ token : "string", // single line
947
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
948
+ }, {
949
+ token : "string", // single line
950
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
951
+ }, {
952
+ token : "constant.numeric", // hex
953
+ regex : "0[xX][0-9a-fA-F]+\\b"
954
+ }, {
955
+ token : "constant.numeric", // float
956
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
957
+ }, {
958
+ token : "constant.language.boolean",
959
+ regex : "(?:true|false)\\b"
960
+ }, {
961
+ token : keywordMapper,
962
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
963
+ }, {
964
+ token : "keyword.operator",
965
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
966
+ }, {
967
+ token : "lparen",
968
+ regex : "[[({]"
969
+ }, {
970
+ token : "rparen",
971
+ regex : "[\\])}]"
972
+ }, {
973
+ token : "text",
974
+ regex : "\\s+"
975
+ }
976
+ ],
977
+ "comment" : [
978
+ {
979
+ token : "comment", // closing comment
980
+ regex : ".*?\\*\\/",
981
+ next : "start"
982
+ }, {
983
+ token : "comment", // comment spanning whole line
984
+ regex : ".+"
985
+ }
986
+ ]
987
+ };
988
+
989
+ this.embedRules(DocCommentHighlightRules, "doc-",
990
+ [ DocCommentHighlightRules.getEndRule("start") ]);
991
+ };
992
+
993
+ oop.inherits(JavaHighlightRules, TextHighlightRules);
994
+
995
+ exports.JavaHighlightRules = JavaHighlightRules;
996
+ });