gump 0.1.6

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 (359) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +24 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +71 -0
  6. data/Rakefile +2 -0
  7. data/bin/gump +37 -0
  8. data/gump.gemspec +17 -0
  9. data/lib/gump.rb +50 -0
  10. data/lib/version.rb +3 -0
  11. data/server/assets/css/style.css +6949 -0
  12. data/server/assets/images/arrow.png +0 -0
  13. data/server/assets/images/logo.png +0 -0
  14. data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css +347 -0
  15. data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css.map +1 -0
  16. data/server/assets/js/bootstrap/dist/css/bootstrap-theme.min.css +7 -0
  17. data/server/assets/js/bootstrap/dist/css/bootstrap.css +5785 -0
  18. data/server/assets/js/bootstrap/dist/css/bootstrap.css.map +1 -0
  19. data/server/assets/js/bootstrap/dist/css/bootstrap.min.css +7 -0
  20. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
  21. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +229 -0
  22. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
  23. data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
  24. data/server/assets/js/bootstrap/dist/js/bootstrap.js +1951 -0
  25. data/server/assets/js/bootstrap/dist/js/bootstrap.min.js +6 -0
  26. data/server/assets/js/jquery.codemirror/.gitattributes +8 -0
  27. data/server/assets/js/jquery.codemirror/.gitignore +6 -0
  28. data/server/assets/js/jquery.codemirror/.travis.yml +3 -0
  29. data/server/assets/js/jquery.codemirror/AUTHORS +255 -0
  30. data/server/assets/js/jquery.codemirror/CONTRIBUTING.md +72 -0
  31. data/server/assets/js/jquery.codemirror/LICENSE +19 -0
  32. data/server/assets/js/jquery.codemirror/README.md +11 -0
  33. data/server/assets/js/jquery.codemirror/addon/comment/comment.js +145 -0
  34. data/server/assets/js/jquery.codemirror/addon/comment/continuecomment.js +54 -0
  35. data/server/assets/js/jquery.codemirror/addon/dialog/dialog.css +32 -0
  36. data/server/assets/js/jquery.codemirror/addon/dialog/dialog.js +121 -0
  37. data/server/assets/js/jquery.codemirror/addon/display/fullscreen.css +6 -0
  38. data/server/assets/js/jquery.codemirror/addon/display/fullscreen.js +31 -0
  39. data/server/assets/js/jquery.codemirror/addon/display/placeholder.js +48 -0
  40. data/server/assets/js/jquery.codemirror/addon/edit/closebrackets.js +82 -0
  41. data/server/assets/js/jquery.codemirror/addon/edit/closetag.js +89 -0
  42. data/server/assets/js/jquery.codemirror/addon/edit/continuelist.js +25 -0
  43. data/server/assets/js/jquery.codemirror/addon/edit/matchbrackets.js +87 -0
  44. data/server/assets/js/jquery.codemirror/addon/edit/matchtags.js +56 -0
  45. data/server/assets/js/jquery.codemirror/addon/edit/trailingspace.js +15 -0
  46. data/server/assets/js/jquery.codemirror/addon/fold/brace-fold.js +93 -0
  47. data/server/assets/js/jquery.codemirror/addon/fold/comment-fold.js +40 -0
  48. data/server/assets/js/jquery.codemirror/addon/fold/foldcode.js +75 -0
  49. data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.css +21 -0
  50. data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.js +124 -0
  51. data/server/assets/js/jquery.codemirror/addon/fold/indent-fold.js +30 -0
  52. data/server/assets/js/jquery.codemirror/addon/fold/xml-fold.js +167 -0
  53. data/server/assets/js/jquery.codemirror/addon/hint/anyword-hint.js +34 -0
  54. data/server/assets/js/jquery.codemirror/addon/hint/css-hint.js +50 -0
  55. data/server/assets/js/jquery.codemirror/addon/hint/html-hint.js +337 -0
  56. data/server/assets/js/jquery.codemirror/addon/hint/javascript-hint.js +131 -0
  57. data/server/assets/js/jquery.codemirror/addon/hint/pig-hint.js +121 -0
  58. data/server/assets/js/jquery.codemirror/addon/hint/python-hint.js +95 -0
  59. data/server/assets/js/jquery.codemirror/addon/hint/show-hint.css +38 -0
  60. data/server/assets/js/jquery.codemirror/addon/hint/show-hint.js +286 -0
  61. data/server/assets/js/jquery.codemirror/addon/hint/sql-hint.js +105 -0
  62. data/server/assets/js/jquery.codemirror/addon/hint/xml-hint.js +69 -0
  63. data/server/assets/js/jquery.codemirror/addon/lint/coffeescript-lint.js +27 -0
  64. data/server/assets/js/jquery.codemirror/addon/lint/css-lint.js +19 -0
  65. data/server/assets/js/jquery.codemirror/addon/lint/javascript-lint.js +126 -0
  66. data/server/assets/js/jquery.codemirror/addon/lint/json-lint.js +17 -0
  67. data/server/assets/js/jquery.codemirror/addon/lint/lint.css +73 -0
  68. data/server/assets/js/jquery.codemirror/addon/lint/lint.js +203 -0
  69. data/server/assets/js/jquery.codemirror/addon/merge/dep/diff_match_patch.js +50 -0
  70. data/server/assets/js/jquery.codemirror/addon/merge/merge.css +92 -0
  71. data/server/assets/js/jquery.codemirror/addon/merge/merge.js +474 -0
  72. data/server/assets/js/jquery.codemirror/addon/mode/loadmode.js +51 -0
  73. data/server/assets/js/jquery.codemirror/addon/mode/multiplex.js +101 -0
  74. data/server/assets/js/jquery.codemirror/addon/mode/multiplex_test.js +30 -0
  75. data/server/assets/js/jquery.codemirror/addon/mode/overlay.js +59 -0
  76. data/server/assets/js/jquery.codemirror/addon/runmode/colorize.js +29 -0
  77. data/server/assets/js/jquery.codemirror/addon/runmode/runmode-standalone.js +136 -0
  78. data/server/assets/js/jquery.codemirror/addon/runmode/runmode.js +56 -0
  79. data/server/assets/js/jquery.codemirror/addon/runmode/runmode.node.js +103 -0
  80. data/server/assets/js/jquery.codemirror/addon/scroll/scrollpastend.js +34 -0
  81. data/server/assets/js/jquery.codemirror/addon/search/match-highlighter.js +91 -0
  82. data/server/assets/js/jquery.codemirror/addon/search/search.js +133 -0
  83. data/server/assets/js/jquery.codemirror/addon/search/searchcursor.js +143 -0
  84. data/server/assets/js/jquery.codemirror/addon/selection/active-line.js +39 -0
  85. data/server/assets/js/jquery.codemirror/addon/selection/mark-selection.js +108 -0
  86. data/server/assets/js/jquery.codemirror/addon/tern/tern.css +85 -0
  87. data/server/assets/js/jquery.codemirror/addon/tern/tern.js +632 -0
  88. data/server/assets/js/jquery.codemirror/addon/tern/worker.js +41 -0
  89. data/server/assets/js/jquery.codemirror/addon/wrap/hardwrap.js +99 -0
  90. data/server/assets/js/jquery.codemirror/bin/authors.sh +6 -0
  91. data/server/assets/js/jquery.codemirror/bin/compress +92 -0
  92. data/server/assets/js/jquery.codemirror/bin/lint +16 -0
  93. data/server/assets/js/jquery.codemirror/bin/source-highlight +61 -0
  94. data/server/assets/js/jquery.codemirror/bower.json +15 -0
  95. data/server/assets/js/jquery.codemirror/demo/activeline.html +78 -0
  96. data/server/assets/js/jquery.codemirror/demo/anywordhint.html +79 -0
  97. data/server/assets/js/jquery.codemirror/demo/bidi.html +74 -0
  98. data/server/assets/js/jquery.codemirror/demo/btree.html +86 -0
  99. data/server/assets/js/jquery.codemirror/demo/buffers.html +109 -0
  100. data/server/assets/js/jquery.codemirror/demo/changemode.html +59 -0
  101. data/server/assets/js/jquery.codemirror/demo/closebrackets.html +63 -0
  102. data/server/assets/js/jquery.codemirror/demo/closetag.html +40 -0
  103. data/server/assets/js/jquery.codemirror/demo/complete.html +80 -0
  104. data/server/assets/js/jquery.codemirror/demo/emacs.html +75 -0
  105. data/server/assets/js/jquery.codemirror/demo/folding.html +75 -0
  106. data/server/assets/js/jquery.codemirror/demo/fullscreen.html +130 -0
  107. data/server/assets/js/jquery.codemirror/demo/hardwrap.html +69 -0
  108. data/server/assets/js/jquery.codemirror/demo/html5complete.html +54 -0
  109. data/server/assets/js/jquery.codemirror/demo/indentwrap.html +58 -0
  110. data/server/assets/js/jquery.codemirror/demo/lint.html +171 -0
  111. data/server/assets/js/jquery.codemirror/demo/loadmode.html +49 -0
  112. data/server/assets/js/jquery.codemirror/demo/marker.html +52 -0
  113. data/server/assets/js/jquery.codemirror/demo/markselection.html +45 -0
  114. data/server/assets/js/jquery.codemirror/demo/matchhighlighter.html +47 -0
  115. data/server/assets/js/jquery.codemirror/demo/matchtags.html +49 -0
  116. data/server/assets/js/jquery.codemirror/demo/merge.html +82 -0
  117. data/server/assets/js/jquery.codemirror/demo/multiplex.html +75 -0
  118. data/server/assets/js/jquery.codemirror/demo/mustache.html +68 -0
  119. data/server/assets/js/jquery.codemirror/demo/placeholder.html +45 -0
  120. data/server/assets/js/jquery.codemirror/demo/preview.html +88 -0
  121. data/server/assets/js/jquery.codemirror/demo/resize.html +58 -0
  122. data/server/assets/js/jquery.codemirror/demo/runmode.html +62 -0
  123. data/server/assets/js/jquery.codemirror/demo/search.html +94 -0
  124. data/server/assets/js/jquery.codemirror/demo/spanaffectswrapping_shim.html +85 -0
  125. data/server/assets/js/jquery.codemirror/demo/tern.html +129 -0
  126. data/server/assets/js/jquery.codemirror/demo/theme.html +121 -0
  127. data/server/assets/js/jquery.codemirror/demo/trailingspace.html +48 -0
  128. data/server/assets/js/jquery.codemirror/demo/variableheight.html +67 -0
  129. data/server/assets/js/jquery.codemirror/demo/vim.html +74 -0
  130. data/server/assets/js/jquery.codemirror/demo/visibletabs.html +62 -0
  131. data/server/assets/js/jquery.codemirror/demo/widget.html +85 -0
  132. data/server/assets/js/jquery.codemirror/demo/xmlcomplete.html +116 -0
  133. data/server/assets/js/jquery.codemirror/index.html +192 -0
  134. data/server/assets/js/jquery.codemirror/keymap/emacs.js +387 -0
  135. data/server/assets/js/jquery.codemirror/keymap/extra.js +43 -0
  136. data/server/assets/js/jquery.codemirror/keymap/vim.js +3703 -0
  137. data/server/assets/js/jquery.codemirror/lib/codemirror.css +263 -0
  138. data/server/assets/js/jquery.codemirror/lib/codemirror.js +5944 -0
  139. data/server/assets/js/jquery.codemirror/mode/apl/apl.js +160 -0
  140. data/server/assets/js/jquery.codemirror/mode/apl/index.html +72 -0
  141. data/server/assets/js/jquery.codemirror/mode/asterisk/asterisk.js +183 -0
  142. data/server/assets/js/jquery.codemirror/mode/asterisk/index.html +154 -0
  143. data/server/assets/js/jquery.codemirror/mode/clike/clike.js +362 -0
  144. data/server/assets/js/jquery.codemirror/mode/clike/index.html +195 -0
  145. data/server/assets/js/jquery.codemirror/mode/clike/scala.html +767 -0
  146. data/server/assets/js/jquery.codemirror/mode/clojure/clojure.js +224 -0
  147. data/server/assets/js/jquery.codemirror/mode/clojure/index.html +88 -0
  148. data/server/assets/js/jquery.codemirror/mode/cobol/cobol.js +240 -0
  149. data/server/assets/js/jquery.codemirror/mode/cobol/index.html +210 -0
  150. data/server/assets/js/jquery.codemirror/mode/coffeescript/coffeescript.js +354 -0
  151. data/server/assets/js/jquery.codemirror/mode/coffeescript/index.html +740 -0
  152. data/server/assets/js/jquery.codemirror/mode/commonlisp/commonlisp.js +105 -0
  153. data/server/assets/js/jquery.codemirror/mode/commonlisp/index.html +177 -0
  154. data/server/assets/js/jquery.codemirror/mode/css/css.js +639 -0
  155. data/server/assets/js/jquery.codemirror/mode/css/index.html +70 -0
  156. data/server/assets/js/jquery.codemirror/mode/css/scss.html +157 -0
  157. data/server/assets/js/jquery.codemirror/mode/css/scss_test.js +93 -0
  158. data/server/assets/js/jquery.codemirror/mode/css/test.js +142 -0
  159. data/server/assets/js/jquery.codemirror/mode/d/d.js +205 -0
  160. data/server/assets/js/jquery.codemirror/mode/d/index.html +273 -0
  161. data/server/assets/js/jquery.codemirror/mode/diff/diff.js +32 -0
  162. data/server/assets/js/jquery.codemirror/mode/diff/index.html +117 -0
  163. data/server/assets/js/jquery.codemirror/mode/dtd/dtd.js +127 -0
  164. data/server/assets/js/jquery.codemirror/mode/dtd/index.html +89 -0
  165. data/server/assets/js/jquery.codemirror/mode/ecl/ecl.js +192 -0
  166. data/server/assets/js/jquery.codemirror/mode/ecl/index.html +52 -0
  167. data/server/assets/js/jquery.codemirror/mode/eiffel/eiffel.js +147 -0
  168. data/server/assets/js/jquery.codemirror/mode/eiffel/index.html +430 -0
  169. data/server/assets/js/jquery.codemirror/mode/erlang/erlang.js +484 -0
  170. data/server/assets/js/jquery.codemirror/mode/erlang/index.html +75 -0
  171. data/server/assets/js/jquery.codemirror/mode/fortran/fortran.js +173 -0
  172. data/server/assets/js/jquery.codemirror/mode/fortran/index.html +81 -0
  173. data/server/assets/js/jquery.codemirror/mode/gas/gas.js +330 -0
  174. data/server/assets/js/jquery.codemirror/mode/gas/index.html +68 -0
  175. data/server/assets/js/jquery.codemirror/mode/gfm/gfm.js +97 -0
  176. data/server/assets/js/jquery.codemirror/mode/gfm/index.html +82 -0
  177. data/server/assets/js/jquery.codemirror/mode/gfm/test.js +112 -0
  178. data/server/assets/js/jquery.codemirror/mode/gherkin/gherkin.js +168 -0
  179. data/server/assets/js/jquery.codemirror/mode/gherkin/index.html +48 -0
  180. data/server/assets/js/jquery.codemirror/mode/go/go.js +168 -0
  181. data/server/assets/js/jquery.codemirror/mode/go/index.html +85 -0
  182. data/server/assets/js/jquery.codemirror/mode/groovy/groovy.js +211 -0
  183. data/server/assets/js/jquery.codemirror/mode/groovy/index.html +84 -0
  184. data/server/assets/js/jquery.codemirror/mode/haml/haml.js +153 -0
  185. data/server/assets/js/jquery.codemirror/mode/haml/index.html +79 -0
  186. data/server/assets/js/jquery.codemirror/mode/haml/test.js +94 -0
  187. data/server/assets/js/jquery.codemirror/mode/haskell/haskell.js +250 -0
  188. data/server/assets/js/jquery.codemirror/mode/haskell/index.html +73 -0
  189. data/server/assets/js/jquery.codemirror/mode/haxe/haxe.js +429 -0
  190. data/server/assets/js/jquery.codemirror/mode/haxe/index.html +103 -0
  191. data/server/assets/js/jquery.codemirror/mode/htmlembedded/htmlembedded.js +73 -0
  192. data/server/assets/js/jquery.codemirror/mode/htmlembedded/index.html +60 -0
  193. data/server/assets/js/jquery.codemirror/mode/htmlmixed/htmlmixed.js +104 -0
  194. data/server/assets/js/jquery.codemirror/mode/htmlmixed/index.html +85 -0
  195. data/server/assets/js/jquery.codemirror/mode/http/http.js +98 -0
  196. data/server/assets/js/jquery.codemirror/mode/http/index.html +45 -0
  197. data/server/assets/js/jquery.codemirror/mode/index.html +114 -0
  198. data/server/assets/js/jquery.codemirror/mode/jade/index.html +66 -0
  199. data/server/assets/js/jquery.codemirror/mode/jade/jade.js +90 -0
  200. data/server/assets/js/jquery.codemirror/mode/javascript/index.html +107 -0
  201. data/server/assets/js/jquery.codemirror/mode/javascript/javascript.js +617 -0
  202. data/server/assets/js/jquery.codemirror/mode/javascript/test.js +72 -0
  203. data/server/assets/js/jquery.codemirror/mode/javascript/typescript.html +61 -0
  204. data/server/assets/js/jquery.codemirror/mode/jinja2/index.html +50 -0
  205. data/server/assets/js/jquery.codemirror/mode/jinja2/jinja2.js +42 -0
  206. data/server/assets/js/jquery.codemirror/mode/julia/index.html +187 -0
  207. data/server/assets/js/jquery.codemirror/mode/julia/julia.js +262 -0
  208. data/server/assets/js/jquery.codemirror/mode/less/index.html +753 -0
  209. data/server/assets/js/jquery.codemirror/mode/less/less.js +346 -0
  210. data/server/assets/js/jquery.codemirror/mode/livescript/index.html +459 -0
  211. data/server/assets/js/jquery.codemirror/mode/livescript/livescript.js +267 -0
  212. data/server/assets/js/jquery.codemirror/mode/livescript/livescript.ls +266 -0
  213. data/server/assets/js/jquery.codemirror/mode/lua/index.html +86 -0
  214. data/server/assets/js/jquery.codemirror/mode/lua/lua.js +144 -0
  215. data/server/assets/js/jquery.codemirror/mode/markdown/index.html +359 -0
  216. data/server/assets/js/jquery.codemirror/mode/markdown/markdown.js +560 -0
  217. data/server/assets/js/jquery.codemirror/mode/markdown/test.js +664 -0
  218. data/server/assets/js/jquery.codemirror/mode/meta.js +91 -0
  219. data/server/assets/js/jquery.codemirror/mode/mirc/index.html +161 -0
  220. data/server/assets/js/jquery.codemirror/mode/mirc/mirc.js +177 -0
  221. data/server/assets/js/jquery.codemirror/mode/nginx/index.html +181 -0
  222. data/server/assets/js/jquery.codemirror/mode/nginx/nginx.js +163 -0
  223. data/server/assets/js/jquery.codemirror/mode/ntriples/index.html +45 -0
  224. data/server/assets/js/jquery.codemirror/mode/ntriples/ntriples.js +170 -0
  225. data/server/assets/js/jquery.codemirror/mode/ocaml/index.html +146 -0
  226. data/server/assets/js/jquery.codemirror/mode/ocaml/ocaml.js +116 -0
  227. data/server/assets/js/jquery.codemirror/mode/octave/index.html +95 -0
  228. data/server/assets/js/jquery.codemirror/mode/octave/octave.js +118 -0
  229. data/server/assets/js/jquery.codemirror/mode/pascal/index.html +61 -0
  230. data/server/assets/js/jquery.codemirror/mode/pascal/pascal.js +94 -0
  231. data/server/assets/js/jquery.codemirror/mode/pegjs/index.html +66 -0
  232. data/server/assets/js/jquery.codemirror/mode/pegjs/pegjs.js +103 -0
  233. data/server/assets/js/jquery.codemirror/mode/perl/index.html +75 -0
  234. data/server/assets/js/jquery.codemirror/mode/perl/perl.js +816 -0
  235. data/server/assets/js/jquery.codemirror/mode/php/index.html +62 -0
  236. data/server/assets/js/jquery.codemirror/mode/php/php.js +132 -0
  237. data/server/assets/js/jquery.codemirror/mode/pig/index.html +55 -0
  238. data/server/assets/js/jquery.codemirror/mode/pig/pig.js +171 -0
  239. data/server/assets/js/jquery.codemirror/mode/properties/index.html +53 -0
  240. data/server/assets/js/jquery.codemirror/mode/properties/properties.js +63 -0
  241. data/server/assets/js/jquery.codemirror/mode/python/index.html +187 -0
  242. data/server/assets/js/jquery.codemirror/mode/python/python.js +368 -0
  243. data/server/assets/js/jquery.codemirror/mode/q/index.html +144 -0
  244. data/server/assets/js/jquery.codemirror/mode/q/q.js +124 -0
  245. data/server/assets/js/jquery.codemirror/mode/r/index.html +86 -0
  246. data/server/assets/js/jquery.codemirror/mode/r/r.js +141 -0
  247. data/server/assets/js/jquery.codemirror/mode/rpm/changes/changes.js +19 -0
  248. data/server/assets/js/jquery.codemirror/mode/rpm/changes/index.html +67 -0
  249. data/server/assets/js/jquery.codemirror/mode/rpm/spec/index.html +114 -0
  250. data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.css +5 -0
  251. data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.js +66 -0
  252. data/server/assets/js/jquery.codemirror/mode/rst/index.html +534 -0
  253. data/server/assets/js/jquery.codemirror/mode/rst/rst.js +560 -0
  254. data/server/assets/js/jquery.codemirror/mode/ruby/index.html +185 -0
  255. data/server/assets/js/jquery.codemirror/mode/ruby/ruby.js +247 -0
  256. data/server/assets/js/jquery.codemirror/mode/rust/index.html +61 -0
  257. data/server/assets/js/jquery.codemirror/mode/rust/rust.js +436 -0
  258. data/server/assets/js/jquery.codemirror/mode/sass/index.html +66 -0
  259. data/server/assets/js/jquery.codemirror/mode/sass/sass.js +330 -0
  260. data/server/assets/js/jquery.codemirror/mode/scheme/index.html +77 -0
  261. data/server/assets/js/jquery.codemirror/mode/scheme/scheme.js +232 -0
  262. data/server/assets/js/jquery.codemirror/mode/shell/index.html +66 -0
  263. data/server/assets/js/jquery.codemirror/mode/shell/shell.js +118 -0
  264. data/server/assets/js/jquery.codemirror/mode/sieve/index.html +93 -0
  265. data/server/assets/js/jquery.codemirror/mode/sieve/sieve.js +183 -0
  266. data/server/assets/js/jquery.codemirror/mode/smalltalk/index.html +68 -0
  267. data/server/assets/js/jquery.codemirror/mode/smalltalk/smalltalk.js +151 -0
  268. data/server/assets/js/jquery.codemirror/mode/smarty/index.html +136 -0
  269. data/server/assets/js/jquery.codemirror/mode/smarty/smarty.js +205 -0
  270. data/server/assets/js/jquery.codemirror/mode/smartymixed/index.html +114 -0
  271. data/server/assets/js/jquery.codemirror/mode/smartymixed/smartymixed.js +175 -0
  272. data/server/assets/js/jquery.codemirror/mode/sparql/index.html +54 -0
  273. data/server/assets/js/jquery.codemirror/mode/sparql/sparql.js +145 -0
  274. data/server/assets/js/jquery.codemirror/mode/sql/index.html +75 -0
  275. data/server/assets/js/jquery.codemirror/mode/sql/sql.js +365 -0
  276. data/server/assets/js/jquery.codemirror/mode/stex/index.html +110 -0
  277. data/server/assets/js/jquery.codemirror/mode/stex/stex.js +246 -0
  278. data/server/assets/js/jquery.codemirror/mode/stex/test.js +120 -0
  279. data/server/assets/js/jquery.codemirror/mode/tcl/index.html +143 -0
  280. data/server/assets/js/jquery.codemirror/mode/tcl/tcl.js +131 -0
  281. data/server/assets/js/jquery.codemirror/mode/tiddlywiki/index.html +155 -0
  282. data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  283. data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
  284. data/server/assets/js/jquery.codemirror/mode/tiki/index.html +95 -0
  285. data/server/assets/js/jquery.codemirror/mode/tiki/tiki.css +26 -0
  286. data/server/assets/js/jquery.codemirror/mode/tiki/tiki.js +308 -0
  287. data/server/assets/js/jquery.codemirror/mode/toml/index.html +73 -0
  288. data/server/assets/js/jquery.codemirror/mode/toml/toml.js +71 -0
  289. data/server/assets/js/jquery.codemirror/mode/turtle/index.html +51 -0
  290. data/server/assets/js/jquery.codemirror/mode/turtle/turtle.js +145 -0
  291. data/server/assets/js/jquery.codemirror/mode/vb/index.html +103 -0
  292. data/server/assets/js/jquery.codemirror/mode/vb/vb.js +259 -0
  293. data/server/assets/js/jquery.codemirror/mode/vbscript/index.html +55 -0
  294. data/server/assets/js/jquery.codemirror/mode/vbscript/vbscript.js +334 -0
  295. data/server/assets/js/jquery.codemirror/mode/velocity/index.html +119 -0
  296. data/server/assets/js/jquery.codemirror/mode/velocity/velocity.js +186 -0
  297. data/server/assets/js/jquery.codemirror/mode/verilog/index.html +132 -0
  298. data/server/assets/js/jquery.codemirror/mode/verilog/verilog.js +182 -0
  299. data/server/assets/js/jquery.codemirror/mode/xml/index.html +57 -0
  300. data/server/assets/js/jquery.codemirror/mode/xml/xml.js +345 -0
  301. data/server/assets/js/jquery.codemirror/mode/xquery/index.html +210 -0
  302. data/server/assets/js/jquery.codemirror/mode/xquery/test.js +64 -0
  303. data/server/assets/js/jquery.codemirror/mode/xquery/xquery.js +432 -0
  304. data/server/assets/js/jquery.codemirror/mode/yaml/index.html +80 -0
  305. data/server/assets/js/jquery.codemirror/mode/yaml/yaml.js +97 -0
  306. data/server/assets/js/jquery.codemirror/mode/z80/index.html +52 -0
  307. data/server/assets/js/jquery.codemirror/mode/z80/z80.js +85 -0
  308. data/server/assets/js/jquery.codemirror/package.json +19 -0
  309. data/server/assets/js/jquery.codemirror/test/comment_test.js +51 -0
  310. data/server/assets/js/jquery.codemirror/test/doc_test.js +329 -0
  311. data/server/assets/js/jquery.codemirror/test/driver.js +139 -0
  312. data/server/assets/js/jquery.codemirror/test/emacs_test.js +135 -0
  313. data/server/assets/js/jquery.codemirror/test/index.html +209 -0
  314. data/server/assets/js/jquery.codemirror/test/lint/acorn.js +1593 -0
  315. data/server/assets/js/jquery.codemirror/test/lint/lint.js +139 -0
  316. data/server/assets/js/jquery.codemirror/test/lint/walk.js +216 -0
  317. data/server/assets/js/jquery.codemirror/test/mode_test.css +10 -0
  318. data/server/assets/js/jquery.codemirror/test/mode_test.js +200 -0
  319. data/server/assets/js/jquery.codemirror/test/phantom_driver.js +31 -0
  320. data/server/assets/js/jquery.codemirror/test/run.js +34 -0
  321. data/server/assets/js/jquery.codemirror/test/test.js +1562 -0
  322. data/server/assets/js/jquery.codemirror/test/vim_test.js +2391 -0
  323. data/server/assets/js/jquery.codemirror/theme/3024-day.css +34 -0
  324. data/server/assets/js/jquery.codemirror/theme/3024-night.css +34 -0
  325. data/server/assets/js/jquery.codemirror/theme/ambiance-mobile.css +5 -0
  326. data/server/assets/js/jquery.codemirror/theme/ambiance.css +70 -0
  327. data/server/assets/js/jquery.codemirror/theme/base16-dark.css +34 -0
  328. data/server/assets/js/jquery.codemirror/theme/base16-light.css +34 -0
  329. data/server/assets/js/jquery.codemirror/theme/blackboard.css +28 -0
  330. data/server/assets/js/jquery.codemirror/theme/cobalt.css +21 -0
  331. data/server/assets/js/jquery.codemirror/theme/eclipse.css +23 -0
  332. data/server/assets/js/jquery.codemirror/theme/elegant.css +13 -0
  333. data/server/assets/js/jquery.codemirror/theme/erlang-dark.css +30 -0
  334. data/server/assets/js/jquery.codemirror/theme/lesser-dark.css +47 -0
  335. data/server/assets/js/jquery.codemirror/theme/mbo.css +37 -0
  336. data/server/assets/js/jquery.codemirror/theme/midnight.css +43 -0
  337. data/server/assets/js/jquery.codemirror/theme/monokai.css +29 -0
  338. data/server/assets/js/jquery.codemirror/theme/neat.css +12 -0
  339. data/server/assets/js/jquery.codemirror/theme/night.css +24 -0
  340. data/server/assets/js/jquery.codemirror/theme/paraiso-dark.css +34 -0
  341. data/server/assets/js/jquery.codemirror/theme/paraiso-light.css +34 -0
  342. data/server/assets/js/jquery.codemirror/theme/rubyblue.css +23 -0
  343. data/server/assets/js/jquery.codemirror/theme/solarized.css +180 -0
  344. data/server/assets/js/jquery.codemirror/theme/the-matrix.css +26 -0
  345. data/server/assets/js/jquery.codemirror/theme/tomorrow-night-eighties.css +34 -0
  346. data/server/assets/js/jquery.codemirror/theme/twilight.css +28 -0
  347. data/server/assets/js/jquery.codemirror/theme/vibrant-ink.css +30 -0
  348. data/server/assets/js/jquery.codemirror/theme/xq-dark.css +49 -0
  349. data/server/assets/js/jquery.codemirror/theme/xq-light.css +43 -0
  350. data/server/assets/js/jquery.js +4 -0
  351. data/server/assets/js/jquery.nanoscroller/jquery.nanoscroller.js +2 -0
  352. data/server/assets/js/jquery.nanoscroller/nanoscroller.css +49 -0
  353. data/server/assets/js/tester.js +161 -0
  354. data/server/config.ru +2 -0
  355. data/server/server.rb +41 -0
  356. data/server/views/_content.erb +65 -0
  357. data/server/views/_sidebar.erb +32 -0
  358. data/server/views/index.erb +40 -0
  359. metadata +402 -0
