ace-rails-ap 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +1 -1
  3. data/lib/ace/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/ace/ace.js +6911 -5290
  5. data/vendor/assets/javascripts/ace/ext-chromevox.js +537 -0
  6. data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +301 -0
  7. data/vendor/assets/javascripts/ace/ext-emmet.js +1109 -0
  8. data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +207 -0
  9. data/vendor/assets/javascripts/ace/ext-language_tools.js +1665 -0
  10. data/vendor/assets/javascripts/ace/ext-modelist.js +168 -0
  11. data/vendor/assets/javascripts/ace/ext-old_ie.js +500 -0
  12. data/vendor/assets/javascripts/ace/ext-options.js +252 -0
  13. data/vendor/assets/javascripts/ace/ext-searchbox.js +421 -0
  14. data/vendor/assets/javascripts/ace/ext-settings_menu.js +632 -0
  15. data/vendor/assets/javascripts/ace/ext-spellcheck.js +68 -0
  16. data/vendor/assets/javascripts/ace/ext-split.js +271 -0
  17. data/vendor/assets/javascripts/ace/ext-static_highlight.js +178 -0
  18. data/vendor/assets/javascripts/ace/ext-statusbar.js +47 -0
  19. data/vendor/assets/javascripts/ace/ext-textarea.js +478 -0
  20. data/vendor/assets/javascripts/ace/ext-themelist.js +86 -0
  21. data/vendor/assets/javascripts/ace/ext-whitespace.js +206 -0
  22. data/vendor/assets/javascripts/ace/keybinding-emacs.js +822 -131
  23. data/vendor/assets/javascripts/ace/keybinding-vim.js +382 -258
  24. data/vendor/assets/javascripts/ace/mode-abap.js +261 -0
  25. data/vendor/assets/javascripts/ace/mode-actionscript.js +257 -0
  26. data/vendor/assets/javascripts/ace/mode-ada.js +118 -0
  27. data/vendor/assets/javascripts/ace/mode-asciidoc.js +373 -0
  28. data/vendor/assets/javascripts/ace/mode-assembly_x86.js +217 -0
  29. data/vendor/assets/javascripts/ace/mode-autohotkey.js +225 -0
  30. data/vendor/assets/javascripts/ace/mode-batchfile.js +213 -0
  31. data/vendor/assets/javascripts/ace/mode-c9search.js +144 -124
  32. data/vendor/assets/javascripts/ace/mode-c_cpp.js +296 -254
  33. data/vendor/assets/javascripts/ace/mode-clojure.js +113 -177
  34. data/vendor/assets/javascripts/ace/mode-cobol.js +125 -0
  35. data/vendor/assets/javascripts/ace/mode-coffee.js +152 -235
  36. data/vendor/assets/javascripts/ace/mode-coldfusion.js +823 -835
  37. data/vendor/assets/javascripts/ace/mode-csharp.js +325 -187
  38. data/vendor/assets/javascripts/ace/mode-css.js +583 -297
  39. data/vendor/assets/javascripts/ace/mode-curly.js +2423 -0
  40. data/vendor/assets/javascripts/ace/mode-d.js +492 -0
  41. data/vendor/assets/javascripts/ace/mode-dart.js +993 -0
  42. data/vendor/assets/javascripts/ace/mode-diff.js +124 -204
  43. data/vendor/assets/javascripts/ace/mode-django.js +2448 -0
  44. data/vendor/assets/javascripts/ace/mode-dot.js +361 -0
  45. data/vendor/assets/javascripts/ace/mode-ejs.js +2817 -0
  46. data/vendor/assets/javascripts/ace/mode-erlang.js +987 -0
  47. data/vendor/assets/javascripts/ace/mode-forth.js +280 -0
  48. data/vendor/assets/javascripts/ace/mode-ftl.js +1061 -0
  49. data/vendor/assets/javascripts/ace/mode-glsl.js +313 -275
  50. data/vendor/assets/javascripts/ace/mode-golang.js +268 -275
  51. data/vendor/assets/javascripts/ace/mode-groovy.js +347 -492
  52. data/vendor/assets/javascripts/ace/mode-haml.js +498 -0
  53. data/vendor/assets/javascripts/ace/mode-handlebars.js +2433 -0
  54. data/vendor/assets/javascripts/ace/mode-haskell.js +362 -0
  55. data/vendor/assets/javascripts/ace/mode-haxe.js +226 -202
  56. data/vendor/assets/javascripts/ace/mode-html.js +1099 -802
  57. data/vendor/assets/javascripts/ace/mode-html_completions.js +309 -0
  58. data/vendor/assets/javascripts/ace/mode-html_ruby.js +2822 -0
  59. data/vendor/assets/javascripts/ace/mode-ini.js +185 -0
  60. data/vendor/assets/javascripts/ace/mode-jack.js +653 -0
  61. data/vendor/assets/javascripts/ace/mode-jade.js +2081 -0
  62. data/vendor/assets/javascripts/ace/mode-java.js +339 -488
  63. data/vendor/assets/javascripts/ace/mode-javascript.js +342 -478
  64. data/vendor/assets/javascripts/ace/mode-json.js +215 -178
  65. data/vendor/assets/javascripts/ace/mode-jsoniq.js +2761 -0
  66. data/vendor/assets/javascripts/ace/mode-jsp.js +1553 -0
  67. data/vendor/assets/javascripts/ace/mode-jsx.js +325 -289
  68. data/vendor/assets/javascripts/ace/mode-julia.js +286 -0
  69. data/vendor/assets/javascripts/ace/mode-latex.js +141 -46
  70. data/vendor/assets/javascripts/ace/mode-less.js +493 -151
  71. data/vendor/assets/javascripts/ace/mode-liquid.js +594 -656
  72. data/vendor/assets/javascripts/ace/mode-lisp.js +137 -0
  73. data/vendor/assets/javascripts/ace/mode-livescript.js +288 -0
  74. data/vendor/assets/javascripts/ace/mode-logiql.js +669 -0
  75. data/vendor/assets/javascripts/ace/mode-lsl.js +890 -0
  76. data/vendor/assets/javascripts/ace/mode-lua.js +274 -368
  77. data/vendor/assets/javascripts/ace/mode-luapage.js +1331 -1107
  78. data/vendor/assets/javascripts/ace/mode-lucene.js +64 -0
  79. data/vendor/assets/javascripts/ace/mode-makefile.js +332 -0
  80. data/vendor/assets/javascripts/ace/mode-markdown.js +1303 -948
  81. data/vendor/assets/javascripts/ace/mode-matlab.js +230 -0
  82. data/vendor/assets/javascripts/ace/mode-mushcode.js +705 -0
  83. data/vendor/assets/javascripts/ace/mode-mushcode_high_rules.js +569 -0
  84. data/vendor/assets/javascripts/ace/mode-mysql.js +185 -0
  85. data/vendor/assets/javascripts/ace/mode-nix.js +935 -0
  86. data/vendor/assets/javascripts/ace/mode-objectivec.js +699 -0
  87. data/vendor/assets/javascripts/ace/mode-ocaml.js +44 -63
  88. data/vendor/assets/javascripts/ace/mode-pascal.js +233 -0
  89. data/vendor/assets/javascripts/ace/mode-perl.js +116 -189
  90. data/vendor/assets/javascripts/ace/mode-pgsql.js +886 -500
  91. data/vendor/assets/javascripts/ace/mode-php.js +1158 -380
  92. data/vendor/assets/javascripts/ace/mode-plain_text.js +56 -0
  93. data/vendor/assets/javascripts/ace/mode-powershell.js +222 -167
  94. data/vendor/assets/javascripts/ace/mode-prolog.js +354 -0
  95. data/vendor/assets/javascripts/ace/mode-properties.js +100 -0
  96. data/vendor/assets/javascripts/ace/mode-protobuf.js +885 -0
  97. data/vendor/assets/javascripts/ace/mode-python.js +99 -201
  98. data/vendor/assets/javascripts/ace/mode-r.js +337 -0
  99. data/vendor/assets/javascripts/ace/mode-rdoc.js +210 -0
  100. data/vendor/assets/javascripts/ace/mode-rhtml.js +2663 -0
  101. data/vendor/assets/javascripts/ace/mode-ruby.js +262 -136
  102. data/vendor/assets/javascripts/ace/mode-rust.js +245 -0
  103. data/vendor/assets/javascripts/ace/mode-sass.js +443 -0
  104. data/vendor/assets/javascripts/ace/mode-scad.js +225 -240
  105. data/vendor/assets/javascripts/ace/mode-scala.js +340 -494
  106. data/vendor/assets/javascripts/ace/mode-scheme.js +143 -0
  107. data/vendor/assets/javascripts/ace/mode-scss.js +499 -157
  108. data/vendor/assets/javascripts/ace/mode-sh.js +180 -110
  109. data/vendor/assets/javascripts/ace/mode-sjs.js +1154 -0
  110. data/vendor/assets/javascripts/ace/mode-snippets.js +198 -0
  111. data/vendor/assets/javascripts/ace/mode-soy_template.js +2707 -0
  112. data/vendor/assets/javascripts/ace/mode-space.js +160 -0
  113. data/vendor/assets/javascripts/ace/mode-sql.js +48 -69
  114. data/vendor/assets/javascripts/ace/mode-stylus.js +447 -0
  115. data/vendor/assets/javascripts/ace/mode-svg.js +552 -605
  116. data/vendor/assets/javascripts/ace/mode-tcl.js +139 -98
  117. data/vendor/assets/javascripts/ace/mode-tex.js +187 -0
  118. data/vendor/assets/javascripts/ace/mode-textile.js +29 -40
  119. data/vendor/assets/javascripts/ace/mode-tmsnippet.js +200 -0
  120. data/vendor/assets/javascripts/ace/mode-toml.js +177 -0
  121. data/vendor/assets/javascripts/ace/mode-twig.js +2228 -0
  122. data/vendor/assets/javascripts/ace/mode-typescript.js +1018 -0
  123. data/vendor/assets/javascripts/ace/mode-vbscript.js +250 -0
  124. data/vendor/assets/javascripts/ace/mode-velocity.js +1621 -0
  125. data/vendor/assets/javascripts/ace/mode-verilog.js +127 -0
  126. data/vendor/assets/javascripts/ace/mode-vhdl.js +139 -0
  127. data/vendor/assets/javascripts/ace/mode-xml.js +350 -242
  128. data/vendor/assets/javascripts/ace/mode-xquery.js +2490 -300
  129. data/vendor/assets/javascripts/ace/mode-yaml.js +146 -45
  130. data/vendor/assets/javascripts/ace/theme-ambiance.js +202 -0
  131. data/vendor/assets/javascripts/ace/theme-chaos.js +179 -0
  132. data/vendor/assets/javascripts/ace/theme-chrome.js +97 -153
  133. data/vendor/assets/javascripts/ace/theme-clouds.js +78 -119
  134. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +79 -120
  135. data/vendor/assets/javascripts/ace/theme-cobalt.js +89 -140
  136. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +93 -145
  137. data/vendor/assets/javascripts/ace/theme-dawn.js +84 -143
  138. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +99 -162
  139. data/vendor/assets/javascripts/ace/theme-eclipse.js +78 -111
  140. data/vendor/assets/javascripts/ace/theme-github.js +70 -121
  141. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +75 -134
  142. data/vendor/assets/javascripts/ace/theme-kr.js +135 -0
  143. data/vendor/assets/javascripts/ace/theme-merbivore.js +80 -143
  144. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +81 -149
  145. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +87 -146
  146. data/vendor/assets/javascripts/ace/theme-monokai.js +88 -146
  147. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +82 -142
  148. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +83 -144
  149. data/vendor/assets/javascripts/ace/theme-solarized_light.js +76 -133
  150. data/vendor/assets/javascripts/ace/theme-terminal.js +145 -0
  151. data/vendor/assets/javascripts/ace/theme-textmate.js +101 -158
  152. data/vendor/assets/javascripts/ace/theme-tomorrow.js +89 -163
  153. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +89 -163
  154. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +89 -165
  155. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +101 -162
  156. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +90 -160
  157. data/vendor/assets/javascripts/ace/theme-twilight.js +87 -158
  158. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +75 -140
  159. data/vendor/assets/javascripts/ace/theme-xcode.js +120 -0
  160. data/vendor/assets/javascripts/ace/worker-coffee.js +3049 -2665
  161. data/vendor/assets/javascripts/ace/worker-css.js +1779 -4376
  162. data/vendor/assets/javascripts/ace/worker-javascript.js +8701 -9008
  163. data/vendor/assets/javascripts/ace/worker-json.js +709 -1340
  164. data/vendor/assets/javascripts/ace/worker-lua.js +3525 -0
  165. data/vendor/assets/javascripts/ace/worker-php.js +6893 -0
  166. data/vendor/assets/javascripts/ace/worker-xquery.js +19924 -64507
  167. metadata +100 -17
