datagram 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,443 @@
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/ocaml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ocaml_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], 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 OcamlHighlightRules = require("./ocaml_highlight_rules").OcamlHighlightRules;
38
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
39
+ var Range = require("../range").Range;
40
+
41
+ var Mode = function() {
42
+ this.$tokenizer = new Tokenizer(new OcamlHighlightRules().getRules());
43
+ this.$outdent = new MatchingBraceOutdent();
44
+ };
45
+ oop.inherits(Mode, TextMode);
46
+
47
+ var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|with))\s*$/;
48
+
49
+ (function() {
50
+
51
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
52
+ var i, line;
53
+ var outdent = true;
54
+ var re = /^\s*\(\*(.*)\*\)/;
55
+
56
+ for (i=startRow; i<= endRow; i++) {
57
+ if (!re.test(doc.getLine(i))) {
58
+ outdent = false;
59
+ break;
60
+ }
61
+ }
62
+
63
+ var range = new Range(0, 0, 0, 0);
64
+ for (i=startRow; i<= endRow; i++) {
65
+ line = doc.getLine(i);
66
+ range.start.row = i;
67
+ range.end.row = i;
68
+ range.end.column = line.length;
69
+
70
+ doc.replace(range, outdent ? line.match(re)[1] : "(*" + line + "*)");
71
+ }
72
+ };
73
+
74
+ this.getNextLineIndent = function(state, line, tab) {
75
+ var indent = this.$getIndent(line);
76
+ var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
77
+
78
+ if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') &&
79
+ state === 'start' && indenter.test(line))
80
+ indent += tab;
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
+ }).call(Mode.prototype);
93
+
94
+ exports.Mode = Mode;
95
+ });
96
+
97
+ define('ace/mode/ocaml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
98
+
99
+
100
+ var oop = require("../lib/oop");
101
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
102
+
103
+ var OcamlHighlightRules = function() {
104
+
105
+ var keywords = (
106
+ "and|as|assert|begin|class|constraint|do|done|downto|else|end|" +
107
+ "exception|external|for|fun|function|functor|if|in|include|" +
108
+ "inherit|initializer|lazy|let|match|method|module|mutable|new|" +
109
+ "object|of|open|or|private|rec|sig|struct|then|to|try|type|val|" +
110
+ "virtual|when|while|with"
111
+ );
112
+
113
+ var builtinConstants = ("true|false");
114
+
115
+ var builtinFunctions = (
116
+ "abs|abs_big_int|abs_float|abs_num|abstract_tag|accept|access|acos|add|" +
117
+ "add_available_units|add_big_int|add_buffer|add_channel|add_char|" +
118
+ "add_initializer|add_int_big_int|add_interfaces|add_num|add_string|" +
119
+ "add_substitute|add_substring|alarm|allocated_bytes|allow_only|" +
120
+ "allow_unsafe_modules|always|append|appname_get|appname_set|" +
121
+ "approx_num_exp|approx_num_fix|arg|argv|arith_status|array|" +
122
+ "array1_of_genarray|array2_of_genarray|array3_of_genarray|asin|asr|" +
123
+ "assoc|assq|at_exit|atan|atan2|auto_synchronize|background|basename|" +
124
+ "beginning_of_input|big_int_of_int|big_int_of_num|big_int_of_string|bind|" +
125
+ "bind_class|bind_tag|bits|bits_of_float|black|blit|blit_image|blue|bool|" +
126
+ "bool_of_string|bounded_full_split|bounded_split|bounded_split_delim|" +
127
+ "bprintf|break|broadcast|bscanf|button_down|c_layout|capitalize|cardinal|" +
128
+ "cardinal|catch|catch_break|ceil|ceiling_num|channel|char|char_of_int|" +
129
+ "chdir|check|check_suffix|chmod|choose|chop_extension|chop_suffix|chown|" +
130
+ "chown|chr|chroot|classify_float|clear|clear_available_units|" +
131
+ "clear_close_on_exec|clear_graph|clear_nonblock|clear_parser|" +
132
+ "close|close|closeTk|close_box|close_graph|close_in|close_in_noerr|" +
133
+ "close_out|close_out_noerr|close_process|close_process|" +
134
+ "close_process_full|close_process_in|close_process_out|close_subwindow|" +
135
+ "close_tag|close_tbox|closedir|closedir|closure_tag|code|combine|" +
136
+ "combine|combine|command|compact|compare|compare_big_int|compare_num|" +
137
+ "complex32|complex64|concat|conj|connect|contains|contains_from|contents|" +
138
+ "copy|cos|cosh|count|count|counters|create|create_alarm|create_image|" +
139
+ "create_matrix|create_matrix|create_matrix|create_object|" +
140
+ "create_object_and_run_initializers|create_object_opt|create_process|" +
141
+ "create_process|create_process_env|create_process_env|create_table|" +
142
+ "current|current_dir_name|current_point|current_x|current_y|curveto|" +
143
+ "custom_tag|cyan|data_size|decr|decr_num|default_available_units|delay|" +
144
+ "delete_alarm|descr_of_in_channel|descr_of_out_channel|destroy|diff|dim|" +
145
+ "dim1|dim2|dim3|dims|dirname|display_mode|div|div_big_int|div_num|" +
146
+ "double_array_tag|double_tag|draw_arc|draw_char|draw_circle|draw_ellipse|" +
147
+ "draw_image|draw_poly|draw_poly_line|draw_rect|draw_segments|draw_string|" +
148
+ "dummy_pos|dummy_table|dump_image|dup|dup2|elements|empty|end_of_input|" +
149
+ "environment|eprintf|epsilon_float|eq_big_int|eq_num|equal|err_formatter|" +
150
+ "error_message|escaped|establish_server|executable_name|execv|execve|execvp|" +
151
+ "execvpe|exists|exists2|exit|exp|failwith|fast_sort|fchmod|fchown|field|" +
152
+ "file|file_exists|fill|fill_arc|fill_circle|fill_ellipse|fill_poly|fill_rect|" +
153
+ "filter|final_tag|finalise|find|find_all|first_chars|firstkey|flatten|" +
154
+ "float|float32|float64|float_of_big_int|float_of_bits|float_of_int|" +
155
+ "float_of_num|float_of_string|floor|floor_num|flush|flush_all|flush_input|" +
156
+ "flush_str_formatter|fold|fold_left|fold_left2|fold_right|fold_right2|" +
157
+ "for_all|for_all2|force|force_newline|force_val|foreground|fork|" +
158
+ "format_of_string|formatter_of_buffer|formatter_of_out_channel|" +
159
+ "fortran_layout|forward_tag|fprintf|frexp|from|from_channel|from_file|" +
160
+ "from_file_bin|from_function|from_string|fscanf|fst|fstat|ftruncate|" +
161
+ "full_init|full_major|full_split|gcd_big_int|ge_big_int|ge_num|" +
162
+ "genarray_of_array1|genarray_of_array2|genarray_of_array3|get|" +
163
+ "get_all_formatter_output_functions|get_approx_printing|get_copy|" +
164
+ "get_ellipsis_text|get_error_when_null_denominator|get_floating_precision|" +
165
+ "get_formatter_output_functions|get_formatter_tag_functions|get_image|" +
166
+ "get_margin|get_mark_tags|get_max_boxes|get_max_indent|get_method|" +
167
+ "get_method_label|get_normalize_ratio|get_normalize_ratio_when_printing|" +
168
+ "get_print_tags|get_state|get_variable|getcwd|getegid|getegid|getenv|" +
169
+ "getenv|getenv|geteuid|geteuid|getgid|getgid|getgrgid|getgrgid|getgrnam|" +
170
+ "getgrnam|getgroups|gethostbyaddr|gethostbyname|gethostname|getitimer|" +
171
+ "getlogin|getpeername|getpid|getppid|getprotobyname|getprotobynumber|" +
172
+ "getpwnam|getpwuid|getservbyname|getservbyport|getsockname|getsockopt|" +
173
+ "getsockopt_float|getsockopt_int|getsockopt_optint|gettimeofday|getuid|" +
174
+ "global_replace|global_substitute|gmtime|green|grid|group_beginning|" +
175
+ "group_end|gt_big_int|gt_num|guard|handle_unix_error|hash|hash_param|" +
176
+ "hd|header_size|i|id|ignore|in_channel_length|in_channel_of_descr|incr|" +
177
+ "incr_num|index|index_from|inet_addr_any|inet_addr_of_string|infinity|" +
178
+ "infix_tag|init|init_class|input|input_binary_int|input_byte|input_char|" +
179
+ "input_line|input_value|int|int16_signed|int16_unsigned|int32|int64|" +
180
+ "int8_signed|int8_unsigned|int_of_big_int|int_of_char|int_of_float|" +
181
+ "int_of_num|int_of_string|integer_num|inter|interactive|inv|invalid_arg|" +
182
+ "is_block|is_empty|is_implicit|is_int|is_int_big_int|is_integer_num|" +
183
+ "is_relative|iter|iter2|iteri|join|junk|key_pressed|kill|kind|kprintf|" +
184
+ "kscanf|land|last_chars|layout|lazy_from_fun|lazy_from_val|lazy_is_val|" +
185
+ "lazy_tag|ldexp|le_big_int|le_num|length|lexeme|lexeme_char|lexeme_end|" +
186
+ "lexeme_end_p|lexeme_start|lexeme_start_p|lineto|link|list|listen|lnot|" +
187
+ "loadfile|loadfile_private|localtime|lock|lockf|log|log10|logand|lognot|" +
188
+ "logor|logxor|lor|lower_window|lowercase|lseek|lsl|lsr|lstat|lt_big_int|" +
189
+ "lt_num|lxor|magenta|magic|mainLoop|major|major_slice|make|make_formatter|" +
190
+ "make_image|make_lexer|make_matrix|make_self_init|map|map2|map_file|mapi|" +
191
+ "marshal|match_beginning|match_end|matched_group|matched_string|max|" +
192
+ "max_array_length|max_big_int|max_elt|max_float|max_int|max_num|" +
193
+ "max_string_length|mem|mem_assoc|mem_assq|memq|merge|min|min_big_int|" +
194
+ "min_elt|min_float|min_int|min_num|minor|minus_big_int|minus_num|" +
195
+ "minus_one|mkdir|mkfifo|mktime|mod|mod_big_int|mod_float|mod_num|modf|" +
196
+ "mouse_pos|moveto|mul|mult_big_int|mult_int_big_int|mult_num|nan|narrow|" +
197
+ "nat_of_num|nativeint|neg|neg_infinity|new_block|new_channel|new_method|" +
198
+ "new_variable|next|nextkey|nice|nice|no_scan_tag|norm|norm2|not|npeek|" +
199
+ "nth|nth_dim|num_digits_big_int|num_dims|num_of_big_int|num_of_int|" +
200
+ "num_of_nat|num_of_ratio|num_of_string|O|obj|object_tag|ocaml_version|" +
201
+ "of_array|of_channel|of_float|of_int|of_int32|of_list|of_nativeint|" +
202
+ "of_string|one|openTk|open_box|open_connection|open_graph|open_hbox|" +
203
+ "open_hovbox|open_hvbox|open_in|open_in_bin|open_in_gen|open_out|" +
204
+ "open_out_bin|open_out_gen|open_process|open_process_full|open_process_in|" +
205
+ "open_process_out|open_subwindow|open_tag|open_tbox|open_temp_file|" +
206
+ "open_vbox|opendbm|opendir|openfile|or|os_type|out_channel_length|" +
207
+ "out_channel_of_descr|output|output_binary_int|output_buffer|output_byte|" +
208
+ "output_char|output_string|output_value|over_max_boxes|pack|params|" +
209
+ "parent_dir_name|parse|parse_argv|partition|pause|peek|pipe|pixels|" +
210
+ "place|plot|plots|point_color|polar|poll|pop|pos_in|pos_out|pow|" +
211
+ "power_big_int_positive_big_int|power_big_int_positive_int|" +
212
+ "power_int_positive_big_int|power_int_positive_int|power_num|" +
213
+ "pp_close_box|pp_close_tag|pp_close_tbox|pp_force_newline|" +
214
+ "pp_get_all_formatter_output_functions|pp_get_ellipsis_text|" +
215
+ "pp_get_formatter_output_functions|pp_get_formatter_tag_functions|" +
216
+ "pp_get_margin|pp_get_mark_tags|pp_get_max_boxes|pp_get_max_indent|" +
217
+ "pp_get_print_tags|pp_open_box|pp_open_hbox|pp_open_hovbox|pp_open_hvbox|" +
218
+ "pp_open_tag|pp_open_tbox|pp_open_vbox|pp_over_max_boxes|pp_print_as|" +
219
+ "pp_print_bool|pp_print_break|pp_print_char|pp_print_cut|pp_print_float|" +
220
+ "pp_print_flush|pp_print_if_newline|pp_print_int|pp_print_newline|" +
221
+ "pp_print_space|pp_print_string|pp_print_tab|pp_print_tbreak|" +
222
+ "pp_set_all_formatter_output_functions|pp_set_ellipsis_text|" +
223
+ "pp_set_formatter_out_channel|pp_set_formatter_output_functions|" +
224
+ "pp_set_formatter_tag_functions|pp_set_margin|pp_set_mark_tags|" +
225
+ "pp_set_max_boxes|pp_set_max_indent|pp_set_print_tags|pp_set_tab|" +
226
+ "pp_set_tags|pred|pred_big_int|pred_num|prerr_char|prerr_endline|" +
227
+ "prerr_float|prerr_int|prerr_newline|prerr_string|print|print_as|" +
228
+ "print_bool|print_break|print_char|print_cut|print_endline|print_float|" +
229
+ "print_flush|print_if_newline|print_int|print_newline|print_space|" +
230
+ "print_stat|print_string|print_tab|print_tbreak|printf|prohibit|" +
231
+ "public_method_label|push|putenv|quo_num|quomod_big_int|quote|raise|" +
232
+ "raise_window|ratio_of_num|rcontains_from|read|read_float|read_int|" +
233
+ "read_key|read_line|readdir|readdir|readlink|really_input|receive|recv|" +
234
+ "recvfrom|red|ref|regexp|regexp_case_fold|regexp_string|" +
235
+ "regexp_string_case_fold|register|register_exception|rem|remember_mode|" +
236
+ "remove|remove_assoc|remove_assq|rename|replace|replace_first|" +
237
+ "replace_matched|repr|reset|reshape|reshape_1|reshape_2|reshape_3|rev|" +
238
+ "rev_append|rev_map|rev_map2|rewinddir|rgb|rhs_end|rhs_end_pos|rhs_start|" +
239
+ "rhs_start_pos|rindex|rindex_from|rlineto|rmdir|rmoveto|round_num|" +
240
+ "run_initializers|run_initializers_opt|scanf|search_backward|" +
241
+ "search_forward|seek_in|seek_out|select|self|self_init|send|sendto|set|" +
242
+ "set_all_formatter_output_functions|set_approx_printing|" +
243
+ "set_binary_mode_in|set_binary_mode_out|set_close_on_exec|" +
244
+ "set_close_on_exec|set_color|set_ellipsis_text|" +
245
+ "set_error_when_null_denominator|set_field|set_floating_precision|" +
246
+ "set_font|set_formatter_out_channel|set_formatter_output_functions|" +
247
+ "set_formatter_tag_functions|set_line_width|set_margin|set_mark_tags|" +
248
+ "set_max_boxes|set_max_indent|set_method|set_nonblock|set_nonblock|" +
249
+ "set_normalize_ratio|set_normalize_ratio_when_printing|set_print_tags|" +
250
+ "set_signal|set_state|set_tab|set_tag|set_tags|set_text_size|" +
251
+ "set_window_title|setgid|setgid|setitimer|setitimer|setsid|setsid|" +
252
+ "setsockopt|setsockopt|setsockopt_float|setsockopt_float|setsockopt_int|" +
253
+ "setsockopt_int|setsockopt_optint|setsockopt_optint|setuid|setuid|" +
254
+ "shift_left|shift_left|shift_left|shift_right|shift_right|shift_right|" +
255
+ "shift_right_logical|shift_right_logical|shift_right_logical|show_buckets|" +
256
+ "shutdown|shutdown|shutdown_connection|shutdown_connection|sigabrt|" +
257
+ "sigalrm|sigchld|sigcont|sigfpe|sighup|sigill|sigint|sigkill|sign_big_int|" +
258
+ "sign_num|signal|signal|sigpending|sigpending|sigpipe|sigprocmask|" +
259
+ "sigprocmask|sigprof|sigquit|sigsegv|sigstop|sigsuspend|sigsuspend|" +
260
+ "sigterm|sigtstp|sigttin|sigttou|sigusr1|sigusr2|sigvtalrm|sin|singleton|" +
261
+ "sinh|size|size|size_x|size_y|sleep|sleep|sleep|slice_left|slice_left|" +
262
+ "slice_left_1|slice_left_2|slice_right|slice_right|slice_right_1|" +
263
+ "slice_right_2|snd|socket|socket|socket|socketpair|socketpair|sort|sound|" +
264
+ "split|split_delim|sprintf|sprintf|sqrt|sqrt|sqrt_big_int|square_big_int|" +
265
+ "square_num|sscanf|stable_sort|stable_sort|stable_sort|stable_sort|stable_sort|" +
266
+ "stable_sort|stat|stat|stat|stat|stat|stats|stats|std_formatter|stdbuf|" +
267
+ "stderr|stderr|stderr|stdib|stdin|stdin|stdin|stdout|stdout|stdout|" +
268
+ "str_formatter|string|string_after|string_before|string_match|" +
269
+ "string_of_big_int|string_of_bool|string_of_float|string_of_format|" +
270
+ "string_of_inet_addr|string_of_inet_addr|string_of_int|string_of_num|" +
271
+ "string_partial_match|string_tag|sub|sub|sub_big_int|sub_left|sub_num|" +
272
+ "sub_right|subset|subset|substitute_first|substring|succ|succ|" +
273
+ "succ|succ|succ_big_int|succ_num|symbol_end|symbol_end_pos|symbol_start|" +
274
+ "symbol_start_pos|symlink|symlink|sync|synchronize|system|system|system|" +
275
+ "tag|take|tan|tanh|tcdrain|tcdrain|tcflow|tcflow|tcflush|tcflush|" +
276
+ "tcgetattr|tcgetattr|tcsendbreak|tcsendbreak|tcsetattr|tcsetattr|" +
277
+ "temp_file|text_size|time|time|time|timed_read|timed_write|times|times|" +
278
+ "tl|tl|tl|to_buffer|to_channel|to_float|to_hex|to_int|to_int32|to_list|" +
279
+ "to_list|to_list|to_nativeint|to_string|to_string|to_string|to_string|" +
280
+ "to_string|top|top|total_size|transfer|transp|truncate|truncate|truncate|" +
281
+ "truncate|truncate|truncate|try_lock|umask|umask|uncapitalize|uncapitalize|" +
282
+ "uncapitalize|union|union|unit_big_int|unlink|unlink|unlock|unmarshal|" +
283
+ "unsafe_blit|unsafe_fill|unsafe_get|unsafe_get|unsafe_set|unsafe_set|" +
284
+ "update|uppercase|uppercase|uppercase|uppercase|usage|utimes|utimes|wait|" +
285
+ "wait|wait|wait|wait_next_event|wait_pid|wait_read|wait_signal|" +
286
+ "wait_timed_read|wait_timed_write|wait_write|waitpid|white|" +
287
+ "widen|window_id|word_size|wrap|wrap_abort|write|yellow|yield|zero|zero_big_int|" +
288
+
289
+ "Arg|Arith_status|Array|Array1|Array2|Array3|ArrayLabels|Big_int|Bigarray|" +
290
+ "Buffer|Callback|CamlinternalOO|Char|Complex|Condition|Dbm|Digest|Dynlink|" +
291
+ "Event|Filename|Format|Gc|Genarray|Genlex|Graphics|GraphicsX11|Hashtbl|" +
292
+ "Int32|Int64|LargeFile|Lazy|Lexing|List|ListLabels|Make|Map|Marshal|" +
293
+ "MoreLabels|Mutex|Nativeint|Num|Obj|Oo|Parsing|Pervasives|Printexc|" +
294
+ "Printf|Queue|Random|Scanf|Scanning|Set|Sort|Stack|State|StdLabels|Str|" +
295
+ "Stream|String|StringLabels|Sys|Thread|ThreadUnix|Tk|Unix|UnixLabels|Weak"
296
+ );
297
+
298
+ var keywordMapper = this.createKeywordMapper({
299
+ "variable.language": "this",
300
+ "keyword": keywords,
301
+ "constant.language": builtinConstants,
302
+ "support.function": builtinFunctions
303
+ }, "identifier");
304
+
305
+ var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
306
+ var octInteger = "(?:0[oO]?[0-7]+)";
307
+ var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
308
+ var binInteger = "(?:0[bB][01]+)";
309
+ var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
310
+
311
+ var exponent = "(?:[eE][+-]?\\d+)";
312
+ var fraction = "(?:\\.\\d+)";
313
+ var intPart = "(?:\\d+)";
314
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
315
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
316
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
317
+
318
+ this.$rules = {
319
+ "start" : [
320
+ {
321
+ token : "comment",
322
+ regex : '\\(\\*.*?\\*\\)\\s*?$'
323
+ },
324
+ {
325
+ token : "comment",
326
+ regex : '\\(\\*.*',
327
+ next : "comment"
328
+ },
329
+ {
330
+ token : "string", // single line
331
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
332
+ },
333
+ {
334
+ token : "string", // single char
335
+ regex : "'.'"
336
+ },
337
+ {
338
+ token : "string", // " string
339
+ regex : '"',
340
+ next : "qstring"
341
+ },
342
+ {
343
+ token : "constant.numeric", // imaginary
344
+ regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
345
+ },
346
+ {
347
+ token : "constant.numeric", // float
348
+ regex : floatNumber
349
+ },
350
+ {
351
+ token : "constant.numeric", // integer
352
+ regex : integer + "\\b"
353
+ },
354
+ {
355
+ token : keywordMapper,
356
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
357
+ },
358
+ {
359
+ token : "keyword.operator",
360
+ regex : "\\+\\.|\\-\\.|\\*\\.|\\/\\.|#|;;|\\+|\\-|\\*|\\*\\*\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|<-|="
361
+ },
362
+ {
363
+ token : "paren.lparen",
364
+ regex : "[[({]"
365
+ },
366
+ {
367
+ token : "paren.rparen",
368
+ regex : "[\\])}]"
369
+ },
370
+ {
371
+ token : "text",
372
+ regex : "\\s+"
373
+ }
374
+ ],
375
+ "comment" : [
376
+ {
377
+ token : "comment", // closing comment
378
+ regex : ".*?\\*\\)",
379
+ next : "start"
380
+ },
381
+ {
382
+ token : "comment", // comment spanning whole line
383
+ regex : ".+"
384
+ }
385
+ ],
386
+
387
+ "qstring" : [
388
+ {
389
+ token : "string",
390
+ regex : '"',
391
+ next : "start"
392
+ }, {
393
+ token : "string",
394
+ regex : '.+'
395
+ }
396
+ ]
397
+ };
398
+ };
399
+
400
+ oop.inherits(OcamlHighlightRules, TextHighlightRules);
401
+
402
+ exports.OcamlHighlightRules = OcamlHighlightRules;
403
+ });
404
+
405
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
406
+
407
+
408
+ var Range = require("../range").Range;
409
+
410
+ var MatchingBraceOutdent = function() {};
411
+
412
+ (function() {
413
+
414
+ this.checkOutdent = function(line, input) {
415
+ if (! /^\s+$/.test(line))
416
+ return false;
417
+
418
+ return /^\s*\}/.test(input);
419
+ };
420
+
421
+ this.autoOutdent = function(doc, row) {
422
+ var line = doc.getLine(row);
423
+ var match = line.match(/^(\s*\})/);
424
+
425
+ if (!match) return 0;
426
+
427
+ var column = match[1].length;
428
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
429
+
430
+ if (!openBracePos || openBracePos.row == row) return 0;
431
+
432
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
433
+ doc.replace(new Range(row, 0, row, column-1), indent);
434
+ };
435
+
436
+ this.$getIndent = function(line) {
437
+ return line.match(/^\s*/)[0];
438
+ };
439
+
440
+ }).call(MatchingBraceOutdent.prototype);
441
+
442
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
443
+ });
@@ -0,0 +1,233 @@
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Distributed under the BSD license:
3
+ *
4
+ * Copyright (c) 2012, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *
29
+ *
30
+ * Contributor(s):
31
+ *
32
+ *
33
+ *
34
+ * ***** END LICENSE BLOCK ***** */
35
+
36
+ define('ace/mode/pascal', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/pascal_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) {
37
+
38
+
39
+ var oop = require("../lib/oop");
40
+ var TextMode = require("./text").Mode;
41
+ var Tokenizer = require("../tokenizer").Tokenizer;
42
+ var PascalHighlightRules = require("./pascal_highlight_rules").PascalHighlightRules;
43
+ var FoldMode = require("./folding/coffee").FoldMode;
44
+
45
+ var Mode = function() {
46
+ var highlighter = new PascalHighlightRules();
47
+ this.foldingRules = new FoldMode();
48
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
49
+ };
50
+ oop.inherits(Mode, TextMode);
51
+
52
+ (function() {
53
+
54
+ this.lineCommentStart = ["--", "//"];
55
+ this.blockComment = [
56
+ {start: "(*", end: "*)"},
57
+ {start: "{", end: "}"}
58
+ ];
59
+
60
+ }).call(Mode.prototype);
61
+
62
+ exports.Mode = Mode;
63
+ });
64
+
65
+ define('ace/mode/pascal_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
66
+
67
+
68
+ var oop = require("../lib/oop");
69
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
70
+
71
+ var PascalHighlightRules = function() {
72
+
73
+ this.$rules = { start:
74
+ [ { caseInsensitive: true,
75
+ token: 'keyword.control.pascal',
76
+ regex: '\\b(?:(absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class|const|constructor|destructor|div|do|do|else|end|except|export|exports|external|far|file|finalization|finally|for|forward|goto|if|implementation|import|in|inherited|initialization|interface|interrupt|is|label|library|mod|module|name|near|nil|not|object|of|only|operator|or|or_else|otherwise|packed|pow|private|program|property|protected|public|published|qualified|record|repeat|resident|restricted|segment|set|shl|shr|then|to|try|type|unit|until|uses|value|var|view|virtual|while|with|xor))\\b' },
77
+ { caseInsensitive: true,
78
+ token:
79
+ [ 'variable.pascal', "text",
80
+ 'storage.type.prototype.pascal',
81
+ 'entity.name.function.prototype.pascal' ],
82
+ regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?(?=(?:\\(.*?\\))?;\\s*(?:attribute|forward|external))' },
83
+ { caseInsensitive: true,
84
+ token:
85
+ [ 'variable.pascal', "text",
86
+ 'storage.type.function.pascal',
87
+ 'entity.name.function.pascal' ],
88
+ regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?' },
89
+ { token: 'constant.numeric.pascal',
90
+ regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b' },
91
+ { token: 'punctuation.definition.comment.pascal',
92
+ regex: '--',
93
+ push:
94
+ [ { token: 'comment.line.double-dash.pascal.one',
95
+ regex: '$',
96
+ next: 'pop' },
97
+ { defaultToken: 'comment.line.double-dash.pascal.one' } ] },
98
+ { token: 'punctuation.definition.comment.pascal',
99
+ regex: '//',
100
+ push:
101
+ [ { token: 'comment.line.double-slash.pascal.two',
102
+ regex: '$',
103
+ next: 'pop' },
104
+ { defaultToken: 'comment.line.double-slash.pascal.two' } ] },
105
+ { token: 'punctuation.definition.comment.pascal',
106
+ regex: '\\(\\*',
107
+ push:
108
+ [ { token: 'punctuation.definition.comment.pascal',
109
+ regex: '\\*\\)',
110
+ next: 'pop' },
111
+ { defaultToken: 'comment.block.pascal.one' } ] },
112
+ { token: 'punctuation.definition.comment.pascal',
113
+ regex: '\\{',
114
+ push:
115
+ [ { token: 'punctuation.definition.comment.pascal',
116
+ regex: '\\}',
117
+ next: 'pop' },
118
+ { defaultToken: 'comment.block.pascal.two' } ] },
119
+ { token: 'punctuation.definition.string.begin.pascal',
120
+ regex: '"',
121
+ push:
122
+ [ { token: 'constant.character.escape.pascal', regex: '\\\\.' },
123
+ { token: 'punctuation.definition.string.end.pascal',
124
+ regex: '"',
125
+ next: 'pop' },
126
+ { defaultToken: 'string.quoted.double.pascal' } ],
127
+ },
128
+ { token: 'punctuation.definition.string.begin.pascal',
129
+ regex: '\'',
130
+ push:
131
+ [ { token: 'constant.character.escape.apostrophe.pascal',
132
+ regex: '\'\'' },
133
+ { token: 'punctuation.definition.string.end.pascal',
134
+ regex: '\'',
135
+ next: 'pop' },
136
+ { defaultToken: 'string.quoted.single.pascal' } ] },
137
+ { token: 'keyword.operator',
138
+ regex: '[+\\-;,/*%]|:=|=' } ] }
139
+
140
+ this.normalizeRules();
141
+ };
142
+
143
+ oop.inherits(PascalHighlightRules, TextHighlightRules);
144
+
145
+ exports.PascalHighlightRules = PascalHighlightRules;
146
+ });
147
+
148
+ define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
149
+
150
+
151
+ var oop = require("../../lib/oop");
152
+ var BaseFoldMode = require("./fold_mode").FoldMode;
153
+ var Range = require("../../range").Range;
154
+
155
+ var FoldMode = exports.FoldMode = function() {};
156
+ oop.inherits(FoldMode, BaseFoldMode);
157
+
158
+ (function() {
159
+
160
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
161
+ var range = this.indentationBlock(session, row);
162
+ if (range)
163
+ return range;
164
+
165
+ var re = /\S/;
166
+ var line = session.getLine(row);
167
+ var startLevel = line.search(re);
168
+ if (startLevel == -1 || line[startLevel] != "#")
169
+ return;
170
+
171
+ var startColumn = line.length;
172
+ var maxRow = session.getLength();
173
+ var startRow = row;
174
+ var endRow = row;
175
+
176
+ while (++row < maxRow) {
177
+ line = session.getLine(row);
178
+ var level = line.search(re);
179
+
180
+ if (level == -1)
181
+ continue;
182
+
183
+ if (line[level] != "#")
184
+ break;
185
+
186
+ endRow = row;
187
+ }
188
+
189
+ if (endRow > startRow) {
190
+ var endColumn = session.getLine(endRow).length;
191
+ return new Range(startRow, startColumn, endRow, endColumn);
192
+ }
193
+ };
194
+ this.getFoldWidget = function(session, foldStyle, row) {
195
+ var line = session.getLine(row);
196
+ var indent = line.search(/\S/);
197
+ var next = session.getLine(row + 1);
198
+ var prev = session.getLine(row - 1);
199
+ var prevIndent = prev.search(/\S/);
200
+ var nextIndent = next.search(/\S/);
201
+
202
+ if (indent == -1) {
203
+ session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
204
+ return "";
205
+ }
206
+ if (prevIndent == -1) {
207
+ if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
208
+ session.foldWidgets[row - 1] = "";
209
+ session.foldWidgets[row + 1] = "";
210
+ return "start";
211
+ }
212
+ } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
213
+ if (session.getLine(row - 2).search(/\S/) == -1) {
214
+ session.foldWidgets[row - 1] = "start";
215
+ session.foldWidgets[row + 1] = "";
216
+ return "";
217
+ }
218
+ }
219
+
220
+ if (prevIndent!= -1 && prevIndent < indent)
221
+ session.foldWidgets[row - 1] = "start";
222
+ else
223
+ session.foldWidgets[row - 1] = "";
224
+
225
+ if (indent < nextIndent)
226
+ return "start";
227
+ else
228
+ return "";
229
+ };
230
+
231
+ }).call(FoldMode.prototype);
232
+
233
+ });