@@ -0,0 +1,210 @@
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: COBOL mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <link rel="stylesheet" href="../../theme/neat.css">
9
+ <link rel="stylesheet" href="../../theme/elegant.css">
10
+ <link rel="stylesheet" href="../../theme/erlang-dark.css">
11
+ <link rel="stylesheet" href="../../theme/night.css">
12
+ <link rel="stylesheet" href="../../theme/monokai.css">
13
+ <link rel="stylesheet" href="../../theme/cobalt.css">
14
+ <link rel="stylesheet" href="../../theme/eclipse.css">
15
+ <link rel="stylesheet" href="../../theme/rubyblue.css">
16
+ <link rel="stylesheet" href="../../theme/lesser-dark.css">
17
+ <link rel="stylesheet" href="../../theme/xq-dark.css">
18
+ <link rel="stylesheet" href="../../theme/xq-light.css">
19
+ <link rel="stylesheet" href="../../theme/ambiance.css">
20
+ <link rel="stylesheet" href="../../theme/blackboard.css">
21
+ <link rel="stylesheet" href="../../theme/vibrant-ink.css">
22
+ <link rel="stylesheet" href="../../theme/solarized.css">
23
+ <link rel="stylesheet" href="../../theme/twilight.css">
24
+ <link rel="stylesheet" href="../../theme/midnight.css">
25
+ <link rel="stylesheet" href="../../addon/dialog/dialog.css">
26
+ <script src="../../lib/codemirror.js"></script>
27
+ <script src="../../addon/edit/matchbrackets.js"></script>
28
+ <script src="cobol.js"></script>
29
+ <script src="../../addon/selection/active-line.js"></script>
30
+ <script src="../../addon/search/search.js"></script>
31
+ <script src="../../addon/dialog/dialog.js"></script>
32
+ <script src="../../addon/search/searchcursor.js"></script>
33
+ <style>
34
+ .CodeMirror {
35
+ border: 1px solid #eee;
36
+ font-size : 20px;
37
+ height : auto !important;
38
+ }
39
+ .CodeMirror-activeline-background {background: #555555 !important;}
40
+ </style>
41
+ <div id=nav>
42
+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
43
+
44
+ <ul>
45
+ <li><a href="../../index.html">Home</a>
46
+ <li><a href="../../doc/manual.html">Manual</a>
47
+ <li><a href="https://github.com/marijnh/codemirror">Code</a>
48
+ </ul>
49
+ <ul>
50
+ <li><a href="../index.html">Language modes</a>
51
+ <li><a class=active href="#">COBOL</a>
52
+ </ul>
53
+ </div>
54
+
55
+ <article>
56
+ <h2>COBOL mode</h2>
57
+
58
+ <p> Select Theme <select onchange="selectTheme()" id="selectTheme">
59
+ <option>default</option>
60
+ <option>ambiance</option>
61
+ <option>blackboard</option>
62
+ <option>cobalt</option>
63
+ <option>eclipse</option>
64
+ <option>elegant</option>
65
+ <option>erlang-dark</option>
66
+ <option>lesser-dark</option>
67
+ <option>midnight</option>
68
+ <option>monokai</option>
69
+ <option>neat</option>
70
+ <option>night</option>
71
+ <option>rubyblue</option>
72
+ <option>solarized dark</option>
73
+ <option>solarized light</option>
74
+ <option selected>twilight</option>
75
+ <option>vibrant-ink</option>
76
+ <option>xq-dark</option>
77
+ <option>xq-light</option>
78
+ </select> Select Font Size <select onchange="selectFontsize()" id="selectFontSize">
79
+ <option value="13px">13px</option>
80
+ <option value="14px">14px</option>
81
+ <option value="16px">16px</option>
82
+ <option value="18px">18px</option>
83
+ <option value="20px" selected="selected">20px</option>
84
+ <option value="24px">24px</option>
85
+ <option value="26px">26px</option>
86
+ <option value="28px">28px</option>
87
+ <option value="30px">30px</option>
88
+ <option value="32px">32px</option>
89
+ <option value="34px">34px</option>
90
+ <option value="36px">36px</option>
91
+ </select>
92
+ <label for="checkBoxReadOnly">Read-only</label>
93
+ <input type="checkbox" id="checkBoxReadOnly" onchange="selectReadOnly()">
94
+ <label for="id_tabToIndentSpace">Insert Spaces on Tab</label>
95
+ <input type="checkbox" id="id_tabToIndentSpace" onchange="tabToIndentSpace()">
96
+ </p>
97
+ <textarea id="code" name="code">
98
+ ---------1---------2---------3---------4---------5---------6---------7---------8
99
+ 12345678911234567892123456789312345678941234567895123456789612345678971234567898
100
+ 000010 IDENTIFICATION DIVISION. MODTGHERE
101
+ 000020 PROGRAM-ID. SAMPLE.
102
+ 000030 AUTHOR. TEST SAM.
103
+ 000040 DATE-WRITTEN. 5 February 2013
104
+ 000041
105
+ 000042* A sample program just to show the form.
106
+ 000043* The program copies its input to the output,
107
+ 000044* and counts the number of records.
108
+ 000045* At the end this number is printed.
109
+ 000046
110
+ 000050 ENVIRONMENT DIVISION.
111
+ 000060 INPUT-OUTPUT SECTION.
112
+ 000070 FILE-CONTROL.
113
+ 000080 SELECT STUDENT-FILE ASSIGN TO SYSIN
114
+ 000090 ORGANIZATION IS LINE SEQUENTIAL.
115
+ 000100 SELECT PRINT-FILE ASSIGN TO SYSOUT
116
+ 000110 ORGANIZATION IS LINE SEQUENTIAL.
117
+ 000120
118
+ 000130 DATA DIVISION.
119
+ 000140 FILE SECTION.
120
+ 000150 FD STUDENT-FILE
121
+ 000160 RECORD CONTAINS 43 CHARACTERS
122
+ 000170 DATA RECORD IS STUDENT-IN.
123
+ 000180 01 STUDENT-IN PIC X(43).
124
+ 000190
125
+ 000200 FD PRINT-FILE
126
+ 000210 RECORD CONTAINS 80 CHARACTERS
127
+ 000220 DATA RECORD IS PRINT-LINE.
128
+ 000230 01 PRINT-LINE PIC X(80).
129
+ 000240
130
+ 000250 WORKING-STORAGE SECTION.
131
+ 000260 01 DATA-REMAINS-SWITCH PIC X(2) VALUE SPACES.
132
+ 000261 01 RECORDS-WRITTEN PIC 99.
133
+ 000270
134
+ 000280 01 DETAIL-LINE.
135
+ 000290 05 FILLER PIC X(7) VALUE SPACES.
136
+ 000300 05 RECORD-IMAGE PIC X(43).
137
+ 000310 05 FILLER PIC X(30) VALUE SPACES.
138
+ 000311
139
+ 000312 01 SUMMARY-LINE.
140
+ 000313 05 FILLER PIC X(7) VALUE SPACES.
141
+ 000314 05 TOTAL-READ PIC 99.
142
+ 000315 05 FILLER PIC X VALUE SPACE.
143
+ 000316 05 FILLER PIC X(17)
144
+ 000317 VALUE 'Records were read'.
145
+ 000318 05 FILLER PIC X(53) VALUE SPACES.
146
+ 000319
147
+ 000320 PROCEDURE DIVISION.
148
+ 000321
149
+ 000330 PREPARE-SENIOR-REPORT.
150
+ 000340 OPEN INPUT STUDENT-FILE
151
+ 000350 OUTPUT PRINT-FILE.
152
+ 000351 MOVE ZERO TO RECORDS-WRITTEN.
153
+ 000360 READ STUDENT-FILE
154
+ 000370 AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
155
+ 000380 END-READ.
156
+ 000390 PERFORM PROCESS-RECORDS
157
+ 000410 UNTIL DATA-REMAINS-SWITCH = 'NO'.
158
+ 000411 PERFORM PRINT-SUMMARY.
159
+ 000420 CLOSE STUDENT-FILE
160
+ 000430 PRINT-FILE.
161
+ 000440 STOP RUN.
162
+ 000450
163
+ 000460 PROCESS-RECORDS.
164
+ 000470 MOVE STUDENT-IN TO RECORD-IMAGE.
165
+ 000480 MOVE DETAIL-LINE TO PRINT-LINE.
166
+ 000490 WRITE PRINT-LINE.
167
+ 000500 ADD 1 TO RECORDS-WRITTEN.
168
+ 000510 READ STUDENT-FILE
169
+ 000520 AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
170
+ 000530 END-READ.
171
+ 000540
172
+ 000550 PRINT-SUMMARY.
173
+ 000560 MOVE RECORDS-WRITTEN TO TOTAL-READ.
174
+ 000570 MOVE SUMMARY-LINE TO PRINT-LINE.
175
+ 000571 WRITE PRINT-LINE.
176
+ 000572
177
+ 000580
178
+ </textarea>
179
+ <script>
180
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
181
+ lineNumbers: true,
182
+ matchBrackets: true,
183
+ mode: "text/x-cobol",
184
+ theme : "twilight",
185
+ styleActiveLine: true,
186
+ showCursorWhenSelecting : true,
187
+ });
188
+ function selectTheme() {
189
+ var themeInput = document.getElementById("selectTheme");
190
+ var theme = themeInput.options[themeInput.selectedIndex].innerHTML;
191
+ editor.setOption("theme", theme);
192
+ }
193
+ function selectFontsize() {
194
+ var fontSizeInput = document.getElementById("selectFontSize");
195
+ var fontSize = fontSizeInput.options[fontSizeInput.selectedIndex].innerHTML;
196
+ editor.getWrapperElement().style["font-size"] = fontSize;
197
+ editor.refresh();
198
+ }
199
+ function selectReadOnly() {
200
+ editor.setOption("readOnly", document.getElementById("checkBoxReadOnly").checked);
201
+ }
202
+ function tabToIndentSpace() {
203
+ if (document.getElementById("id_tabToIndentSpace").checked) {
204
+ editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection(" ", "end"); }});
205
+ } else {
206
+ editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection(" ", "end"); }});
207
+ }
208
+ }
209
+ </script>
210
+ </article>
@@ -0,0 +1,354 @@
1
+ /**
2
+ * Link to the project's GitHub page:
3
+ * https://github.com/pickhardt/coffeescript-codemirror-mode
4
+ */
5
+ CodeMirror.defineMode("coffeescript", function(conf) {
6
+ var ERRORCLASS = "error";
7
+
8
+ function wordRegexp(words) {
9
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
10
+ }
11
+
12
+ var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?)/;
13
+ var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/;
14
+ var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/;
15
+ var properties = /^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/;
16
+
17
+ var wordOperators = wordRegexp(["and", "or", "not",
18
+ "is", "isnt", "in",
19
+ "instanceof", "typeof"]);
20
+ var indentKeywords = ["for", "while", "loop", "if", "unless", "else",
21
+ "switch", "try", "catch", "finally", "class"];
22
+ var commonKeywords = ["break", "by", "continue", "debugger", "delete",
23
+ "do", "in", "of", "new", "return", "then",
24
+ "this", "throw", "when", "until"];
25
+
26
+ var keywords = wordRegexp(indentKeywords.concat(commonKeywords));
27
+
28
+ indentKeywords = wordRegexp(indentKeywords);
29
+
30
+
31
+ var stringPrefixes = /^('{3}|\"{3}|['\"])/;
32
+ var regexPrefixes = /^(\/{3}|\/)/;
33
+ var commonConstants = ["Infinity", "NaN", "undefined", "null", "true", "false", "on", "off", "yes", "no"];
34
+ var constants = wordRegexp(commonConstants);
35
+
36
+ // Tokenizers
37
+ function tokenBase(stream, state) {
38
+ // Handle scope changes
39
+ if (stream.sol()) {
40
+ if (state.scope.align === null) state.scope.align = false;
41
+ var scopeOffset = state.scope.offset;
42
+ if (stream.eatSpace()) {
43
+ var lineOffset = stream.indentation();
44
+ if (lineOffset > scopeOffset && state.scope.type == "coffee") {
45
+ return "indent";
46
+ } else if (lineOffset < scopeOffset) {
47
+ return "dedent";
48
+ }
49
+ return null;
50
+ } else {
51
+ if (scopeOffset > 0) {
52
+ dedent(stream, state);
53
+ }
54
+ }
55
+ }
56
+ if (stream.eatSpace()) {
57
+ return null;
58
+ }
59
+
60
+ var ch = stream.peek();
61
+
62
+ // Handle docco title comment (single line)
63
+ if (stream.match("####")) {
64
+ stream.skipToEnd();
65
+ return "comment";
66
+ }
67
+
68
+ // Handle multi line comments
69
+ if (stream.match("###")) {
70
+ state.tokenize = longComment;
71
+ return state.tokenize(stream, state);
72
+ }
73
+
74
+ // Single line comment
75
+ if (ch === "#") {
76
+ stream.skipToEnd();
77
+ return "comment";
78
+ }
79
+
80
+ // Handle number literals
81
+ if (stream.match(/^-?[0-9\.]/, false)) {
82
+ var floatLiteral = false;
83
+ // Floats
84
+ if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) {
85
+ floatLiteral = true;
86
+ }
87
+ if (stream.match(/^-?\d+\.\d*/)) {
88
+ floatLiteral = true;
89
+ }
90
+ if (stream.match(/^-?\.\d+/)) {
91
+ floatLiteral = true;
92
+ }
93
+
94
+ if (floatLiteral) {
95
+ // prevent from getting extra . on 1..
96
+ if (stream.peek() == "."){
97
+ stream.backUp(1);
98
+ }
99
+ return "number";
100
+ }
101
+ // Integers
102
+ var intLiteral = false;
103
+ // Hex
104
+ if (stream.match(/^-?0x[0-9a-f]+/i)) {
105
+ intLiteral = true;
106
+ }
107
+ // Decimal
108
+ if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) {
109
+ intLiteral = true;
110
+ }
111
+ // Zero by itself with no other piece of number.
112
+ if (stream.match(/^-?0(?![\dx])/i)) {
113
+ intLiteral = true;
114
+ }
115
+ if (intLiteral) {
116
+ return "number";
117
+ }
118
+ }
119
+
120
+ // Handle strings
121
+ if (stream.match(stringPrefixes)) {
122
+ state.tokenize = tokenFactory(stream.current(), "string");
123
+ return state.tokenize(stream, state);
124
+ }
125
+ // Handle regex literals
126
+ if (stream.match(regexPrefixes)) {
127
+ if (stream.current() != "/" || stream.match(/^.*\//, false)) { // prevent highlight of division
128
+ state.tokenize = tokenFactory(stream.current(), "string-2");
129
+ return state.tokenize(stream, state);
130
+ } else {
131
+ stream.backUp(1);
132
+ }
133
+ }
134
+
135
+ // Handle operators and delimiters
136
+ if (stream.match(operators) || stream.match(wordOperators)) {
137
+ return "operator";
138
+ }
139
+ if (stream.match(delimiters)) {
140
+ return "punctuation";
141
+ }
142
+
143
+ if (stream.match(constants)) {
144
+ return "atom";
145
+ }
146
+
147
+ if (stream.match(keywords)) {
148
+ return "keyword";
149
+ }
150
+
151
+ if (stream.match(identifiers)) {
152
+ return "variable";
153
+ }
154
+
155
+ if (stream.match(properties)) {
156
+ return "property";
157
+ }
158
+
159
+ // Handle non-detected items
160
+ stream.next();
161
+ return ERRORCLASS;
162
+ }
163
+
164
+ function tokenFactory(delimiter, outclass) {
165
+ var singleline = delimiter.length == 1;
166
+ return function(stream, state) {
167
+ while (!stream.eol()) {
168
+ stream.eatWhile(/[^'"\/\\]/);
169
+ if (stream.eat("\\")) {
170
+ stream.next();
171
+ if (singleline && stream.eol()) {
172
+ return outclass;
173
+ }
174
+ } else if (stream.match(delimiter)) {
175
+ state.tokenize = tokenBase;
176
+ return outclass;
177
+ } else {
178
+ stream.eat(/['"\/]/);
179
+ }
180
+ }
181
+ if (singleline) {
182
+ if (conf.mode.singleLineStringErrors) {
183
+ outclass = ERRORCLASS;
184
+ } else {
185
+ state.tokenize = tokenBase;
186
+ }
187
+ }
188
+ return outclass;
189
+ };
190
+ }
191
+
192
+ function longComment(stream, state) {
193
+ while (!stream.eol()) {
194
+ stream.eatWhile(/[^#]/);
195
+ if (stream.match("###")) {
196
+ state.tokenize = tokenBase;
197
+ break;
198
+ }
199
+ stream.eatWhile("#");
200
+ }
201
+ return "comment";
202
+ }
203
+
204
+ function indent(stream, state, type) {
205
+ type = type || "coffee";
206
+ var offset = 0, align = false, alignOffset = null;
207
+ for (var scope = state.scope; scope; scope = scope.prev) {
208
+ if (scope.type === "coffee") {
209
+ offset = scope.offset + conf.indentUnit;
210
+ break;
211
+ }
212
+ }
213
+ if (type !== "coffee") {
214
+ align = null;
215
+ alignOffset = stream.column() + stream.current().length;
216
+ } else if (state.scope.align) {
217
+ state.scope.align = false;
218
+ }
219
+ state.scope = {
220
+ offset: offset,
221
+ type: type,
222
+ prev: state.scope,
223
+ align: align,
224
+ alignOffset: alignOffset
225
+ };
226
+ }
227
+
228
+ function dedent(stream, state) {
229
+ if (!state.scope.prev) return;
230
+ if (state.scope.type === "coffee") {
231
+ var _indent = stream.indentation();
232
+ var matched = false;
233
+ for (var scope = state.scope; scope; scope = scope.prev) {
234
+ if (_indent === scope.offset) {
235
+ matched = true;
236
+ break;
237
+ }
238
+ }
239
+ if (!matched) {
240
+ return true;
241
+ }
242
+ while (state.scope.prev && state.scope.offset !== _indent) {
243
+ state.scope = state.scope.prev;
244
+ }
245
+ return false;
246
+ } else {
247
+ state.scope = state.scope.prev;
248
+ return false;
249
+ }
250
+ }
251
+
252
+ function tokenLexer(stream, state) {
253
+ var style = state.tokenize(stream, state);
254
+ var current = stream.current();
255
+
256
+ // Handle "." connected identifiers
257
+ if (current === ".") {
258
+ style = state.tokenize(stream, state);
259
+ current = stream.current();
260
+ if (/^\.[\w$]+$/.test(current)) {
261
+ return "variable";
262
+ } else {
263
+ return ERRORCLASS;
264
+ }
265
+ }
266
+
267
+ // Handle scope changes.
268
+ if (current === "return") {
269
+ state.dedent += 1;
270
+ }
271
+ if (((current === "->" || current === "=>") &&
272
+ !state.lambda &&
273
+ !stream.peek())
274
+ || style === "indent") {
275
+ indent(stream, state);
276
+ }
277
+ var delimiter_index = "[({".indexOf(current);
278
+ if (delimiter_index !== -1) {
279
+ indent(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
280
+ }
281
+ if (indentKeywords.exec(current)){
282
+ indent(stream, state);
283
+ }
284
+ if (current == "then"){
285
+ dedent(stream, state);
286
+ }
287
+
288
+
289
+ if (style === "dedent") {
290
+ if (dedent(stream, state)) {
291
+ return ERRORCLASS;
292
+ }
293
+ }
294
+ delimiter_index = "])}".indexOf(current);
295
+ if (delimiter_index !== -1) {
296
+ while (state.scope.type == "coffee" && state.scope.prev)
297
+ state.scope = state.scope.prev;
298
+ if (state.scope.type == current)
299
+ state.scope = state.scope.prev;
300
+ }
301
+ if (state.dedent > 0 && stream.eol() && state.scope.type == "coffee") {
302
+ if (state.scope.prev) state.scope = state.scope.prev;
303
+ state.dedent -= 1;
304
+ }
305
+
306
+ return style;
307
+ }
308
+
309
+ var external = {
310
+ startState: function(basecolumn) {
311
+ return {
312
+ tokenize: tokenBase,
313
+ scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false},
314
+ lastToken: null,
315
+ lambda: false,
316
+ dedent: 0
317
+ };
318
+ },
319
+
320
+ token: function(stream, state) {
321
+ var fillAlign = state.scope.align === null && state.scope;
322
+ if (fillAlign && stream.sol()) fillAlign.align = false;
323
+
324
+ var style = tokenLexer(stream, state);
325
+ if (fillAlign && style && style != "comment") fillAlign.align = true;
326
+
327
+ state.lastToken = {style:style, content: stream.current()};
328
+
329
+ if (stream.eol() && stream.lambda) {
330
+ state.lambda = false;
331
+ }
332
+
333
+ return style;
334
+ },
335
+
336
+ indent: function(state, text) {
337
+ if (state.tokenize != tokenBase) return 0;
338
+ var scope = state.scope;
339
+ var closer = text && "])}".indexOf(text.charAt(0)) > -1;
340
+ if (closer) while (scope.type == "coffee" && scope.prev) scope = scope.prev;
341
+ var closes = closer && scope.type === text.charAt(0);
342
+ if (scope.align)
343
+ return scope.alignOffset - (closes ? 1 : 0);
344
+ else
345
+ return (closes ? scope.prev : scope).offset;
346
+ },
347
+
348
+ lineComment: "#",
349
+ fold: "indent"
350
+ };
351
+ return external;
352
+ });
353
+
354
+ CodeMirror.defineMIME("text/x-coffeescript", "coffeescript");