@@ -1,39 +1,30 @@
1
1
  /* ***** BEGIN LICENSE BLOCK *****
2
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2
+ * Distributed under the BSD license:
3
3
  *
4
- * The contents of this file are subject to the Mozilla Public License Version
5
- * 1.1 (the "License"); you may not use this file except in compliance with
6
- * the License. You may obtain a copy of the License at
7
- * http://www.mozilla.org/MPL/
8
- *
9
- * Software distributed under the License is distributed on an "AS IS" basis,
10
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
- * for the specific language governing rights and limitations under the
12
- * License.
13
- *
14
- * The Original Code is Ajax.org Code Editor (ACE).
15
- *
16
- * The Initial Developer of the Original Code is
17
- * Ajax.org B.V.
18
- * Portions created by the Initial Developer are Copyright (C) 2010
19
- * the Initial Developer. All Rights Reserved.
20
- *
21
- * Contributor(s):
22
- * Fabian Jakobs <fabian AT ajax DOT org>
23
- * Shlomo Zalman Heigh <shlomozalmanheigh AT gmail DOT com>
24
- * Carin Meier
25
- *
26
- * Alternatively, the contents of this file may be used under the terms of
27
- * either the GNU General Public License Version 2 or later (the "GPL"), or
28
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
- * in which case the provisions of the GPL or the LGPL are applicable instead
30
- * of those above. If you wish to allow use of your version of this file only
31
- * under the terms of either the GPL or the LGPL, and not to allow others to
32
- * use your version of this file under the terms of the MPL, indicate your
33
- * decision by deleting the provisions above and replace them with the notice
34
- * and other provisions required by the GPL or the LGPL. If you do not delete
35
- * the provisions above, a recipient may use your version of this file under
36
- * the terms of any one of the MPL, the GPL or the LGPL.
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.
37
28
  *
38
29
  * ***** END LICENSE BLOCK ***** */
