rails_db 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/assets/javascripts/codemirror/codemirror.js +9762 -0
  4. data/app/assets/javascripts/codemirror/codemirror/addons/comment/comment.js +209 -0
  5. data/app/assets/javascripts/codemirror/codemirror/addons/comment/continuecomment.js +78 -0
  6. data/app/assets/javascripts/codemirror/codemirror/addons/dialog/dialog.js +161 -0
  7. data/app/assets/javascripts/codemirror/codemirror/addons/display/autorefresh.js +47 -0
  8. data/app/assets/javascripts/codemirror/codemirror/addons/display/fullscreen.js +41 -0
  9. data/app/assets/javascripts/codemirror/codemirror/addons/display/panel.js +127 -0
  10. data/app/assets/javascripts/codemirror/codemirror/addons/display/placeholder.js +63 -0
  11. data/app/assets/javascripts/codemirror/codemirror/addons/display/rulers.js +51 -0
  12. data/app/assets/javascripts/codemirror/codemirror/addons/edit/closebrackets.js +191 -0
  13. data/app/assets/javascripts/codemirror/codemirror/addons/edit/closetag.js +183 -0
  14. data/app/assets/javascripts/codemirror/codemirror/addons/edit/continuelist.js +99 -0
  15. data/app/assets/javascripts/codemirror/codemirror/addons/edit/matchbrackets.js +150 -0
  16. data/app/assets/javascripts/codemirror/codemirror/addons/edit/matchtags.js +66 -0
  17. data/app/assets/javascripts/codemirror/codemirror/addons/edit/trailingspace.js +27 -0
  18. data/app/assets/javascripts/codemirror/codemirror/addons/fold/brace-fold.js +105 -0
  19. data/app/assets/javascripts/codemirror/codemirror/addons/fold/comment-fold.js +59 -0
  20. data/app/assets/javascripts/codemirror/codemirror/addons/fold/foldcode.js +152 -0
  21. data/app/assets/javascripts/codemirror/codemirror/addons/fold/foldgutter.js +146 -0
  22. data/app/assets/javascripts/codemirror/codemirror/addons/fold/indent-fold.js +48 -0
  23. data/app/assets/javascripts/codemirror/codemirror/addons/fold/markdown-fold.js +49 -0
  24. data/app/assets/javascripts/codemirror/codemirror/addons/fold/xml-fold.js +184 -0
  25. data/app/assets/javascripts/codemirror/codemirror/addons/hint/anyword-hint.js +41 -0
  26. data/app/assets/javascripts/codemirror/codemirror/addons/hint/css-hint.js +60 -0
  27. data/app/assets/javascripts/codemirror/codemirror/addons/hint/html-hint.js +350 -0
  28. data/app/assets/javascripts/codemirror/codemirror/addons/hint/javascript-hint.js +157 -0
  29. data/app/assets/javascripts/codemirror/codemirror/addons/hint/show-hint.js +460 -0
  30. data/app/assets/javascripts/codemirror/codemirror/addons/hint/sql-hint.js +304 -0
  31. data/app/assets/javascripts/codemirror/codemirror/addons/hint/xml-hint.js +120 -0
  32. data/app/assets/javascripts/codemirror/codemirror/addons/lint/coffeescript-lint.js +47 -0
  33. data/app/assets/javascripts/codemirror/codemirror/addons/lint/css-lint.js +40 -0
  34. data/app/assets/javascripts/codemirror/codemirror/addons/lint/html-lint.js +59 -0
  35. data/app/assets/javascripts/codemirror/codemirror/addons/lint/javascript-lint.js +63 -0
  36. data/app/assets/javascripts/codemirror/codemirror/addons/lint/json-lint.js +40 -0
  37. data/app/assets/javascripts/codemirror/codemirror/addons/lint/lint.js +252 -0
  38. data/app/assets/javascripts/codemirror/codemirror/addons/lint/yaml-lint.js +41 -0
  39. data/app/assets/javascripts/codemirror/codemirror/addons/merge/merge.js +1002 -0
  40. data/app/assets/javascripts/codemirror/codemirror/addons/mode/loadmode.js +64 -0
  41. data/app/assets/javascripts/codemirror/codemirror/addons/mode/multiplex.js +131 -0
  42. data/app/assets/javascripts/codemirror/codemirror/addons/mode/multiplex_test.js +33 -0
  43. data/app/assets/javascripts/codemirror/codemirror/addons/mode/overlay.js +90 -0
  44. data/app/assets/javascripts/codemirror/codemirror/addons/mode/simple.js +216 -0
  45. data/app/assets/javascripts/codemirror/codemirror/addons/runmode/colorize.js +40 -0
  46. data/app/assets/javascripts/codemirror/codemirror/addons/runmode/runmode-standalone.js +158 -0
  47. data/app/assets/javascripts/codemirror/codemirror/addons/runmode/runmode.js +72 -0
  48. data/app/assets/javascripts/codemirror/codemirror/addons/runmode/runmode.node.js +197 -0
  49. data/app/assets/javascripts/codemirror/codemirror/addons/scroll/annotatescrollbar.js +122 -0
  50. data/app/assets/javascripts/codemirror/codemirror/addons/scroll/scrollpastend.js +48 -0
  51. data/app/assets/javascripts/codemirror/codemirror/addons/scroll/simplescrollbars.js +152 -0
  52. data/app/assets/javascripts/codemirror/codemirror/addons/search/jump-to-line.js +50 -0
  53. data/app/assets/javascripts/codemirror/codemirror/addons/search/match-highlighter.js +165 -0
  54. data/app/assets/javascripts/codemirror/codemirror/addons/search/matchesonscrollbar.js +97 -0
  55. data/app/assets/javascripts/codemirror/codemirror/addons/search/search.js +260 -0
  56. data/app/assets/javascripts/codemirror/codemirror/addons/search/searchcursor.js +293 -0
  57. data/app/assets/javascripts/codemirror/codemirror/addons/selection/active-line.js +72 -0
  58. data/app/assets/javascripts/codemirror/codemirror/addons/selection/mark-selection.js +119 -0
  59. data/app/assets/javascripts/codemirror/codemirror/addons/selection/selection-pointer.js +98 -0
  60. data/app/assets/javascripts/codemirror/codemirror/addons/tern/tern.js +718 -0
  61. data/app/assets/javascripts/codemirror/codemirror/addons/tern/worker.js +44 -0
  62. data/app/assets/javascripts/codemirror/codemirror/addons/wrap/hardwrap.js +145 -0
  63. data/app/assets/javascripts/codemirror/codemirror/keymaps/emacs.js +418 -0
  64. data/app/assets/javascripts/codemirror/codemirror/keymaps/sublime.js +691 -0
  65. data/app/assets/javascripts/codemirror/codemirror/keymaps/vim.js +5494 -0
  66. data/app/assets/javascripts/codemirror/codemirror/modes/apl.js +174 -0
  67. data/app/assets/javascripts/codemirror/codemirror/modes/asciiarmor.js +74 -0
  68. data/app/assets/javascripts/codemirror/codemirror/modes/asn.1.js +204 -0
  69. data/app/assets/javascripts/codemirror/codemirror/modes/asterisk.js +196 -0
  70. data/app/assets/javascripts/codemirror/codemirror/modes/brainfuck.js +85 -0
  71. data/app/assets/javascripts/codemirror/codemirror/modes/clike.js +884 -0
  72. data/app/assets/javascripts/codemirror/codemirror/modes/clojure.js +292 -0
  73. data/app/assets/javascripts/codemirror/codemirror/modes/cmake.js +97 -0
  74. data/app/assets/javascripts/codemirror/codemirror/modes/cobol.js +255 -0
  75. data/app/assets/javascripts/codemirror/codemirror/modes/coffeescript.js +359 -0
  76. data/app/assets/javascripts/codemirror/codemirror/modes/commonlisp.js +124 -0
  77. data/app/assets/javascripts/codemirror/codemirror/modes/crystal.js +433 -0
  78. data/app/assets/javascripts/codemirror/codemirror/modes/css.js +831 -0
  79. data/app/assets/javascripts/codemirror/codemirror/modes/cypher.js +150 -0
  80. data/app/assets/javascripts/codemirror/codemirror/modes/d.js +223 -0
  81. data/app/assets/javascripts/codemirror/codemirror/modes/dart.js +157 -0
  82. data/app/assets/javascripts/codemirror/codemirror/modes/diff.js +47 -0
  83. data/app/assets/javascripts/codemirror/codemirror/modes/django.js +356 -0
  84. data/app/assets/javascripts/codemirror/codemirror/modes/dockerfile.js +211 -0
  85. data/app/assets/javascripts/codemirror/codemirror/modes/dtd.js +142 -0
  86. data/app/assets/javascripts/codemirror/codemirror/modes/dylan.js +352 -0
  87. data/app/assets/javascripts/codemirror/codemirror/modes/ebnf.js +195 -0
  88. data/app/assets/javascripts/codemirror/codemirror/modes/ecl.js +206 -0
  89. data/app/assets/javascripts/codemirror/codemirror/modes/eiffel.js +160 -0
  90. data/app/assets/javascripts/codemirror/codemirror/modes/elm.js +205 -0
  91. data/app/assets/javascripts/codemirror/codemirror/modes/erlang.js +619 -0
  92. data/app/assets/javascripts/codemirror/codemirror/modes/factor.js +85 -0
  93. data/app/assets/javascripts/codemirror/codemirror/modes/fcl.js +173 -0
  94. data/app/assets/javascripts/codemirror/codemirror/modes/forth.js +180 -0
  95. data/app/assets/javascripts/codemirror/codemirror/modes/fortran.js +188 -0
  96. data/app/assets/javascripts/codemirror/codemirror/modes/gas.js +345 -0
  97. data/app/assets/javascripts/codemirror/codemirror/modes/gfm.js +129 -0
  98. data/app/assets/javascripts/codemirror/codemirror/modes/gherkin.js +178 -0
  99. data/app/assets/javascripts/codemirror/codemirror/modes/go.js +187 -0
  100. data/app/assets/javascripts/codemirror/codemirror/modes/groovy.js +233 -0
  101. data/app/assets/javascripts/codemirror/codemirror/modes/haml.js +161 -0
  102. data/app/assets/javascripts/codemirror/codemirror/modes/handlebars.js +66 -0
  103. data/app/assets/javascripts/codemirror/codemirror/modes/haskell-literate.js +43 -0
  104. data/app/assets/javascripts/codemirror/codemirror/modes/haskell.js +268 -0
  105. data/app/assets/javascripts/codemirror/codemirror/modes/haxe.js +515 -0
  106. data/app/assets/javascripts/codemirror/codemirror/modes/htmlembedded.js +37 -0
  107. data/app/assets/javascripts/codemirror/codemirror/modes/htmlmixed.js +152 -0
  108. data/app/assets/javascripts/codemirror/codemirror/modes/http.js +113 -0
  109. data/app/assets/javascripts/codemirror/codemirror/modes/idl.js +290 -0
  110. data/app/assets/javascripts/codemirror/codemirror/modes/jade.js +590 -0
  111. data/app/assets/javascripts/codemirror/codemirror/modes/javascript.js +927 -0
  112. data/app/assets/javascripts/codemirror/codemirror/modes/jinja2.js +146 -0
  113. data/app/assets/javascripts/codemirror/codemirror/modes/jsx.js +148 -0
  114. data/app/assets/javascripts/codemirror/codemirror/modes/julia.js +431 -0
  115. data/app/assets/javascripts/codemirror/codemirror/modes/livescript.js +280 -0
  116. data/app/assets/javascripts/codemirror/codemirror/modes/lua.js +159 -0
  117. data/app/assets/javascripts/codemirror/codemirror/modes/markdown.js +884 -0
  118. data/app/assets/javascripts/codemirror/codemirror/modes/mathematica.js +176 -0
  119. data/app/assets/javascripts/codemirror/codemirror/modes/mbox.js +129 -0
  120. data/app/assets/javascripts/codemirror/codemirror/modes/meta.js +218 -0
  121. data/app/assets/javascripts/codemirror/codemirror/modes/mirc.js +193 -0
  122. data/app/assets/javascripts/codemirror/codemirror/modes/mllike.js +359 -0
  123. data/app/assets/javascripts/codemirror/codemirror/modes/modelica.js +245 -0
  124. data/app/assets/javascripts/codemirror/codemirror/modes/mscgen.js +175 -0
  125. data/app/assets/javascripts/codemirror/codemirror/modes/mumps.js +148 -0
  126. data/app/assets/javascripts/codemirror/codemirror/modes/nginx.js +178 -0
  127. data/app/assets/javascripts/codemirror/codemirror/modes/nsis.js +95 -0
  128. data/app/assets/javascripts/codemirror/codemirror/modes/ntriples.js +195 -0
  129. data/app/assets/javascripts/codemirror/codemirror/modes/octave.js +139 -0
  130. data/app/assets/javascripts/codemirror/codemirror/modes/oz.js +252 -0
  131. data/app/assets/javascripts/codemirror/codemirror/modes/pascal.js +121 -0
  132. data/app/assets/javascripts/codemirror/codemirror/modes/pegjs.js +114 -0
  133. data/app/assets/javascripts/codemirror/codemirror/modes/perl.js +837 -0
  134. data/app/assets/javascripts/codemirror/codemirror/modes/php.js +234 -0
  135. data/app/assets/javascripts/codemirror/codemirror/modes/pig.js +178 -0
  136. data/app/assets/javascripts/codemirror/codemirror/modes/powershell.js +398 -0
  137. data/app/assets/javascripts/codemirror/codemirror/modes/properties.js +78 -0
  138. data/app/assets/javascripts/codemirror/codemirror/modes/protobuf.js +69 -0
  139. data/app/assets/javascripts/codemirror/codemirror/modes/pug.js +591 -0
  140. data/app/assets/javascripts/codemirror/codemirror/modes/puppet.js +220 -0
  141. data/app/assets/javascripts/codemirror/codemirror/modes/python.js +399 -0
  142. data/app/assets/javascripts/codemirror/codemirror/modes/q.js +139 -0
  143. data/app/assets/javascripts/codemirror/codemirror/modes/r.js +190 -0
  144. data/app/assets/javascripts/codemirror/codemirror/modes/rpm.js +109 -0
  145. data/app/assets/javascripts/codemirror/codemirror/modes/rst.js +557 -0
  146. data/app/assets/javascripts/codemirror/codemirror/modes/ruby.js +298 -0
  147. data/app/assets/javascripts/codemirror/codemirror/modes/rust.js +72 -0
  148. data/app/assets/javascripts/codemirror/codemirror/modes/sas.js +303 -0
  149. data/app/assets/javascripts/codemirror/codemirror/modes/sass.js +454 -0
  150. data/app/assets/javascripts/codemirror/codemirror/modes/scheme.js +265 -0
  151. data/app/assets/javascripts/codemirror/codemirror/modes/shell.js +152 -0
  152. data/app/assets/javascripts/codemirror/codemirror/modes/sieve.js +193 -0
  153. data/app/assets/javascripts/codemirror/codemirror/modes/slim.js +575 -0
  154. data/app/assets/javascripts/codemirror/codemirror/modes/smalltalk.js +168 -0
  155. data/app/assets/javascripts/codemirror/codemirror/modes/smarty.js +225 -0
  156. data/app/assets/javascripts/codemirror/codemirror/modes/solr.js +104 -0
  157. data/app/assets/javascripts/codemirror/codemirror/modes/soy.js +435 -0
  158. data/app/assets/javascripts/codemirror/codemirror/modes/sparql.js +180 -0
  159. data/app/assets/javascripts/codemirror/codemirror/modes/spreadsheet.js +112 -0
  160. data/app/assets/javascripts/codemirror/codemirror/modes/sql.js +494 -0
  161. data/app/assets/javascripts/codemirror/codemirror/modes/stex.js +264 -0
  162. data/app/assets/javascripts/codemirror/codemirror/modes/stylus.js +771 -0
  163. data/app/assets/javascripts/codemirror/codemirror/modes/swift.js +223 -0
  164. data/app/assets/javascripts/codemirror/codemirror/modes/tcl.js +139 -0
  165. data/app/assets/javascripts/codemirror/codemirror/modes/textile.js +469 -0
  166. data/app/assets/javascripts/codemirror/codemirror/modes/tiddlywiki.js +308 -0
  167. data/app/assets/javascripts/codemirror/codemirror/modes/tiki.js +312 -0
  168. data/app/assets/javascripts/codemirror/codemirror/modes/toml.js +88 -0
  169. data/app/assets/javascripts/codemirror/codemirror/modes/tornado.js +68 -0
  170. data/app/assets/javascripts/codemirror/codemirror/modes/troff.js +84 -0
  171. data/app/assets/javascripts/codemirror/codemirror/modes/ttcn-cfg.js +214 -0
  172. data/app/assets/javascripts/codemirror/codemirror/modes/ttcn.js +283 -0
  173. data/app/assets/javascripts/codemirror/codemirror/modes/turtle.js +162 -0
  174. data/app/assets/javascripts/codemirror/codemirror/modes/twig.js +141 -0
  175. data/app/assets/javascripts/codemirror/codemirror/modes/vb.js +275 -0
  176. data/app/assets/javascripts/codemirror/codemirror/modes/vbscript.js +350 -0
  177. data/app/assets/javascripts/codemirror/codemirror/modes/velocity.js +201 -0
  178. data/app/assets/javascripts/codemirror/codemirror/modes/verilog.js +675 -0
  179. data/app/assets/javascripts/codemirror/codemirror/modes/vhdl.js +189 -0
  180. data/app/assets/javascripts/codemirror/codemirror/modes/vue.js +77 -0
  181. data/app/assets/javascripts/codemirror/codemirror/modes/webidl.js +195 -0
  182. data/app/assets/javascripts/codemirror/codemirror/modes/xml.js +402 -0
  183. data/app/assets/javascripts/codemirror/codemirror/modes/xquery.js +448 -0
  184. data/app/assets/javascripts/codemirror/codemirror/modes/yacas.js +204 -0
  185. data/app/assets/javascripts/codemirror/codemirror/modes/yaml-frontmatter.js +68 -0
  186. data/app/assets/javascripts/codemirror/codemirror/modes/yaml.js +120 -0
  187. data/app/assets/javascripts/codemirror/codemirror/modes/z80.js +116 -0
  188. data/app/assets/javascripts/rails_db/application.js +4 -4
  189. data/app/assets/stylesheets/codemirror/codemirror.css +346 -0
  190. data/app/assets/stylesheets/codemirror/codemirror/addons/dialog/dialog.css +32 -0
  191. data/app/assets/stylesheets/codemirror/codemirror/addons/display/fullscreen.css +6 -0
  192. data/app/assets/stylesheets/codemirror/codemirror/addons/fold/foldgutter.css +20 -0
  193. data/app/assets/stylesheets/codemirror/codemirror/addons/hint/show-hint.css +36 -0
  194. data/app/assets/stylesheets/codemirror/codemirror/addons/lint/lint.css +73 -0
  195. data/app/assets/stylesheets/codemirror/codemirror/addons/merge/merge.css +119 -0
  196. data/app/assets/stylesheets/codemirror/codemirror/addons/scroll/simplescrollbars.css +66 -0
  197. data/app/assets/stylesheets/codemirror/codemirror/addons/search/matchesonscrollbar.css +8 -0
  198. data/app/assets/stylesheets/codemirror/codemirror/addons/tern/tern.css +87 -0
  199. data/app/assets/stylesheets/codemirror/codemirror/modes/tiddlywiki.css +14 -0
  200. data/app/assets/stylesheets/codemirror/codemirror/modes/tiki.css +26 -0
  201. data/app/assets/stylesheets/codemirror/codemirror/themes/3024-day.css +41 -0
  202. data/app/assets/stylesheets/codemirror/codemirror/themes/3024-night.css +39 -0
  203. data/app/assets/stylesheets/codemirror/codemirror/themes/abcdef.css +32 -0
  204. data/app/assets/stylesheets/codemirror/codemirror/themes/ambiance-mobile.css +5 -0
  205. data/app/assets/stylesheets/codemirror/codemirror/themes/ambiance.css +74 -0
  206. data/app/assets/stylesheets/codemirror/codemirror/themes/base16-dark.css +38 -0
  207. data/app/assets/stylesheets/codemirror/codemirror/themes/base16-light.css +38 -0
  208. data/app/assets/stylesheets/codemirror/codemirror/themes/bespin.css +34 -0
  209. data/app/assets/stylesheets/codemirror/codemirror/themes/blackboard.css +32 -0
  210. data/app/assets/stylesheets/codemirror/codemirror/themes/cobalt.css +25 -0
  211. data/app/assets/stylesheets/codemirror/codemirror/themes/colorforth.css +33 -0
  212. data/app/assets/stylesheets/codemirror/codemirror/themes/darcula.css +51 -0
  213. data/app/assets/stylesheets/codemirror/codemirror/themes/dracula.css +40 -0
  214. data/app/assets/stylesheets/codemirror/codemirror/themes/duotone-dark.css +35 -0
  215. data/app/assets/stylesheets/codemirror/codemirror/themes/duotone-light.css +36 -0
  216. data/app/assets/stylesheets/codemirror/codemirror/themes/eclipse.css +23 -0
  217. data/app/assets/stylesheets/codemirror/codemirror/themes/elegant.css +13 -0
  218. data/app/assets/stylesheets/codemirror/codemirror/themes/erlang-dark.css +34 -0
  219. data/app/assets/stylesheets/codemirror/codemirror/themes/gruvbox-dark.css +37 -0
  220. data/app/assets/stylesheets/codemirror/codemirror/themes/hopscotch.css +34 -0
  221. data/app/assets/stylesheets/codemirror/codemirror/themes/icecoder.css +43 -0
  222. data/app/assets/stylesheets/codemirror/codemirror/themes/idea.css +42 -0
  223. data/app/assets/stylesheets/codemirror/codemirror/themes/isotope.css +34 -0
  224. data/app/assets/stylesheets/codemirror/codemirror/themes/lesser-dark.css +47 -0
  225. data/app/assets/stylesheets/codemirror/codemirror/themes/liquibyte.css +95 -0
  226. data/app/assets/stylesheets/codemirror/codemirror/themes/lucario.css +37 -0
  227. data/app/assets/stylesheets/codemirror/codemirror/themes/material.css +53 -0
  228. data/app/assets/stylesheets/codemirror/codemirror/themes/mbo.css +37 -0
  229. data/app/assets/stylesheets/codemirror/codemirror/themes/mdn-like.css +46 -0
  230. data/app/assets/stylesheets/codemirror/codemirror/themes/midnight.css +39 -0
  231. data/app/assets/stylesheets/codemirror/codemirror/themes/monokai.css +41 -0
  232. data/app/assets/stylesheets/codemirror/codemirror/themes/neat.css +12 -0
  233. data/app/assets/stylesheets/codemirror/codemirror/themes/neo.css +43 -0
  234. data/app/assets/stylesheets/codemirror/codemirror/themes/night.css +27 -0
  235. data/app/assets/stylesheets/codemirror/codemirror/themes/nord.css +42 -0
  236. data/app/assets/stylesheets/codemirror/codemirror/themes/oceanic-next.css +44 -0
  237. data/app/assets/stylesheets/codemirror/codemirror/themes/panda-syntax.css +85 -0
  238. data/app/assets/stylesheets/codemirror/codemirror/themes/paraiso-dark.css +38 -0
  239. data/app/assets/stylesheets/codemirror/codemirror/themes/paraiso-light.css +38 -0
  240. data/app/assets/stylesheets/codemirror/codemirror/themes/pastel-on-dark.css +52 -0
  241. data/app/assets/stylesheets/codemirror/codemirror/themes/railscasts.css +34 -0
  242. data/app/assets/stylesheets/codemirror/codemirror/themes/rubyblue.css +25 -0
  243. data/app/assets/stylesheets/codemirror/codemirror/themes/seti.css +44 -0
  244. data/app/assets/stylesheets/codemirror/codemirror/themes/shadowfox.css +52 -0
  245. data/app/assets/stylesheets/codemirror/codemirror/themes/solarized.css +168 -0
  246. data/app/assets/stylesheets/codemirror/codemirror/themes/ssms.css +16 -0
  247. data/app/assets/stylesheets/codemirror/codemirror/themes/the-matrix.css +30 -0
  248. data/app/assets/stylesheets/codemirror/codemirror/themes/tomorrow-night-bright.css +35 -0
  249. data/app/assets/stylesheets/codemirror/codemirror/themes/tomorrow-night-eighties.css +38 -0
  250. data/app/assets/stylesheets/codemirror/codemirror/themes/ttcn.css +64 -0
  251. data/app/assets/stylesheets/codemirror/codemirror/themes/twilight.css +32 -0
  252. data/app/assets/stylesheets/codemirror/codemirror/themes/vibrant-ink.css +34 -0
  253. data/app/assets/stylesheets/codemirror/codemirror/themes/xq-dark.css +53 -0
  254. data/app/assets/stylesheets/codemirror/codemirror/themes/xq-light.css +43 -0
  255. data/app/assets/stylesheets/codemirror/codemirror/themes/zenburn.css +37 -0
  256. data/app/assets/stylesheets/rails_db/application.css +3 -3
  257. data/lib/rails_db/engine.rb +1 -1
  258. data/lib/rails_db/version.rb +1 -1
  259. metadata +253 -1
