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,330 @@
1
+ CodeMirror.defineMode("sass", function(config) {
2
+ var tokenRegexp = function(words){
3
+ return new RegExp("^" + words.join("|"));
4
+ };
5
+
6
+ var keywords = ["true", "false", "null", "auto"];
7
+ var keywordsRegexp = new RegExp("^" + keywords.join("|"));
8
+
9
+ var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", "\\!=", "/", "\\*", "%", "and", "or", "not"];
10
+ var opRegexp = tokenRegexp(operators);
11
+
12
+ var pseudoElementsRegexp = /^::?[\w\-]+/;
13
+
14
+ var urlTokens = function(stream, state){
15
+ var ch = stream.peek();
16
+
17
+ if (ch === ")"){
18
+ stream.next();
19
+ state.tokenizer = tokenBase;
20
+ return "operator";
21
+ }else if (ch === "("){
22
+ stream.next();
23
+ stream.eatSpace();
24
+
25
+ return "operator";
26
+ }else if (ch === "'" || ch === '"'){
27
+ state.tokenizer = buildStringTokenizer(stream.next());
28
+ return "string";
29
+ }else{
30
+ state.tokenizer = buildStringTokenizer(")", false);
31
+ return "string";
32
+ }
33
+ };
34
+ var multilineComment = function(stream, state) {
35
+ if (stream.skipTo("*/")){
36
+ stream.next();
37
+ stream.next();
38
+ state.tokenizer = tokenBase;
39
+ }else {
40
+ stream.next();
41
+ }
42
+
43
+ return "comment";
44
+ };
45
+
46
+ var buildStringTokenizer = function(quote, greedy){
47
+ if(greedy == null){ greedy = true; }
48
+
49
+ function stringTokenizer(stream, state){
50
+ var nextChar = stream.next();
51
+ var peekChar = stream.peek();
52
+ var previousChar = stream.string.charAt(stream.pos-2);
53
+
54
+ var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\"));
55
+
56
+ /*
57
+ console.log("previousChar: " + previousChar);
58
+ console.log("nextChar: " + nextChar);
59
+ console.log("peekChar: " + peekChar);
60
+ console.log("ending: " + endingString);
61
+ */
62
+
63
+ if (endingString){
64
+ if (nextChar !== quote && greedy) { stream.next(); }
65
+ state.tokenizer = tokenBase;
66
+ return "string";
67
+ }else if (nextChar === "#" && peekChar === "{"){
68
+ state.tokenizer = buildInterpolationTokenizer(stringTokenizer);
69
+ stream.next();
70
+ return "operator";
71
+ }else {
72
+ return "string";
73
+ }
74
+ }
75
+
76
+ return stringTokenizer;
77
+ };
78
+
79
+ var buildInterpolationTokenizer = function(currentTokenizer){
80
+ return function(stream, state){
81
+ if (stream.peek() === "}"){
82
+ stream.next();
83
+ state.tokenizer = currentTokenizer;
84
+ return "operator";
85
+ }else{
86
+ return tokenBase(stream, state);
87
+ }
88
+ };
89
+ };
90
+
91
+ var indent = function(state){
92
+ if (state.indentCount == 0){
93
+ state.indentCount++;
94
+ var lastScopeOffset = state.scopes[0].offset;
95
+ var currentOffset = lastScopeOffset + config.indentUnit;
96
+ state.scopes.unshift({ offset:currentOffset });
97
+ }
98
+ };
99
+
100
+ var dedent = function(state){
101
+ if (state.scopes.length == 1) { return; }
102
+
103
+ state.scopes.shift();
104
+ };
105
+
106
+ var tokenBase = function(stream, state) {
107
+ var ch = stream.peek();
108
+
109
+ // Single line Comment
110
+ if (stream.match('//')) {
111
+ stream.skipToEnd();
112
+ return "comment";
113
+ }
114
+
115
+ // Multiline Comment
116
+ if (stream.match('/*')){
117
+ state.tokenizer = multilineComment;
118
+ return state.tokenizer(stream, state);
119
+ }
120
+
121
+ // Interpolation
122
+ if (stream.match('#{')){
123
+ state.tokenizer = buildInterpolationTokenizer(tokenBase);
124
+ return "operator";
125
+ }
126
+
127
+ if (ch === "."){
128
+ stream.next();
129
+
130
+ // Match class selectors
131
+ if (stream.match(/^[\w-]+/)){
132
+ indent(state);
133
+ return "atom";
134
+ }else if (stream.peek() === "#"){
135
+ indent(state);
136
+ return "atom";
137
+ }else{
138
+ return "operator";
139
+ }
140
+ }
141
+
142
+ if (ch === "#"){
143
+ stream.next();
144
+
145
+ // Hex numbers
146
+ if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){
147
+ return "number";
148
+ }
149
+
150
+ // ID selectors
151
+ if (stream.match(/^[\w-]+/)){
152
+ indent(state);
153
+ return "atom";
154
+ }
155
+
156
+ if (stream.peek() === "#"){
157
+ indent(state);
158
+ return "atom";
159
+ }
160
+ }
161
+
162
+ // Numbers
163
+ if (stream.match(/^-?[0-9\.]+/)){
164
+ return "number";
165
+ }
166
+
167
+ // Units
168
+ if (stream.match(/^(px|em|in)\b/)){
169
+ return "unit";
170
+ }
171
+
172
+ if (stream.match(keywordsRegexp)){
173
+ return "keyword";
174
+ }
175
+
176
+ if (stream.match(/^url/) && stream.peek() === "("){
177
+ state.tokenizer = urlTokens;
178
+ return "atom";
179
+ }
180
+
181
+ // Variables
182
+ if (ch === "$"){
183
+ stream.next();
184
+ stream.eatWhile(/[\w-]/);
185
+
186
+ if (stream.peek() === ":"){
187
+ stream.next();
188
+ return "variable-2";
189
+ }else{
190
+ return "variable-3";
191
+ }
192
+ }
193
+
194
+ if (ch === "!"){
195
+ stream.next();
196
+
197
+ if (stream.match(/^[\w]+/)){
198
+ return "keyword";
199
+ }
200
+
201
+ return "operator";
202
+ }
203
+
204
+ if (ch === "="){
205
+ stream.next();
206
+
207
+ // Match shortcut mixin definition
208
+ if (stream.match(/^[\w-]+/)){
209
+ indent(state);
210
+ return "meta";
211
+ }else {
212
+ return "operator";
213
+ }
214
+ }
215
+
216
+ if (ch === "+"){
217
+ stream.next();
218
+
219
+ // Match shortcut mixin definition
220
+ if (stream.match(/^[\w-]+/)){
221
+ return "variable-3";
222
+ }else {
223
+ return "operator";
224
+ }
225
+ }
226
+
227
+ // Indent Directives
228
+ if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)){
229
+ indent(state);
230
+ return "meta";
231
+ }
232
+
233
+ // Other Directives
234
+ if (ch === "@"){
235
+ stream.next();
236
+ stream.eatWhile(/[\w-]/);
237
+ return "meta";
238
+ }
239
+
240
+ // Strings
241
+ if (ch === '"' || ch === "'"){
242
+ stream.next();
243
+ state.tokenizer = buildStringTokenizer(ch);
244
+ return "string";
245
+ }
246
+
247
+ // Pseudo element selectors
248
+ if (ch == ':' && stream.match(pseudoElementsRegexp)){
249
+ return "keyword";
250
+ }
251
+
252
+ // atoms
253
+ if (stream.eatWhile(/[\w-&]/)){
254
+ // matches a property definition
255
+ if (stream.peek() === ":" && !stream.match(pseudoElementsRegexp, false))
256
+ return "property";
257
+ else
258
+ return "atom";
259
+ }
260
+
261
+ if (stream.match(opRegexp)){
262
+ return "operator";
263
+ }
264
+
265
+ // If we haven't returned by now, we move 1 character
266
+ // and return an error
267
+ stream.next();
268
+ return null;
269
+ };
270
+
271
+ var tokenLexer = function(stream, state) {
272
+ if (stream.sol()){
273
+ state.indentCount = 0;
274
+ }
275
+ var style = state.tokenizer(stream, state);
276
+ var current = stream.current();
277
+
278
+ if (current === "@return"){
279
+ dedent(state);
280
+ }
281
+
282
+ if (style === "atom"){
283
+ indent(state);
284
+ }
285
+
286
+ if (style !== null){
287
+ var startOfToken = stream.pos - current.length;
288
+ var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount);
289
+
290
+ var newScopes = [];
291
+
292
+ for (var i = 0; i < state.scopes.length; i++){
293
+ var scope = state.scopes[i];
294
+
295
+ if (scope.offset <= withCurrentIndent){
296
+ newScopes.push(scope);
297
+ }
298
+ }
299
+
300
+ state.scopes = newScopes;
301
+ }
302
+
303
+
304
+ return style;
305
+ };
306
+
307
+ return {
308
+ startState: function() {
309
+ return {
310
+ tokenizer: tokenBase,
311
+ scopes: [{offset: 0, type: 'sass'}],
312
+ definedVars: [],
313
+ definedMixins: []
314
+ };
315
+ },
316
+ token: function(stream, state) {
317
+ var style = tokenLexer(stream, state);
318
+
319
+ state.lastToken = { style: style, content: stream.current() };
320
+
321
+ return style;
322
+ },
323
+
324
+ indent: function(state) {
325
+ return state.scopes[0].offset;
326
+ }
327
+ };
328
+ });
329
+
330
+ CodeMirror.defineMIME("text/x-sass", "sass");
@@ -0,0 +1,77 @@
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: Scheme 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
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="scheme.js"></script>
10
+ <style>.CodeMirror {background: #f8f8f8;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/marijnh/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">Scheme</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>Scheme mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ ; See if the input starts with a given symbol.
29
+ (define (match-symbol input pattern)
30
+ (cond ((null? (remain input)) #f)
31
+ ((eqv? (car (remain input)) pattern) (r-cdr input))
32
+ (else #f)))
33
+
34
+ ; Allow the input to start with one of a list of patterns.
35
+ (define (match-or input pattern)
36
+ (cond ((null? pattern) #f)
37
+ ((match-pattern input (car pattern)))
38
+ (else (match-or input (cdr pattern)))))
39
+
40
+ ; Allow a sequence of patterns.
41
+ (define (match-seq input pattern)
42
+ (if (null? pattern)
43
+ input
44
+ (let ((match (match-pattern input (car pattern))))
45
+ (if match (match-seq match (cdr pattern)) #f))))
46
+
47
+ ; Match with the pattern but no problem if it does not match.
48
+ (define (match-opt input pattern)
49
+ (let ((match (match-pattern input (car pattern))))
50
+ (if match match input)))
51
+
52
+ ; Match anything (other than '()), until pattern is found. The rather
53
+ ; clumsy form of requiring an ending pattern is needed to decide where
54
+ ; the end of the match is. If none is given, this will match the rest
55
+ ; of the sentence.
56
+ (define (match-any input pattern)
57
+ (cond ((null? (remain input)) #f)
58
+ ((null? pattern) (f-cons (remain input) (clear-remain input)))
59
+ (else
60
+ (let ((accum-any (collector)))
61
+ (define (match-pattern-any input pattern)
62
+ (cond ((null? (remain input)) #f)
63
+ (else (accum-any (car (remain input)))
64
+ (cond ((match-pattern (r-cdr input) pattern))
65
+ (else (match-pattern-any (r-cdr input) pattern))))))
66
+ (let ((retval (match-pattern-any input (car pattern))))
67
+ (if retval
68
+ (f-cons (accum-any) retval)
69
+ #f))))))
70
+ </textarea></form>
71
+ <script>
72
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
73
+ </script>
74
+
75
+ <p><strong>MIME types defined:</strong> <code>text/x-scheme</code>.</p>
76
+
77
+ </article>
@@ -0,0 +1,232 @@
1
+ /**
2
+ * Author: Koh Zi Han, based on implementation by Koh Zi Chun
3
+ */
4
+ CodeMirror.defineMode("scheme", function () {
5
+ var BUILTIN = "builtin", COMMENT = "comment", STRING = "string",
6
+ ATOM = "atom", NUMBER = "number", BRACKET = "bracket";
7
+ var INDENT_WORD_SKIP = 2;
8
+
9
+ function makeKeywords(str) {
10
+ var obj = {}, words = str.split(" ");
11
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
12
+ return obj;
13
+ }
14
+
15
+ var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?");
16
+ var indentKeys = makeKeywords("define let letrec let* lambda");
17
+
18
+ function stateStack(indent, type, prev) { // represents a state stack object
19
+ this.indent = indent;
20
+ this.type = type;
21
+ this.prev = prev;
22
+ }
23
+
24
+ function pushStack(state, indent, type) {
25
+ state.indentStack = new stateStack(indent, type, state.indentStack);
26
+ }
27
+
28
+ function popStack(state) {
29
+ state.indentStack = state.indentStack.prev;
30
+ }
31
+
32
+ var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i);
33
+ var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i);
34
+ var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i);
35
+ var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);
36
+
37
+ function isBinaryNumber (stream) {
38
+ return stream.match(binaryMatcher);
39
+ }
40
+
41
+ function isOctalNumber (stream) {
42
+ return stream.match(octalMatcher);
43
+ }
44
+
45
+ function isDecimalNumber (stream, backup) {
46
+ if (backup === true) {
47
+ stream.backUp(1);
48
+ }
49
+ return stream.match(decimalMatcher);
50
+ }
51
+
52
+ function isHexNumber (stream) {
53
+ return stream.match(hexMatcher);
54
+ }
55
+
56
+ return {
57
+ startState: function () {
58
+ return {
59
+ indentStack: null,
60
+ indentation: 0,
61
+ mode: false,
62
+ sExprComment: false
63
+ };
64
+ },
65
+
66
+ token: function (stream, state) {
67
+ if (state.indentStack == null && stream.sol()) {
68
+ // update indentation, but only if indentStack is empty
69
+ state.indentation = stream.indentation();
70
+ }
71
+
72
+ // skip spaces
73
+ if (stream.eatSpace()) {
74
+ return null;
75
+ }
76
+ var returnType = null;
77
+
78
+ switch(state.mode){
79
+ case "string": // multi-line string parsing mode
80
+ var next, escaped = false;
81
+ while ((next = stream.next()) != null) {
82
+ if (next == "\"" && !escaped) {
83
+
84
+ state.mode = false;
85
+ break;
86
+ }
87
+ escaped = !escaped && next == "\\";
88
+ }
89
+ returnType = STRING; // continue on in scheme-string mode
90
+ break;
91
+ case "comment": // comment parsing mode
92
+ var next, maybeEnd = false;
93
+ while ((next = stream.next()) != null) {
94
+ if (next == "#" && maybeEnd) {
95
+
96
+ state.mode = false;
97
+ break;
98
+ }
99
+ maybeEnd = (next == "|");
100
+ }
101
+ returnType = COMMENT;
102
+ break;
103
+ case "s-expr-comment": // s-expr commenting mode
104
+ state.mode = false;
105
+ if(stream.peek() == "(" || stream.peek() == "["){
106
+ // actually start scheme s-expr commenting mode
107
+ state.sExprComment = 0;
108
+ }else{
109
+ // if not we just comment the entire of the next token
110
+ stream.eatWhile(/[^/s]/); // eat non spaces
111
+ returnType = COMMENT;
112
+ break;
113
+ }
114
+ default: // default parsing mode
115
+ var ch = stream.next();
116
+
117
+ if (ch == "\"") {
118
+ state.mode = "string";
119
+ returnType = STRING;
120
+
121
+ } else if (ch == "'") {
122
+ returnType = ATOM;
123
+ } else if (ch == '#') {
124
+ if (stream.eat("|")) { // Multi-line comment
125
+ state.mode = "comment"; // toggle to comment mode
126
+ returnType = COMMENT;
127
+ } else if (stream.eat(/[tf]/i)) { // #t/#f (atom)
128
+ returnType = ATOM;
129
+ } else if (stream.eat(';')) { // S-Expr comment
130
+ state.mode = "s-expr-comment";
131
+ returnType = COMMENT;
132
+ } else {
133
+ var numTest = null, hasExactness = false, hasRadix = true;
134
+ if (stream.eat(/[ei]/i)) {
135
+ hasExactness = true;
136
+ } else {
137
+ stream.backUp(1); // must be radix specifier
138
+ }
139
+ if (stream.match(/^#b/i)) {
140
+ numTest = isBinaryNumber;
141
+ } else if (stream.match(/^#o/i)) {
142
+ numTest = isOctalNumber;
143
+ } else if (stream.match(/^#x/i)) {
144
+ numTest = isHexNumber;
145
+ } else if (stream.match(/^#d/i)) {
146
+ numTest = isDecimalNumber;
147
+ } else if (stream.match(/^[-+0-9.]/, false)) {
148
+ hasRadix = false;
149
+ numTest = isDecimalNumber;
150
+ // re-consume the intial # if all matches failed
151
+ } else if (!hasExactness) {
152
+ stream.eat('#');
153
+ }
154
+ if (numTest != null) {
155
+ if (hasRadix && !hasExactness) {
156
+ // consume optional exactness after radix
157
+ stream.match(/^#[ei]/i);
158
+ }
159
+ if (numTest(stream))
160
+ returnType = NUMBER;
161
+ }
162
+ }
163
+ } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal
164
+ returnType = NUMBER;
165
+ } else if (ch == ";") { // comment
166
+ stream.skipToEnd(); // rest of the line is a comment
167
+ returnType = COMMENT;
168
+ } else if (ch == "(" || ch == "[") {
169
+ var keyWord = ''; var indentTemp = stream.column(), letter;
170
+ /**
171
+ Either
172
+ (indent-word ..
173
+ (non-indent-word ..
174
+ (;something else, bracket, etc.
175
+ */
176
+
177
+ while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) {
178
+ keyWord += letter;
179
+ }
180
+
181
+ if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word
182
+
183
+ pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
184
+ } else { // non-indent word
185
+ // we continue eating the spaces
186
+ stream.eatSpace();
187
+ if (stream.eol() || stream.peek() == ";") {
188
+ // nothing significant after
189
+ // we restart indentation 1 space after
190
+ pushStack(state, indentTemp + 1, ch);
191
+ } else {
192
+ pushStack(state, indentTemp + stream.current().length, ch); // else we match
193
+ }
194
+ }
195
+ stream.backUp(stream.current().length - 1); // undo all the eating
196
+
197
+ if(typeof state.sExprComment == "number") state.sExprComment++;
198
+
199
+ returnType = BRACKET;
200
+ } else if (ch == ")" || ch == "]") {
201
+ returnType = BRACKET;
202
+ if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) {
203
+ popStack(state);
204
+
205
+ if(typeof state.sExprComment == "number"){
206
+ if(--state.sExprComment == 0){
207
+ returnType = COMMENT; // final closing bracket
208
+ state.sExprComment = false; // turn off s-expr commenting mode
209
+ }
210
+ }
211
+ }
212
+ } else {
213
+ stream.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/);
214
+
215
+ if (keywords && keywords.propertyIsEnumerable(stream.current())) {
216
+ returnType = BUILTIN;
217
+ } else returnType = "variable";
218
+ }
219
+ }
220
+ return (typeof state.sExprComment == "number") ? COMMENT : returnType;
221
+ },
222
+
223
+ indent: function (state) {
224
+ if (state.indentStack == null) return state.indentation;
225
+ return state.indentStack.indent;
226
+ },
227
+
228
+ lineComment: ";;"
229
+ };
230
+ });
231
+
232
+ CodeMirror.defineMIME("text/x-scheme", "scheme");