39
30
 
@@ -48,45 +39,19 @@ var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensO
48
39
  var Range = require("../range").Range;
49
40
 
50
41
  var Mode = function() {
51
- this.$tokenizer = new Tokenizer(new ClojureHighlightRules().getRules());
42
+ this.HighlightRules = ClojureHighlightRules;
52
43
  this.$outdent = new MatchingParensOutdent();
53
44
  };
54
45
  oop.inherits(Mode, TextMode);
55
46
 
56
47
  (function() {
57
48
 
58
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
59
- var outdent = true;
60
- var re = /^(\s*)#/;
61
-
62
- for (var i=startRow; i<= endRow; i++) {
63
- if (!re.test(doc.getLine(i))) {
64
- outdent = false;
65
- break;
66
- }
67
- }
68
-
69
- if (outdent) {
70
- var deleteRange = new Range(0, 0, 0, 0);
71
- for (var i=startRow; i<= endRow; i++)
72
- {
73
- var line = doc.getLine(i);
74
- var m = line.match(re);
75
- deleteRange.start.row = i;
76
- deleteRange.end.row = i;
77
- deleteRange.end.column = m[0].length;
78
- doc.replace(deleteRange, m[1]);
79
- }
80
- }
81
- else {
82
- doc.indentRows(startRow, endRow, ";");
83
- }
84
- };
49
+ this.lineCommentStart = ";";
85
50
 
86
51
  this.getNextLineIndent = function(state, line, tab) {
87
52
  var indent = this.$getIndent(line);
88
53
 
89
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
54
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
90
55
  var tokens = tokenizedLine.tokens;
91
56
 
92
57
  if (tokens.length && tokens[tokens.length-1].type == "comment") {
@@ -115,115 +80,110 @@ oop.inherits(Mode, TextMode);
115
80
  this.$outdent.autoOutdent(doc, row);
116
81
  };
117
82
 
83
+ this.$id = "ace/mode/clojure";
118
84
  }).call(Mode.prototype);