@@ -0,0 +1,196 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
3
+
4
+ /*
5
+ * =====================================================================================
6
+ *
7
+ * Filename: mode/asterisk/asterisk.js
8
+ *
9
+ * Description: CodeMirror mode for Asterisk dialplan
10
+ *
11
+ * Created: 05/17/2012 09:20:25 PM
12
+ * Revision: none
13
+ *
14
+ * Author: Stas Kobzar (stas@modulis.ca),
15
+ * Company: Modulis.ca Inc.
16
+ *
17
+ * =====================================================================================
18
+ */
19
+
20
+ (function(mod) {
21
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
22
+ mod(require("../../lib/codemirror"));
23
+ else if (typeof define == "function" && define.amd) // AMD
24
+ define(["../../lib/codemirror"], mod);
25
+ else // Plain browser env
26
+ mod(CodeMirror);
27
+ })(function(CodeMirror) {
28
+ "use strict";
29
+
30
+ CodeMirror.defineMode("asterisk", function() {
31
+ var atoms = ["exten", "same", "include","ignorepat","switch"],
32
+ dpcmd = ["#include","#exec"],
33
+ apps = [
34
+ "addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi",
35
+ "alarmreceiver","amd","answer","authenticate","background","backgrounddetect",
36
+ "bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent",
37
+ "changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge",
38
+ "congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge",
39
+ "dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility",
40
+ "datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa",
41
+ "dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy",
42
+ "externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif",
43
+ "goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete",
44
+ "ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus",
45
+ "jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme",
46
+ "meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete",
47
+ "minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode",
48
+ "mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish",
49
+ "originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce",
50
+ "parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones",
51
+ "privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten",
52
+ "readfile","receivefax","receivefax","receivefax","record","removequeuemember",
53
+ "resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun",
54
+ "saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax",
55
+ "sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags",
56
+ "setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel",
57
+ "slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground",
58
+ "speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound",
59
+ "speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor",
60
+ "stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec",
61
+ "trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate",
62
+ "vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring",
63
+ "waitforsilence","waitmusiconhold","waituntil","while","zapateller"
64
+ ];
65
+
66
+ function basicToken(stream,state){
67
+ var cur = '';
68
+ var ch = stream.next();
69
+ // comment
70
+ if(ch == ";") {
71
+ stream.skipToEnd();
72
+ return "comment";
73
+ }
74
+ // context
75
+ if(ch == '[') {
76
+ stream.skipTo(']');
77
+ stream.eat(']');
78
+ return "header";
79
+ }
80
+ // string
81
+ if(ch == '"') {
82
+ stream.skipTo('"');
83
+ return "string";
84
+ }
85
+ if(ch == "'") {
86
+ stream.skipTo("'");
87
+ return "string-2";
88
+ }
89
+ // dialplan commands
90
+ if(ch == '#') {
91
+ stream.eatWhile(/\w/);
92
+ cur = stream.current();
93
+ if(dpcmd.indexOf(cur) !== -1) {
94
+ stream.skipToEnd();
95
+ return "strong";
96
+ }
97
+ }
98
+ // application args
99
+ if(ch == '$'){
100
+ var ch1 = stream.peek();
101
+ if(ch1 == '{'){
102
+ stream.skipTo('}');
103
+ stream.eat('}');
104
+ return "variable-3";
105
+ }
106
+ }
107
+ // extension
108
+ stream.eatWhile(/\w/);
109
+ cur = stream.current();
110
+ if(atoms.indexOf(cur) !== -1) {
111
+ state.extenStart = true;
112
+ switch(cur) {
113
+ case 'same': state.extenSame = true; break;
114
+ case 'include':
115
+ case 'switch':
116
+ case 'ignorepat':
117
+ state.extenInclude = true;break;
118
+ default:break;
119
+ }
120
+ return "atom";
121
+ }
122
+ }
123
+
124
+ return {
125
+ startState: function() {
126
+ return {
127
+ extenStart: false,
128
+ extenSame: false,
129
+ extenInclude: false,
130
+ extenExten: false,
131
+ extenPriority: false,
132
+ extenApplication: false
133
+ };
134
+ },
135
+ token: function(stream, state) {
136
+
137
+ var cur = '';
138
+ if(stream.eatSpace()) return null;
139
+ // extension started
140
+ if(state.extenStart){
141
+ stream.eatWhile(/[^\s]/);
142
+ cur = stream.current();
143
+ if(/^=>?$/.test(cur)){
144
+ state.extenExten = true;
145
+ state.extenStart = false;
146
+ return "strong";
147
+ } else {
148
+ state.extenStart = false;
149
+ stream.skipToEnd();
150
+ return "error";
151
+ }
152
+ } else if(state.extenExten) {
153
+ // set exten and priority
154
+ state.extenExten = false;
155
+ state.extenPriority = true;
156
+ stream.eatWhile(/[^,]/);
157
+ if(state.extenInclude) {
158
+ stream.skipToEnd();
159
+ state.extenPriority = false;
160
+ state.extenInclude = false;
161
+ }
162
+ if(state.extenSame) {
163
+ state.extenPriority = false;
164
+ state.extenSame = false;
165
+ state.extenApplication = true;
166
+ }
167
+ return "tag";
168
+ } else if(state.extenPriority) {
169
+ state.extenPriority = false;
170
+ state.extenApplication = true;
171
+ stream.next(); // get comma
172
+ if(state.extenSame) return null;
173
+ stream.eatWhile(/[^,]/);
174
+ return "number";
175
+ } else if(state.extenApplication) {
176
+ stream.eatWhile(/,/);
177
+ cur = stream.current();
178
+ if(cur === ',') return null;
179
+ stream.eatWhile(/\w/);
180
+ cur = stream.current().toLowerCase();
181
+ state.extenApplication = false;
182
+ if(apps.indexOf(cur) !== -1){
183
+ return "def strong";
184
+ }
185
+ } else{
186
+ return basicToken(stream,state);
187
+ }
188
+
189
+ return null;
190
+ }
191
+ };
192
+ });
193
+
194
+ CodeMirror.defineMIME("text/x-asterisk", "asterisk");
195
+
196
+ });
@@ -0,0 +1,85 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
3
+
4
+ // Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11
5
+
6
+ (function(mod) {
7
+ if (typeof exports == "object" && typeof module == "object")
8
+ mod(require("../../lib/codemirror"))
9
+ else if (typeof define == "function" && define.amd)
10
+ define(["../../lib/codemirror"], mod)
11
+ else
12
+ mod(CodeMirror)
13
+ })(function(CodeMirror) {
14
+ "use strict"
15
+ var reserve = "><+-.,[]".split("");
16
+ /*
17
+ comments can be either:
18
+ placed behind lines
19
+
20
+ +++ this is a comment
21
+
22
+ where reserved characters cannot be used
23
+ or in a loop
24
+ [
25
+ this is ok to use [ ] and stuff
26
+ ]
27
+ or preceded by #
28
+ */
29
+ CodeMirror.defineMode("brainfuck", function() {
30
+ return {
31
+ startState: function() {
32
+ return {
33
+ commentLine: false,
34
+ left: 0,
35
+ right: 0,
36
+ commentLoop: false
37
+ }
38
+ },
39
+ token: function(stream, state) {
40
+ if (stream.eatSpace()) return null
41
+ if(stream.sol()){
42
+ state.commentLine = false;
43
+ }
44
+ var ch = stream.next().toString();
45
+ if(reserve.indexOf(ch) !== -1){
46
+ if(state.commentLine === true){
47
+ if(stream.eol()){
48
+ state.commentLine = false;
49
+ }
50
+ return "comment";
51
+ }
52
+ if(ch === "]" || ch === "["){
53
+ if(ch === "["){
54
+ state.left++;
55
+ }
56
+ else{
57
+ state.right++;
58
+ }
59
+ return "bracket";
60
+ }
61
+ else if(ch === "+" || ch === "-"){
62
+ return "keyword";
63
+ }
64
+ else if(ch === "<" || ch === ">"){
65
+ return "atom";
66
+ }
67
+ else if(ch === "." || ch === ","){
68
+ return "def";
69
+ }
70
+ }
71
+ else{
72
+ state.commentLine = true;
73
+ if(stream.eol()){
74
+ state.commentLine = false;
75
+ }
76
+ return "comment";
77
+ }
78
+ if(stream.eol()){
79
+ state.commentLine = false;
80
+ }
81
+ }
82
+ };
83
+ });
84
+ CodeMirror.defineMIME("text/x-brainfuck","brainfuck")
85
+ });
@@ -0,0 +1,884 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ function Context(indented, column, type, info, align, prev) {
15
+ this.indented = indented;
16
+ this.column = column;
17
+ this.type = type;
18
+ this.info = info;
19
+ this.align = align;
20
+ this.prev = prev;
21
+ }
22
+ function pushContext(state, col, type, info) {
23
+ var indent = state.indented;
24
+ if (state.context && state.context.type == "statement" && type != "statement")
25
+ indent = state.context.indented;
26
+ return state.context = new Context(indent, col, type, info, null, state.context);
27
+ }
28
+ function popContext(state) {
29
+ var t = state.context.type;
30
+ if (t == ")" || t == "]" || t == "}")
31
+ state.indented = state.context.indented;
32
+ return state.context = state.context.prev;
33
+ }
34
+
35
+ function typeBefore(stream, state, pos) {
36
+ if (state.prevToken == "variable" || state.prevToken == "type") return true;
37
+ if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
38
+ if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
39
+ }
40
+
41
+ function isTopScope(context) {
42
+ for (;;) {
43
+ if (!context || context.type == "top") return true;
44
+ if (context.type == "}" && context.prev.info != "namespace") return false;
45
+ context = context.prev;
46
+ }
47
+ }
48
+
49
+ CodeMirror.defineMode("clike", function(config, parserConfig) {
50
+ var indentUnit = config.indentUnit,
51
+ statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
52
+ dontAlignCalls = parserConfig.dontAlignCalls,
53
+ keywords = parserConfig.keywords || {},
54
+ types = parserConfig.types || {},
55
+ builtin = parserConfig.builtin || {},
56
+ blockKeywords = parserConfig.blockKeywords || {},
57
+ defKeywords = parserConfig.defKeywords || {},
58
+ atoms = parserConfig.atoms || {},
59
+ hooks = parserConfig.hooks || {},
60
+ multiLineStrings = parserConfig.multiLineStrings,
61
+ indentStatements = parserConfig.indentStatements !== false,
62
+ indentSwitch = parserConfig.indentSwitch !== false,
63
+ namespaceSeparator = parserConfig.namespaceSeparator,
64
+ isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
65
+ numberStart = parserConfig.numberStart || /[\d\.]/,
66
+ number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
67
+ isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
68
+ isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/,
69
+ // An optional function that takes a {string} token and returns true if it
70
+ // should be treated as a builtin.
71
+ isReservedIdentifier = parserConfig.isReservedIdentifier || false;
72
+
73
+ var curPunc, isDefKeyword;
74
+
75
+ function tokenBase(stream, state) {
76
+ var ch = stream.next();
77
+ if (hooks[ch]) {
78
+ var result = hooks[ch](stream, state);
79
+ if (result !== false) return result;
80
+ }
81
+ if (ch == '"' || ch == "'") {
82
+ state.tokenize = tokenString(ch);
83
+ return state.tokenize(stream, state);
84
+ }
85
+ if (isPunctuationChar.test(ch)) {
86
+ curPunc = ch;
87
+ return null;
88
+ }
89
+ if (numberStart.test(ch)) {
90
+ stream.backUp(1)
91
+ if (stream.match(number)) return "number"
92
+ stream.next()
93
+ }
94
+ if (ch == "/") {
95
+ if (stream.eat("*")) {
96
+ state.tokenize = tokenComment;
97
+ return tokenComment(stream, state);
98
+ }
99
+ if (stream.eat("/")) {
100
+ stream.skipToEnd();
101
+ return "comment";
102
+ }
103
+ }
104
+ if (isOperatorChar.test(ch)) {
105
+ while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
106
+ return "operator";
107
+ }
108
+ stream.eatWhile(isIdentifierChar);
109
+ if (namespaceSeparator) while (stream.match(namespaceSeparator))
110
+ stream.eatWhile(isIdentifierChar);
111
+
112
+ var cur = stream.current();
113
+ if (contains(keywords, cur)) {
114
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
115
+ if (contains(defKeywords, cur)) isDefKeyword = true;
116
+ return "keyword";
117
+ }
118
+ if (contains(types, cur)) return "type";
119
+ if (contains(builtin, cur)
120
+ || (isReservedIdentifier && isReservedIdentifier(cur))) {
121
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
122
+ return "builtin";
123
+ }
124
+ if (contains(atoms, cur)) return "atom";
125
+ return "variable";
126
+ }
127
+
128
+ function tokenString(quote) {
129
+ return function(stream, state) {
130
+ var escaped = false, next, end = false;
131
+ while ((next = stream.next()) != null) {
132
+ if (next == quote && !escaped) {end = true; break;}
133
+ escaped = !escaped && next == "\\";
134
+ }
135
+ if (end || !(escaped || multiLineStrings))
136
+ state.tokenize = null;
137
+ return "string";
138
+ };
139
+ }
140
+
141
+ function tokenComment(stream, state) {
142
+ var maybeEnd = false, ch;
143
+ while (ch = stream.next()) {
144
+ if (ch == "/" && maybeEnd) {
145
+ state.tokenize = null;
146
+ break;
147
+ }
148
+ maybeEnd = (ch == "*");
149
+ }
150
+ return "comment";
151
+ }
152
+
153
+ function maybeEOL(stream, state) {
154
+ if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))
155
+ state.typeAtEndOfLine = typeBefore(stream, state, stream.pos)
156
+ }
157
+
158
+ // Interface
159
+
160
+ return {
161
+ startState: function(basecolumn) {
162
+ return {
163
+ tokenize: null,
164
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
165
+ indented: 0,
166
+ startOfLine: true,
167
+ prevToken: null
168
+ };
169
+ },
170
+
171
+ token: function(stream, state) {
172
+ var ctx = state.context;
173
+ if (stream.sol()) {
174
+ if (ctx.align == null) ctx.align = false;
175
+ state.indented = stream.indentation();
176
+ state.startOfLine = true;
177
+ }
178
+ if (stream.eatSpace()) { maybeEOL(stream, state); return null; }
179
+ curPunc = isDefKeyword = null;
180
+ var style = (state.tokenize || tokenBase)(stream, state);
181
+ if (style == "comment" || style == "meta") return style;
182
+ if (ctx.align == null) ctx.align = true;
183
+
184
+ if (curPunc == ";" || curPunc == ":" || (curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)))
185
+ while (state.context.type == "statement") popContext(state);
186
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
187
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
188
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
189
+ else if (curPunc == "}") {
190
+ while (ctx.type == "statement") ctx = popContext(state);
191
+ if (ctx.type == "}") ctx = popContext(state);
192
+ while (ctx.type == "statement") ctx = popContext(state);
193
+ }
194
+ else if (curPunc == ctx.type) popContext(state);
195
+ else if (indentStatements &&
196
+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
197
+ (ctx.type == "statement" && curPunc == "newstatement"))) {
198
+ pushContext(state, stream.column(), "statement", stream.current());
199
+ }
200
+
201
+ if (style == "variable" &&
202
+ ((state.prevToken == "def" ||
203
+ (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) &&
204
+ isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
205
+ style = "def";
206
+
207
+ if (hooks.token) {
208
+ var result = hooks.token(stream, state, style);
209
+ if (result !== undefined) style = result;
210
+ }
211
+
212
+ if (style == "def" && parserConfig.styleDefs === false) style = "variable";
213
+
214
+ state.startOfLine = false;
215
+ state.prevToken = isDefKeyword ? "def" : style || curPunc;
216
+ maybeEOL(stream, state);
217
+ return style;
218
+ },
219
+
220
+ indent: function(state, textAfter) {
221
+ if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
222
+ var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
223
+ var closing = firstChar == ctx.type;
224
+ if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
225
+ if (parserConfig.dontIndentStatements)
226
+ while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info))
227
+ ctx = ctx.prev
228
+ if (hooks.indent) {
229
+ var hook = hooks.indent(state, ctx, textAfter, indentUnit);
230
+ if (typeof hook == "number") return hook
231
+ }
232
+ var switchBlock = ctx.prev && ctx.prev.info == "switch";
233
+ if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
234
+ while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
235
+ return ctx.indented
236
+ }
237
+ if (ctx.type == "statement")
238
+ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
239
+ if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
240
+ return ctx.column + (closing ? 0 : 1);
241
+ if (ctx.type == ")" && !closing)
242
+ return ctx.indented + statementIndentUnit;
243
+
244
+ return ctx.indented + (closing ? 0 : indentUnit) +
245
+ (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
246
+ },
247
+
248
+ electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
249
+ blockCommentStart: "/*",
250
+ blockCommentEnd: "*/",
251
+ blockCommentContinue: " * ",
252
+ lineComment: "//",
253
+ fold: "brace"
254
+ };
255
+ });
256
+
257
+ function words(str) {
258
+ var obj = {}, words = str.split(" ");
259
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
260
+ return obj;
261
+ }
262
+ function contains(words, word) {
263
+ if (typeof words === "function") {
264
+ return words(word);
265
+ } else {
266
+ return words.propertyIsEnumerable(word);
267
+ }
268
+ }
269
+ var cKeywords = "auto if break case register continue return default do sizeof " +
270
+ "static else struct switch extern typedef union for goto while enum const " +
271
+ "volatile inline restrict asm fortran";
272
+
273
+ // Do not use this. Use the cTypes function below. This is global just to avoid
274
+ // excessive calls when cTypes is being called multiple times during a parse.
275
+ var basicCTypes = words("int long char short double float unsigned signed " +
276
+ "void bool");
277
+
278
+ // Do not use this. Use the objCTypes function below. This is global just to avoid
279
+ // excessive calls when objCTypes is being called multiple times during a parse.
280
+ var basicObjCTypes = words("SEL instancetype id Class Protocol BOOL");
281
+
282
+ // Returns true if identifier is a "C" type.
283
+ // C type is defined as those that are reserved by the compiler (basicTypes),
284
+ // and those that end in _t (Reserved by POSIX for types)
285
+ // http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html
286
+ function cTypes(identifier) {
287
+ return contains(basicCTypes, identifier) || /.+_t$/.test(identifier);
288
+ }
289
+
290
+ // Returns true if identifier is a "Objective C" type.
291
+ function objCTypes(identifier) {
292
+ return cTypes(identifier) || contains(basicObjCTypes, identifier);
293
+ }
294
+
295
+ var cBlockKeywords = "case do else for if switch while struct enum union";
296
+ var cDefKeywords = "struct enum union";
297
+
298
+ function cppHook(stream, state) {
299
+ if (!state.startOfLine) return false
300
+ for (var ch, next = null; ch = stream.peek();) {
301
+ if (ch == "\\" && stream.match(/^.$/)) {
302
+ next = cppHook
303
+ break
304
+ } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
305
+ break
306
+ }
307
+ stream.next()
308
+ }
309
+ state.tokenize = next
310
+ return "meta"
311
+ }
312
+
313
+ function pointerHook(_stream, state) {
314
+ if (state.prevToken == "type") return "type";
315
+ return false;
316
+ }
317
+
318
+ // For C and C++ (and ObjC): identifiers starting with __
319
+ // or _ followed by a capital letter are reserved for the compiler.
320
+ function cIsReservedIdentifier(token) {
321
+ if (!token || token.length < 2) return false;
322
+ if (token[0] != '_') return false;
323
+ return (token[1] == '_') || (token[1] !== token[1].toLowerCase());
324
+ }
325
+
326
+ function cpp14Literal(stream) {
327
+ stream.eatWhile(/[\w\.']/);
328
+ return "number";
329
+ }
330
+
331
+ function cpp11StringHook(stream, state) {
332
+ stream.backUp(1);
333
+ // Raw strings.
334
+ if (stream.match(/(R|u8R|uR|UR|LR)/)) {
335
+ var match = stream.match(/"([^\s\\()]{0,16})\(/);
336
+ if (!match) {
337
+ return false;
338
+ }
339
+ state.cpp11RawStringDelim = match[1];
340
+ state.tokenize = tokenRawString;
341
+ return tokenRawString(stream, state);
342
+ }
343
+ // Unicode strings/chars.
344
+ if (stream.match(/(u8|u|U|L)/)) {
345
+ if (stream.match(/["']/, /* eat */ false)) {
346
+ return "string";
347
+ }
348
+ return false;
349
+ }
350
+ // Ignore this hook.
351
+ stream.next();
352
+ return false;
353
+ }
354
+
355
+ function cppLooksLikeConstructor(word) {
356
+ var lastTwo = /(\w+)::~?(\w+)$/.exec(word);
357
+ return lastTwo && lastTwo[1] == lastTwo[2];
358
+ }
359
+
360
+ // C#-style strings where "" escapes a quote.
361
+ function tokenAtString(stream, state) {
362
+ var next;
363
+ while ((next = stream.next()) != null) {
364
+ if (next == '"' && !stream.eat('"')) {
365
+ state.tokenize = null;
366
+ break;
367
+ }
368
+ }
369
+ return "string";
370
+ }
371
+
372
+ // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
373
+ // <delim> can be a string up to 16 characters long.
374
+ function tokenRawString(stream, state) {
375
+ // Escape characters that have special regex meanings.
376
+ var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
377
+ var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
378
+ if (match)
379
+ state.tokenize = null;
380
+ else
381
+ stream.skipToEnd();
382
+ return "string";
383
+ }
384
+
385
+ function def(mimes, mode) {
386
+ if (typeof mimes == "string") mimes = [mimes];
387
+ var words = [];
388
+ function add(obj) {
389
+ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
390
+ words.push(prop);
391
+ }
392
+ add(mode.keywords);
393
+ add(mode.types);
394
+ add(mode.builtin);
395
+ add(mode.atoms);
396
+ if (words.length) {
397
+ mode.helperType = mimes[0];
398
+ CodeMirror.registerHelper("hintWords", mimes[0], words);
399
+ }
400
+
401
+ for (var i = 0; i < mimes.length; ++i)
402
+ CodeMirror.defineMIME(mimes[i], mode);
403
+ }
404
+
405
+ def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
406
+ name: "clike",
407
+ keywords: words(cKeywords),
408
+ types: cTypes,
409
+ blockKeywords: words(cBlockKeywords),
410
+ defKeywords: words(cDefKeywords),
411
+ typeFirstDefinitions: true,
412
+ atoms: words("NULL true false"),
413
+ isReservedIdentifier: cIsReservedIdentifier,
414
+ hooks: {
415
+ "#": cppHook,
416
+ "*": pointerHook,
417
+ },
418
+ modeProps: {fold: ["brace", "include"]}
419
+ });
420
+
421
+ def(["text/x-c++src", "text/x-c++hdr"], {
422
+ name: "clike",
423
+ // Keywords from https://en.cppreference.com/w/cpp/keyword includes C++20.
424
+ keywords: words(cKeywords + "alignas alignof and and_eq audit axiom bitand bitor catch " +
425
+ "class compl concept constexpr const_cast decltype delete dynamic_cast " +
426
+ "explicit export final friend import module mutable namespace new noexcept " +
427
+ "not not_eq operator or or_eq override private protected public " +
428
+ "reinterpret_cast requires static_assert static_cast template this " +
429
+ "thread_local throw try typeid typename using virtual xor xor_eq"),
430
+ types: cTypes,
431
+ blockKeywords: words(cBlockKeywords + " class try catch"),
432
+ defKeywords: words(cDefKeywords + " class namespace"),
433
+ typeFirstDefinitions: true,
434
+ atoms: words("true false NULL nullptr"),
435
+ dontIndentStatements: /^template$/,
436
+ isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
437
+ isReservedIdentifier: cIsReservedIdentifier,
438
+ hooks: {
439
+ "#": cppHook,
440
+ "*": pointerHook,
441
+ "u": cpp11StringHook,
442
+ "U": cpp11StringHook,
443
+ "L": cpp11StringHook,
444
+ "R": cpp11StringHook,
445
+ "0": cpp14Literal,
446
+ "1": cpp14Literal,
447
+ "2": cpp14Literal,
448
+ "3": cpp14Literal,
449
+ "4": cpp14Literal,
450
+ "5": cpp14Literal,
451
+ "6": cpp14Literal,
452
+ "7": cpp14Literal,
453
+ "8": cpp14Literal,
454
+ "9": cpp14Literal,
455
+ token: function(stream, state, style) {
456
+ if (style == "variable" && stream.peek() == "(" &&
457
+ (state.prevToken == ";" || state.prevToken == null ||
458
+ state.prevToken == "}") &&
459
+ cppLooksLikeConstructor(stream.current()))
460
+ return "def";
461
+ }
462
+ },
463
+ namespaceSeparator: "::",
464
+ modeProps: {fold: ["brace", "include"]}
465
+ });
466
+
467
+ def("text/x-java", {
468
+ name: "clike",
469
+ keywords: words("abstract assert break case catch class const continue default " +
470
+ "do else enum extends final finally for goto if implements import " +
471
+ "instanceof interface native new package private protected public " +
472
+ "return static strictfp super switch synchronized this throw throws transient " +
473
+ "try volatile while @interface"),
474
+ types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
475
+ "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
476
+ blockKeywords: words("catch class do else finally for if switch try while"),
477
+ defKeywords: words("class interface enum @interface"),
478
+ typeFirstDefinitions: true,
479
+ atoms: words("true false null"),
480
+ number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
481
+ hooks: {
482
+ "@": function(stream) {
483
+ // Don't match the @interface keyword.
484
+ if (stream.match('interface', false)) return false;
485
+
486
+ stream.eatWhile(/[\w\$_]/);
487
+ return "meta";
488
+ }
489
+ },
490
+ modeProps: {fold: ["brace", "import"]}
491
+ });
492
+
493
+ def("text/x-csharp", {
494
+ name: "clike",
495
+ keywords: words("abstract as async await base break case catch checked class const continue" +
496
+ " default delegate do else enum event explicit extern finally fixed for" +
497
+ " foreach goto if implicit in interface internal is lock namespace new" +
498
+ " operator out override params private protected public readonly ref return sealed" +
499
+ " sizeof stackalloc static struct switch this throw try typeof unchecked" +
500
+ " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
501
+ " global group into join let orderby partial remove select set value var yield"),
502
+ types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
503
+ " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
504
+ " UInt64 bool byte char decimal double short int long object" +
505
+ " sbyte float string ushort uint ulong"),
506
+ blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
507
+ defKeywords: words("class interface namespace struct var"),
508
+ typeFirstDefinitions: true,
509
+ atoms: words("true false null"),
510
+ hooks: {
511
+ "@": function(stream, state) {
512
+ if (stream.eat('"')) {
513
+ state.tokenize = tokenAtString;
514
+ return tokenAtString(stream, state);
515
+ }
516
+ stream.eatWhile(/[\w\$_]/);
517
+ return "meta";
518
+ }
519
+ }
520
+ });
521
+
522
+ function tokenTripleString(stream, state) {
523
+ var escaped = false;
524
+ while (!stream.eol()) {
525
+ if (!escaped && stream.match('"""')) {
526
+ state.tokenize = null;
527
+ break;
528
+ }
529
+ escaped = stream.next() == "\\" && !escaped;
530
+ }
531
+ return "string";
532
+ }
533
+
534
+ function tokenNestedComment(depth) {
535
+ return function (stream, state) {
536
+ var ch
537
+ while (ch = stream.next()) {
538
+ if (ch == "*" && stream.eat("/")) {
539
+ if (depth == 1) {
540
+ state.tokenize = null
541
+ break
542
+ } else {
543
+ state.tokenize = tokenNestedComment(depth - 1)
544
+ return state.tokenize(stream, state)
545
+ }
546
+ } else if (ch == "/" && stream.eat("*")) {
547
+ state.tokenize = tokenNestedComment(depth + 1)
548
+ return state.tokenize(stream, state)
549
+ }
550
+ }
551
+ return "comment"
552
+ }
553
+ }
554
+
555
+ def("text/x-scala", {
556
+ name: "clike",
557
+ keywords: words(
558
+ /* scala */
559
+ "abstract case catch class def do else extends final finally for forSome if " +
560
+ "implicit import lazy match new null object override package private protected return " +
561
+ "sealed super this throw trait try type val var while with yield _ " +
562
+
563
+ /* package scala */
564
+ "assert assume require print println printf readLine readBoolean readByte readShort " +
565
+ "readChar readInt readLong readFloat readDouble"
566
+ ),
567
+ types: words(
568
+ "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
569
+ "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
570
+ "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
571
+ "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
572
+ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
573
+
574
+ /* package java.lang */
575
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
576
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
577
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
578
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
579
+ ),
580
+ multiLineStrings: true,
581
+ blockKeywords: words("catch class enum do else finally for forSome if match switch try while"),
582
+ defKeywords: words("class enum def object package trait type val var"),
583
+ atoms: words("true false null"),
584
+ indentStatements: false,
585
+ indentSwitch: false,
586
+ isOperatorChar: /[+\-*&%=<>!?|\/#:@]/,
587
+ hooks: {
588
+ "@": function(stream) {
589
+ stream.eatWhile(/[\w\$_]/);
590
+ return "meta";
591
+ },
592
+ '"': function(stream, state) {
593
+ if (!stream.match('""')) return false;
594
+ state.tokenize = tokenTripleString;
595
+ return state.tokenize(stream, state);
596
+ },
597
+ "'": function(stream) {
598
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
599
+ return "atom";
600
+ },
601
+ "=": function(stream, state) {
602
+ var cx = state.context
603
+ if (cx.type == "}" && cx.align && stream.eat(">")) {
604
+ state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev)
605
+ return "operator"
606
+ } else {
607
+ return false
608
+ }
609
+ },
610
+
611
+ "/": function(stream, state) {
612
+ if (!stream.eat("*")) return false
613
+ state.tokenize = tokenNestedComment(1)
614
+ return state.tokenize(stream, state)
615
+ }
616
+ },
617
+ modeProps: {closeBrackets: {pairs: '()[]{}""', triples: '"'}}
618
+ });
619
+
620
+ function tokenKotlinString(tripleString){
621
+ return function (stream, state) {
622
+ var escaped = false, next, end = false;
623
+ while (!stream.eol()) {
624
+ if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
625
+ if (tripleString && stream.match('"""')) {end = true; break;}
626
+ next = stream.next();
627
+ if(!escaped && next == "$" && stream.match('{'))
628
+ stream.skipTo("}");
629
+ escaped = !escaped && next == "\\" && !tripleString;
630
+ }
631
+ if (end || !tripleString)
632
+ state.tokenize = null;
633
+ return "string";
634
+ }
635
+ }
636
+
637
+ def("text/x-kotlin", {
638
+ name: "clike",
639
+ keywords: words(
640
+ /*keywords*/
641
+ "package as typealias class interface this super val operator " +
642
+ "var fun for is in This throw return annotation " +
643
+ "break continue object if else while do try when !in !is as? " +
644
+
645
+ /*soft keywords*/
646
+ "file import where by get set abstract enum open inner override private public internal " +
647
+ "protected catch finally out final vararg reified dynamic companion constructor init " +
648
+ "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
649
+ "external annotation crossinline const operator infix suspend actual expect setparam"
650
+ ),
651
+ types: words(
652
+ /* package java.lang */
653
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
654
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
655
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
656
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray " +
657
+ "ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy " +
658
+ "LazyThreadSafetyMode LongArray Nothing ShortArray Unit"
659
+ ),
660
+ intendSwitch: false,
661
+ indentStatements: false,
662
+ multiLineStrings: true,
663
+ number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
664
+ blockKeywords: words("catch class do else finally for if where try while enum"),
665
+ defKeywords: words("class val var object interface fun"),
666
+ atoms: words("true false null this"),
667
+ hooks: {
668
+ "@": function(stream) {
669
+ stream.eatWhile(/[\w\$_]/);
670
+ return "meta";
671
+ },
672
+ '*': function(_stream, state) {
673
+ return state.prevToken == '.' ? 'variable' : 'operator';
674
+ },
675
+ '"': function(stream, state) {
676
+ state.tokenize = tokenKotlinString(stream.match('""'));
677
+ return state.tokenize(stream, state);
678
+ },
679
+ indent: function(state, ctx, textAfter, indentUnit) {
680
+ var firstChar = textAfter && textAfter.charAt(0);
681
+ if ((state.prevToken == "}" || state.prevToken == ")") && textAfter == "")
682
+ return state.indented;
683
+ if (state.prevToken == "operator" && textAfter != "}" ||
684
+ state.prevToken == "variable" && firstChar == "." ||
685
+ (state.prevToken == "}" || state.prevToken == ")") && firstChar == ".")
686
+ return indentUnit * 2 + ctx.indented;
687
+ if (ctx.align && ctx.type == "}")
688
+ return ctx.indented + (state.context.type == (textAfter || "").charAt(0) ? 0 : indentUnit);
689
+ }
690
+ },
691
+ modeProps: {closeBrackets: {triples: '"'}}
692
+ });
693
+
694
+ def(["x-shader/x-vertex", "x-shader/x-fragment"], {
695
+ name: "clike",
696
+ keywords: words("sampler1D sampler2D sampler3D samplerCube " +
697
+ "sampler1DShadow sampler2DShadow " +
698
+ "const attribute uniform varying " +
699
+ "break continue discard return " +
700
+ "for while do if else struct " +
701
+ "in out inout"),
702
+ types: words("float int bool void " +
703
+ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
704
+ "mat2 mat3 mat4"),
705
+ blockKeywords: words("for while do if else struct"),
706
+ builtin: words("radians degrees sin cos tan asin acos atan " +
707
+ "pow exp log exp2 sqrt inversesqrt " +
708
+ "abs sign floor ceil fract mod min max clamp mix step smoothstep " +
709
+ "length distance dot cross normalize ftransform faceforward " +
710
+ "reflect refract matrixCompMult " +
711
+ "lessThan lessThanEqual greaterThan greaterThanEqual " +
712
+ "equal notEqual any all not " +
713
+ "texture1D texture1DProj texture1DLod texture1DProjLod " +
714
+ "texture2D texture2DProj texture2DLod texture2DProjLod " +
715
+ "texture3D texture3DProj texture3DLod texture3DProjLod " +
716
+ "textureCube textureCubeLod " +
717
+ "shadow1D shadow2D shadow1DProj shadow2DProj " +
718
+ "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
719
+ "dFdx dFdy fwidth " +
720
+ "noise1 noise2 noise3 noise4"),
721
+ atoms: words("true false " +
722
+ "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
723
+ "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
724
+ "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
725
+ "gl_FogCoord gl_PointCoord " +
726
+ "gl_Position gl_PointSize gl_ClipVertex " +
727
+ "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
728
+ "gl_TexCoord gl_FogFragCoord " +
729
+ "gl_FragCoord gl_FrontFacing " +
730
+ "gl_FragData gl_FragDepth " +
731
+ "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
732
+ "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
733
+ "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
734
+ "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
735
+ "gl_ProjectionMatrixInverseTranspose " +
736
+ "gl_ModelViewProjectionMatrixInverseTranspose " +
737
+ "gl_TextureMatrixInverseTranspose " +
738
+ "gl_NormalScale gl_DepthRange gl_ClipPlane " +
739
+ "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
740
+ "gl_FrontLightModelProduct gl_BackLightModelProduct " +
741
+ "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
742
+ "gl_FogParameters " +
743
+ "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
744
+ "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
745
+ "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
746
+ "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
747
+ "gl_MaxDrawBuffers"),
748
+ indentSwitch: false,
749
+ hooks: {"#": cppHook},
750
+ modeProps: {fold: ["brace", "include"]}
751
+ });
752
+
753
+ def("text/x-nesc", {
754
+ name: "clike",
755
+ keywords: words(cKeywords + " as atomic async call command component components configuration event generic " +
756
+ "implementation includes interface module new norace nx_struct nx_union post provides " +
757
+ "signal task uses abstract extends"),
758
+ types: cTypes,
759
+ blockKeywords: words(cBlockKeywords),
760
+ atoms: words("null true false"),
761
+ hooks: {"#": cppHook},
762
+ modeProps: {fold: ["brace", "include"]}
763
+ });
764
+
765
+ def("text/x-objectivec", {
766
+ name: "clike",
767
+ keywords: words(cKeywords + " bycopy byref in inout oneway out self super atomic nonatomic retain copy " +
768
+ "readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd " +
769
+ "@interface @implementation @end @protocol @encode @property @synthesize @dynamic @class " +
770
+ "@public @package @private @protected @required @optional @try @catch @finally @import " +
771
+ "@selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available"),
772
+ types: objCTypes,
773
+ builtin: words("FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINED " +
774
+ "NS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER " +
775
+ "NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN " +
776
+ "NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT"),
777
+ blockKeywords: words(cBlockKeywords + " @synthesize @try @catch @finally @autoreleasepool @synchronized"),
778
+ defKeywords: words(cDefKeywords + " @interface @implementation @protocol @class"),
779
+ dontIndentStatements: /^@.*$/,
780
+ typeFirstDefinitions: true,
781
+ atoms: words("YES NO NULL Nil nil true false nullptr"),
782
+ isReservedIdentifier: cIsReservedIdentifier,
783
+ hooks: {
784
+ "#": cppHook,
785
+ "*": pointerHook,
786
+ },
787
+ modeProps: {fold: ["brace", "include"]}
788
+ });
789
+
790
+ def("text/x-squirrel", {
791
+ name: "clike",
792
+ keywords: words("base break clone continue const default delete enum extends function in class" +
793
+ " foreach local resume return this throw typeof yield constructor instanceof static"),
794
+ types: cTypes,
795
+ blockKeywords: words("case catch class else for foreach if switch try while"),
796
+ defKeywords: words("function local class"),
797
+ typeFirstDefinitions: true,
798
+ atoms: words("true false null"),
799
+ hooks: {"#": cppHook},
800
+ modeProps: {fold: ["brace", "include"]}
801
+ });
802
+
803
+ // Ceylon Strings need to deal with interpolation
804
+ var stringTokenizer = null;
805
+ function tokenCeylonString(type) {
806
+ return function(stream, state) {
807
+ var escaped = false, next, end = false;
808
+ while (!stream.eol()) {
809
+ if (!escaped && stream.match('"') &&
810
+ (type == "single" || stream.match('""'))) {
811
+ end = true;
812
+ break;
813
+ }
814
+ if (!escaped && stream.match('``')) {
815
+ stringTokenizer = tokenCeylonString(type);
816
+ end = true;
817
+ break;
818
+ }
819
+ next = stream.next();
820
+ escaped = type == "single" && !escaped && next == "\\";
821
+ }
822
+ if (end)
823
+ state.tokenize = null;
824
+ return "string";
825
+ }
826
+ }
827
+
828
+ def("text/x-ceylon", {
829
+ name: "clike",
830
+ keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
831
+ " exists extends finally for function given if import in interface is let module new" +
832
+ " nonempty object of out outer package return satisfies super switch then this throw" +
833
+ " try value void while"),
834
+ types: function(word) {
835
+ // In Ceylon all identifiers that start with an uppercase are types
836
+ var first = word.charAt(0);
837
+ return (first === first.toUpperCase() && first !== first.toLowerCase());
838
+ },
839
+ blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
840
+ defKeywords: words("class dynamic function interface module object package value"),
841
+ builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
842
+ " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
843
+ isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
844
+ isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
845
+ numberStart: /[\d#$]/,
846
+ number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
847
+ multiLineStrings: true,
848
+ typeFirstDefinitions: true,
849
+ atoms: words("true false null larger smaller equal empty finished"),
850
+ indentSwitch: false,
851
+ styleDefs: false,
852
+ hooks: {
853
+ "@": function(stream) {
854
+ stream.eatWhile(/[\w\$_]/);
855
+ return "meta";
856
+ },
857
+ '"': function(stream, state) {
858
+ state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
859
+ return state.tokenize(stream, state);
860
+ },
861
+ '`': function(stream, state) {
862
+ if (!stringTokenizer || !stream.match('`')) return false;
863
+ state.tokenize = stringTokenizer;
864
+ stringTokenizer = null;
865
+ return state.tokenize(stream, state);
866
+ },
867
+ "'": function(stream) {
868
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
869
+ return "atom";
870
+ },
871
+ token: function(_stream, state, style) {
872
+ if ((style == "variable" || style == "type") &&
873
+ state.prevToken == ".") {
874
+ return "variable-2";
875
+ }
876
+ }
877
+ },
878
+ modeProps: {
879
+ fold: ["brace", "import"],
880
+ closeBrackets: {triples: '"'}
881
+ }
882
+ });
883
+
884
+ });