119
85
 
120
86
  exports.Mode = Mode;
121
87
  });
122
88
 
123
- define('ace/mode/clojure_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
89
+ define('ace/mode/clojure_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
124
90
 
125
91
 
126
92
  var oop = require("../lib/oop");
127
- var lang = require("../lib/lang");
128
93
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
129
94
 
130
95
 
131
96
 
132
97
  var ClojureHighlightRules = function() {
133
98
 
134
- var builtinFunctions = lang.arrayToMap(
135
- ('* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
136
- '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' +
137
- '*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' +
138
- '*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' +
139
- '*read-eval* *source-path* *use-context-classloader* ' +
140
- '*warn-on-reflection* + - -> -&gt; ->> -&gt;&gt; .. / < &lt; <= &lt;= = ' +
141
- '== > &gt; >= &gt;= accessor aclone ' +
142
- 'add-classpath add-watch agent agent-errors aget alength alias all-ns ' +
143
- 'alter alter-meta! alter-var-root amap ancestors and apply areduce ' +
144
- 'array-map aset aset-boolean aset-byte aset-char aset-double aset-float ' +
145
- 'aset-int aset-long aset-short assert assoc assoc! assoc-in associative? ' +
146
- 'atom await await-for await1 bases bean bigdec bigint binding bit-and ' +
147
- 'bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left ' +
148
- 'bit-shift-right bit-test bit-xor boolean boolean-array booleans ' +
149
- 'bound-fn bound-fn* butlast byte byte-array bytes cast char char-array ' +
150
- 'char-escape-string char-name-string char? chars chunk chunk-append ' +
151
- 'chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? ' +
152
- 'class class? clear-agent-errors clojure-version coll? comment commute ' +
153
- 'comp comparator compare compare-and-set! compile complement concat cond ' +
154
- 'condp conj conj! cons constantly construct-proxy contains? count ' +
155
- 'counted? create-ns create-struct cycle dec decimal? declare definline ' +
156
- 'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' +
157
- 'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' +
158
- 'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' +
159
- 'double-array doubles drop drop-last drop-while empty empty? ensure ' +
160
- 'enumeration-seq eval even? every? false? ffirst file-seq filter find ' +
161
- 'find-doc find-ns find-var first float float-array float? floats flush ' +
162
- 'fn fn? fnext for force format future future-call future-cancel ' +
163
- 'future-cancelled? future-done? future? gen-class gen-interface gensym ' +
164
- 'get get-in get-method get-proxy-class get-thread-bindings get-validator ' +
165
- 'hash hash-map hash-set identical? identity if-let if-not ifn? import ' +
166
- 'in-ns inc init-proxy instance? int int-array integer? interleave intern ' +
167
- 'interpose into into-array ints io! isa? iterate iterator-seq juxt key ' +
168
- 'keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list ' +
169
- 'list* list? load load-file load-reader load-string loaded-libs locking ' +
170
- 'long long-array longs loop macroexpand macroexpand-1 make-array ' +
171
- 'make-hierarchy map map? mapcat max max-key memfn memoize merge ' +
172
- 'merge-with meta method-sig methods min min-key mod name namespace neg? ' +
173
- 'newline next nfirst nil? nnext not not-any? not-empty not-every? not= ' +
174
- 'ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ' +
175
- 'ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? ' +
176
- 'or parents partial partition pcalls peek persistent! pmap pop pop! ' +
177
- 'pop-thread-bindings pos? pr pr-str prefer-method prefers ' +
178
- 'primitives-classnames print print-ctor print-doc print-dup print-method ' +
179
- 'print-namespace-doc print-simple print-special-doc print-str printf ' +
180
- 'println println-str prn prn-str promise proxy proxy-call-with-super ' +
181
- 'proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot ' +
182
- 'rand rand-int range ratio? rational? rationalize re-find re-groups ' +
183
- 're-matcher re-matches re-pattern re-seq read read-line read-string ' +
184
- 'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' +
185
- 'refer refer-clojure release-pending-sends rem remove remove-method ' +
186
- 'remove-ns remove-watch repeat repeatedly replace replicate require ' +
187
- 'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' +
188
- 'rsubseq second select-keys send send-off seq seq? seque sequence ' +
189
- 'sequential? set set-validator! set? short short-array shorts ' +
190
- 'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' +
191
- 'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' +
192
- 'split-at split-with str stream? string? struct struct-map subs subseq ' +
193
- 'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' +
194
- 'take-last take-nth take-while test the-ns time to-array to-array-2d ' +
195
- 'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' +
196
- 'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' +
197
- 'unchecked-remainder unchecked-subtract underive unquote ' +
198
- 'unquote-splicing update-in update-proxy use val vals var-get var-set ' +
199
- 'var? vary-meta vec vector vector? when when-first when-let when-not ' +
200
- 'while with-bindings with-bindings* with-in-str with-loading-context ' +
201
- 'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' +
202
- 'zero? zipmap ').split(" ")
203
- );
204
-
205
- var keywords = lang.arrayToMap(
206
- ('def do fn if let loop monitor-enter monitor-exit new quote recur set! ' +
207
- 'throw try var').split(" ")
99
+ var builtinFunctions = (
100
+ '* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
101
+ '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' +
102
+ '*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' +
103
+ '*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' +
104
+ '*read-eval* *source-path* *use-context-classloader* ' +
105
+ '*warn-on-reflection* + - -> ->> .. / < <= = ' +
106
+ '== > &gt; >= &gt;= accessor aclone ' +
107
+ 'add-classpath add-watch agent agent-errors aget alength alias all-ns ' +
108
+ 'alter alter-meta! alter-var-root amap ancestors and apply areduce ' +
109
+ 'array-map aset aset-boolean aset-byte aset-char aset-double aset-float ' +
110
+ 'aset-int aset-long aset-short assert assoc assoc! assoc-in associative? ' +
111
+ 'atom await await-for await1 bases bean bigdec bigint binding bit-and ' +
112
+ 'bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left ' +
113
+ 'bit-shift-right bit-test bit-xor boolean boolean-array booleans ' +
114
+ 'bound-fn bound-fn* butlast byte byte-array bytes cast char char-array ' +
115
+ 'char-escape-string char-name-string char? chars chunk chunk-append ' +
116
+ 'chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? ' +
117
+ 'class class? clear-agent-errors clojure-version coll? comment commute ' +
118
+ 'comp comparator compare compare-and-set! compile complement concat cond ' +
119
+ 'condp conj conj! cons constantly construct-proxy contains? count ' +
120
+ 'counted? create-ns create-struct cycle dec decimal? declare definline ' +
121
+ 'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' +
122
+ 'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' +
123
+ 'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' +
124
+ 'double-array doubles drop drop-last drop-while empty empty? ensure ' +
125
+ 'enumeration-seq eval even? every? false? ffirst file-seq filter find ' +
126
+ 'find-doc find-ns find-var first float float-array float? floats flush ' +
127
+ 'fn fn? fnext for force format future future-call future-cancel ' +
128
+ 'future-cancelled? future-done? future? gen-class gen-interface gensym ' +
129
+ 'get get-in get-method get-proxy-class get-thread-bindings get-validator ' +
130
+ 'hash hash-map hash-set identical? identity if-let if-not ifn? import ' +
131
+ 'in-ns inc init-proxy instance? int int-array integer? interleave intern ' +
132
+ 'interpose into into-array ints io! isa? iterate iterator-seq juxt key ' +
133
+ 'keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list ' +
134
+ 'list* list? load load-file load-reader load-string loaded-libs locking ' +
135
+ 'long long-array longs loop macroexpand macroexpand-1 make-array ' +
136
+ 'make-hierarchy map map? mapcat max max-key memfn memoize merge ' +
137
+ 'merge-with meta method-sig methods min min-key mod name namespace neg? ' +
138
+ 'newline next nfirst nil? nnext not not-any? not-empty not-every? not= ' +
139
+ 'ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ' +
140
+ 'ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? ' +
141
+ 'or parents partial partition pcalls peek persistent! pmap pop pop! ' +
142
+ 'pop-thread-bindings pos? pr pr-str prefer-method prefers ' +
143
+ 'primitives-classnames print print-ctor print-doc print-dup print-method ' +
144
+ 'print-namespace-doc print-simple print-special-doc print-str printf ' +
145
+ 'println println-str prn prn-str promise proxy proxy-call-with-super ' +
146
+ 'proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot ' +
147
+ 'rand rand-int range ratio? rational? rationalize re-find re-groups ' +
148
+ 're-matcher re-matches re-pattern re-seq read read-line read-string ' +
149
+ 'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' +
150
+ 'refer refer-clojure release-pending-sends rem remove remove-method ' +
151
+ 'remove-ns remove-watch repeat repeatedly replace replicate require ' +
152
+ 'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' +
153
+ 'rsubseq second select-keys send send-off seq seq? seque sequence ' +
154
+ 'sequential? set set-validator! set? short short-array shorts ' +
155
+ 'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' +
156
+ 'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' +
157
+ 'split-at split-with str stream? string? struct struct-map subs subseq ' +
158
+ 'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' +
159
+ 'take-last take-nth take-while test the-ns time to-array to-array-2d ' +
160
+ 'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' +
161
+ 'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' +
162
+ 'unchecked-remainder unchecked-subtract underive unquote ' +
163
+ 'unquote-splicing update-in update-proxy use val vals var-get var-set ' +
164
+ 'var? vary-meta vec vector vector? when when-first when-let when-not ' +
165
+ 'while with-bindings with-bindings* with-in-str with-loading-context ' +
166
+ 'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' +
167
+ 'zero? zipmap'
208
168
  );
209
169
 
210
- var buildinConstants = lang.arrayToMap(
211
- ("true false nil").split(" ")
170
+ var keywords = ('throw try var ' +
171
+ 'def do fn if let loop monitor-enter monitor-exit new quote recur set!'
212
172
  );
213
173
 
174
+ var buildinConstants = ("true false nil");
214
175
 
215
- // regexp must not have capturing parentheses. Use (?:) instead.
216
- // regexps are ordered -> the first match is used
176
+ var keywordMapper = this.createKeywordMapper({
177
+ "keyword": keywords,
178
+ "constant.language": buildinConstants,
179
+ "support.function": builtinFunctions
180
+ }, "identifier", false, " ");
217
181
 
218
182
  this.$rules = {
219
183
  "start" : [
220
184
  {
221
185
  token : "comment",
222
186
  regex : ";.*$"
223
- }, {
224
- token : "comment", // multi line comment
225
- regex : "^=begin$",
226
- next : "comment"
227
187
  }, {
228
188
  token : "keyword", //parens
229
189
  regex : "[\\(|\\)]"
@@ -258,51 +218,27 @@ var ClojureHighlightRules = function() {
258
218
  token : "constant.language",
259
219
  regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]'
260
220
  }, {
261
- token : function(value) {
262
- if (keywords.hasOwnProperty(value))
263
- return "keyword";
264
- else if (buildinConstants.hasOwnProperty(value))
265
- return "constant.language";
266
- else if (builtinFunctions.hasOwnProperty(value))
267
- return "support.function";
268
- else
269
- return "identifier";
270
- },
271
- // TODO: Unicode escape sequences
272
- // TODO: Unicode identifiers
273
- regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
221
+ token : keywordMapper,
222
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"
274
223
  }, {
275
224
  token : "string", // single line
276
225
  regex : '"',
277
226
  next: "string"
278
227
  }, {
279
- token : "string", // symbol
280
- regex : "[:](?:[a-zA-Z]|\\d)+"
228
+ token : "constant", // symbol
229
+ regex : /:[^()\[\]{}'"\^%`,;\s]+/
281
230
  }, {
282
231
  token : "string.regexp", //Regular Expressions
283
232
  regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g'
284
233
  }
285
234
 
286
235
  ],
287
- "comment" : [
288
- {
289
- token : "comment", // closing comment
290
- regex : "^=end$",
291
- next : "start"
292
- }, {
293
- token : "comment", // comment spanning whole line
294
- merge : true,
295
- regex : ".+"
296
- }
297
- ],
298
236
  "string" : [
299
237
  {
300
- token : "constant.language.escape",
301
- merge : true,
238
+ token : "constant.language.escape",
302
239
  regex : "\\\\.|\\\\$"
303
240
  }, {
304
- token : "string",
305
- merge : true,
241
+ token : "string",
306
242
  regex : '[^"\\\\]+'
307
243
  }, {
308
244
  token : "string",
@@ -0,0 +1,125 @@
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/cobol', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/cobol_highlight_rules', '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 CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules;
38
+ var Range = require("../range").Range;
39
+
40
+ var Mode = function() {
41
+ this.HighlightRules = CobolHighlightRules;
42
+ };
43
+ oop.inherits(Mode, TextMode);
44
+
45
+ (function() {
46
+
47
+ this.lineCommentStart = "*";
48
+
49
+ this.$id = "ace/mode/cobol";
50
+ }).call(Mode.prototype);
51
+
52
+ exports.Mode = Mode;
53
+
54
+ });
55
+
56
+ define('ace/mode/cobol_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
57
+
58
+
59
+ var oop = require("../lib/oop");
60
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
61
+
62
+ var CobolHighlightRules = function() {
63
+ var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" +
64
+ "AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" +
65
+ "ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" +
66
+ "TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" +
67
+ "UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" +
68
+ "PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" +
69
+ "CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" +
70
+ "COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" +
71
+ "RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" +
72
+ "DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" +
73
+ "ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" +
74
+ "EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT";
75
+
76
+ var builtinConstants = (
77
+ "true|false|null"
78
+ );
79
+
80
+ var builtinFunctions = (
81
+ "count|min|max|avg|sum|rank|now|coalesce|main"
82
+ );
83
+
84
+ var keywordMapper = this.createKeywordMapper({
85
+ "support.function": builtinFunctions,
86
+ "keyword": keywords,
87
+ "constant.language": builtinConstants
88
+ }, "identifier", true);
89
+
90
+ this.$rules = {
91
+ "start" : [ {
92
+ token : "comment",
93
+ regex : "\\*.*$"
94
+ }, {
95
+ token : "string", // " string
96
+ regex : '".*?"'
97
+ }, {
98
+ token : "string", // ' string
99
+ regex : "'.*?'"
100
+ }, {
101
+ token : "constant.numeric", // float
102
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
103
+ }, {
104
+ token : keywordMapper,
105
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
106
+ }, {
107
+ token : "keyword.operator",
108
+ regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
109
+ }, {
110
+ token : "paren.lparen",
111
+ regex : "[\\(]"
112
+ }, {
113
+ token : "paren.rparen",
114
+ regex : "[\\)]"
115
+ }, {
116
+ token : "text",
117
+ regex : "\\s+"
118
+ } ]
119
+ };
120
+ };
121
+
122
+ oop.inherits(CobolHighlightRules, TextHighlightRules);
123
+
124
+ exports.CobolHighlightRules = CobolHighlightRules;
125
+ });